OIFwdKinematicsInterface.h
Go to the documentation of this file.
1/*
2 * OIFwdKinematicsInterface.h
3 *
4 *
5 * Created by A. Bierbaumm on 28.03.08.
6 * Copyright 2008 IAIM Universitaet Karlsruhe.
7 * All rights reserved.
8 *
9 */
10
11#pragma once
12
13/** \file OIFwdKinematicsInterface.h
14* The header file for OIFwdKinematicsInterface.
15*/
16
17#ifdef WIN32
18/*
19#include <Inventor/Win/SoWin.h>
20#include <Inventor/Win/viewers/SoWinExaminerViewer.h>
21#define SO_WINDOW HWND
22#define SO_PLATFORM SoWin
23#define SO_EXAMINER_VIEWER SoWinExaminerViewer
24*/
25#include <Inventor/Qt/SoQt.h>
26#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
27#define SO_WINDOW QWidget*
28#define SO_PLATFORM SoQt
29#define SO_EXAMINER_VIEWER SoQtExaminerViewer
30#else
31#include <Inventor/Qt/SoQt.h>
32#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
33#define SO_WINDOW QWidget*
34#define SO_PLATFORM SoQt
35#define SO_EXAMINER_VIEWER SoQtExaminerViewer
36#endif
37
38#include <string>
39
40#include <qapplication.h>
41
42#include <Inventor/SbLinear.h>
43#include <Inventor/nodes/SoSeparator.h>
44
45#ifdef HAVE_COLLISION_DET
46#include <Inventor/SoInteraction.h>
47#include <Inventor/collision/SoIntersectionDetectionAction.h>
48#endif
49
50// meins
51#include <Inventor/SoOffscreenRenderer.h>
52#include <Inventor/nodes/SoDirectionalLight.h>
53#include <Inventor/nodes/SoPerspectiveCamera.h>
54
55//#include <Inventor/SoPerspectiveCamera.h>
56
57
58namespace visionx
59{
61 {
62 public:
63 OIFwdKinematicsInterface(std::string filename = "");
65 void expandFileNodes();
66 void update();
67 void run();
68 void initviewer();
69 bool isInitialized();
70
71 bool getPath(std::string name, SoPath*& p, SoNode* r = NULL);
72 bool getTranslation(SbVec3f& translation, SoPath* p);
73 bool setJointAngle(SoPath* p, float angle);
74
75 // meins
76 SbViewportRegion* m_pViewportRegion;
77 SoPerspectiveCamera* m_pCamera;
78 SoDirectionalLight* m_pLight;
79 SoSeparator* m_pDavidsRoot;
80 SoOffscreenRenderer* m_pOffscreenRenderer;
82
83
84 protected:
85 virtual bool buildScenery();
87 SoSeparator* root;
88
89#ifdef HAVE_COLLISION_DET
90 static SoIntersectionDetectionAction::Resp
91 OIFwdKinematicsInterface::intersectionCB(void* closure,
92 const SoIntersectingPrimitive* pr1,
93 const SoIntersectingPrimitive* pr2);
94#endif
95
96 private:
97 int argc;
98 char** args;
99 QApplication* iQApplication;
100 std::string sceneryFilename;
101
102 SO_WINDOW window;
103 SO_EXAMINER_VIEWER* viewer;
104
105#ifdef HAVE_COLLISION_DET
106 SoIntersectionDetectionAction* ida;
107#endif
108
109 bool iReady;
110 };
111} // namespace visionx
#define SO_EXAMINER_VIEWER
#define SO_WINDOW
virtual ~OIFwdKinematicsInterface()
The virtual destructor of the OIFwdKinematicsInterface class.
virtual bool buildScenery()
The virtual method OIFwdKinematicsInterface::buildScenery() is used to create a scenegraph.
OIFwdKinematicsInterface(std::string filename="")
The constructor of the OIFwdKinematicsInterface class.
SoSeparator * root
This is the root node of the scenegraph which gets rendered.
bool getTranslation(SbVec3f &translation, SoPath *p)
bool getPath(std::string name, SoPath *&p, SoNode *r=NULL)
bool readSceneryFromFile()
This method tries to read the scenegraph from the file OIFwdKinematicsInterface::sceneryFilename and ...
ArmarX headers.
double angle(const Point &a, const Point &b, const Point &c)
Definition point.hpp:109