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 
58 namespace visionx
59 {
61  {
62  public:
63  OIFwdKinematicsInterface(std::string filename = "");
64  virtual ~OIFwdKinematicsInterface();
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();
86  bool readSceneryFromFile();
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
visionx::OIFwdKinematicsInterface::m_pCamera
SoPerspectiveCamera * m_pCamera
Definition: OIFwdKinematicsInterface.h:77
visionx::OIFwdKinematicsInterface::m_fFocalLengthY
float m_fFocalLengthY
Definition: OIFwdKinematicsInterface.h:81
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::OIFwdKinematicsInterface::root
SoSeparator * root
Definition: OIFwdKinematicsInterface.h:87
visionx::OIFwdKinematicsInterface::OIFwdKinematicsInterface
OIFwdKinematicsInterface(std::string filename="")
The constructor of the OIFwdKinematicsInterface class.
Definition: OIFwdKinematicsInterface.cpp:138
visionx::OIFwdKinematicsInterface::getPath
bool getPath(std::string name, SoPath *&p, SoNode *r=NULL)
Definition: OIFwdKinematicsInterface.cpp:299
visionx::OIFwdKinematicsInterface::getTranslation
bool getTranslation(SbVec3f &translation, SoPath *p)
Definition: OIFwdKinematicsInterface.cpp:327
visionx::OIFwdKinematicsInterface::run
void run()
visionx::OIFwdKinematicsInterface::m_pDavidsRoot
SoSeparator * m_pDavidsRoot
Definition: OIFwdKinematicsInterface.h:79
visionx::OIFwdKinematicsInterface::m_pOffscreenRenderer
SoOffscreenRenderer * m_pOffscreenRenderer
Definition: OIFwdKinematicsInterface.h:80
visionx::OIFwdKinematicsInterface::update
void update()
Definition: OIFwdKinematicsInterface.cpp:170
visionx::OIFwdKinematicsInterface::expandFileNodes
void expandFileNodes()
Definition: OIFwdKinematicsInterface.cpp:455
visionx::OIFwdKinematicsInterface::readSceneryFromFile
bool readSceneryFromFile()
This method tries to read the scenegraph from the file OIFwdKinematicsInterface::sceneryFilename and ...
Definition: OIFwdKinematicsInterface.cpp:419
visionx::OIFwdKinematicsInterface::initviewer
void initviewer()
Definition: OIFwdKinematicsInterface.cpp:195
visionx::OIFwdKinematicsInterface::~OIFwdKinematicsInterface
virtual ~OIFwdKinematicsInterface()
The virtual destructor of the OIFwdKinematicsInterface class.
Definition: OIFwdKinematicsInterface.cpp:153
filename
std::string filename
Definition: VisualizationRobot.cpp:86
visionx::OIFwdKinematicsInterface::m_pLight
SoDirectionalLight * m_pLight
Definition: OIFwdKinematicsInterface.h:78
visionx::OIFwdKinematicsInterface::buildScenery
virtual bool buildScenery()
The virtual method OIFwdKinematicsInterface::buildScenery() is used to create a scenegraph.
Definition: OIFwdKinematicsInterface.cpp:406
SO_WINDOW
#define SO_WINDOW
Definition: OIFwdKinematicsInterface.h:33
angle
double angle(const Point &a, const Point &b, const Point &c)
Definition: point.hpp:109
visionx::OIFwdKinematicsInterface
Definition: OIFwdKinematicsInterface.h:60
visionx::OIFwdKinematicsInterface::isInitialized
bool isInitialized()
Definition: OIFwdKinematicsInterface.cpp:540
visionx::OIFwdKinematicsInterface::setJointAngle
bool setJointAngle(SoPath *p, float angle)
Definition: OIFwdKinematicsInterface.cpp:358
visionx::OIFwdKinematicsInterface::m_pViewportRegion
SbViewportRegion * m_pViewportRegion
Definition: OIFwdKinematicsInterface.h:76
SO_EXAMINER_VIEWER
#define SO_EXAMINER_VIEWER
Definition: OIFwdKinematicsInterface.h:35