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 <Inventor/SbLinear.h>
39 #include <Inventor/nodes/SoSeparator.h>
40 #include <qapplication.h>
41 #include <string>
42 
43 #ifdef HAVE_COLLISION_DET
44 #include <Inventor/SoInteraction.h>
45 #include <Inventor/collision/SoIntersectionDetectionAction.h>
46 #endif
47 
48 // meins
49 #include <Inventor/nodes/SoPerspectiveCamera.h>
50 #include <Inventor/nodes/SoDirectionalLight.h>
51 #include <Inventor/SoOffscreenRenderer.h>
52 //#include <Inventor/SoPerspectiveCamera.h>
53 
54 
55 
56 
57 namespace visionx
58 {
60  {
61  public:
62  OIFwdKinematicsInterface(std::string filename = "");
63  virtual ~OIFwdKinematicsInterface();
64  void expandFileNodes();
65  void update();
66  void run();
67  void initviewer();
68  bool isInitialized();
69 
70  bool getPath(std::string name, SoPath*& p, SoNode* r = NULL);
71  bool getTranslation(SbVec3f& translation, SoPath* p);
72  bool setJointAngle(SoPath* p, float angle);
73 
74  // meins
75  SbViewportRegion* m_pViewportRegion;
76  SoPerspectiveCamera* m_pCamera;
77  SoDirectionalLight* m_pLight;
78  SoSeparator* m_pDavidsRoot;
79  SoOffscreenRenderer* m_pOffscreenRenderer;
81 
82 
83 
84  protected:
85  virtual bool buildScenery();
86  bool readSceneryFromFile();
87  SoSeparator* root;
88 
89 #ifdef HAVE_COLLISION_DET
90  static SoIntersectionDetectionAction::Resp OIFwdKinematicsInterface::intersectionCB(void* closure,
91  const SoIntersectingPrimitive* pr1,
92  const SoIntersectingPrimitive* pr2);
93 #endif
94 
95  private:
96 
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 }
visionx::OIFwdKinematicsInterface::m_pCamera
SoPerspectiveCamera * m_pCamera
Definition: OIFwdKinematicsInterface.h:76
visionx::OIFwdKinematicsInterface::m_fFocalLengthY
float m_fFocalLengthY
Definition: OIFwdKinematicsInterface.h:80
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:140
visionx::OIFwdKinematicsInterface::getPath
bool getPath(std::string name, SoPath *&p, SoNode *r=NULL)
Definition: OIFwdKinematicsInterface.cpp:292
visionx::OIFwdKinematicsInterface::getTranslation
bool getTranslation(SbVec3f &translation, SoPath *p)
Definition: OIFwdKinematicsInterface.cpp:319
visionx::OIFwdKinematicsInterface::run
void run()
visionx::OIFwdKinematicsInterface::m_pDavidsRoot
SoSeparator * m_pDavidsRoot
Definition: OIFwdKinematicsInterface.h:78
visionx::OIFwdKinematicsInterface::m_pOffscreenRenderer
SoOffscreenRenderer * m_pOffscreenRenderer
Definition: OIFwdKinematicsInterface.h:79
visionx::OIFwdKinematicsInterface::update
void update()
Definition: OIFwdKinematicsInterface.cpp:165
visionx::OIFwdKinematicsInterface::expandFileNodes
void expandFileNodes()
Definition: OIFwdKinematicsInterface.cpp:441
visionx::OIFwdKinematicsInterface::readSceneryFromFile
bool readSceneryFromFile()
This method tries to read the scenegraph from the file OIFwdKinematicsInterface::sceneryFilename and ...
Definition: OIFwdKinematicsInterface.cpp:405
visionx::OIFwdKinematicsInterface::initviewer
void initviewer()
Definition: OIFwdKinematicsInterface.cpp:190
visionx::OIFwdKinematicsInterface::~OIFwdKinematicsInterface
virtual ~OIFwdKinematicsInterface()
The virtual destructor of the OIFwdKinematicsInterface class.
Definition: OIFwdKinematicsInterface.cpp:149
filename
std::string filename
Definition: VisualizationRobot.cpp:84
visionx::OIFwdKinematicsInterface::m_pLight
SoDirectionalLight * m_pLight
Definition: OIFwdKinematicsInterface.h:77
visionx::OIFwdKinematicsInterface::buildScenery
virtual bool buildScenery()
The virtual method OIFwdKinematicsInterface::buildScenery() is used to create a scenegraph.
Definition: OIFwdKinematicsInterface.cpp:393
SO_WINDOW
#define SO_WINDOW
Definition: OIFwdKinematicsInterface.h:33
angle
double angle(const Point &a, const Point &b, const Point &c)
Definition: point.hpp:100
visionx::OIFwdKinematicsInterface
Definition: OIFwdKinematicsInterface.h:59
visionx::OIFwdKinematicsInterface::isInitialized
bool isInitialized()
Definition: OIFwdKinematicsInterface.cpp:525
visionx::OIFwdKinematicsInterface::setJointAngle
bool setJointAngle(SoPath *p, float angle)
Definition: OIFwdKinematicsInterface.cpp:349
visionx::OIFwdKinematicsInterface::m_pViewportRegion
SbViewportRegion * m_pViewportRegion
Definition: OIFwdKinematicsInterface.h:75
SO_EXAMINER_VIEWER
#define SO_EXAMINER_VIEWER
Definition: OIFwdKinematicsInterface.h:35