gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
SceneGraphBinder.h
Go to the documentation of this file.
1 #ifndef __SceneGraphBinder_h
2 #define __SceneGraphBinder_h
3 
4 #include <map>
5 #include <string>
6 
7 #ifndef __SceneGraphNode_h
9 #endif
10 
11 // For MATRIX4
12 #ifndef __Types_h
13 #include "gVirtualXRay/Types.h"
14 #endif
15 
16 
17 //******************************************************************************
18 // namespace
19 //******************************************************************************
20 namespace gVirtualXRay {
21 
22 
24 {
25 public:
27  SceneGraphBinder(const SceneGraphBinder& aSceneGraph);
28  SceneGraphBinder(const std::string& aFileName, RATIONAL_NUMBER aUnitOfLength);
29  SceneGraphBinder(const char* aFileName, RATIONAL_NUMBER aUnitOfLength);
30  virtual ~SceneGraphBinder();
31 
32  SceneGraphBinder& operator=(const SceneGraphBinder& aSceneGraph);
33 
34 
35  virtual void loadSceneGraph(const char* aFileName, RATIONAL_NUMBER aUnitOfLength);
36 
37 
38  virtual void loadSceneGraph(const std::string& aFileName, RATIONAL_NUMBER aUnitOfLength);
39 
40  void clear();
41 
42 
43  //const PolygonMesh& getPolygonMesh(const std::string& aLabel) const;
44  //const PolygonMesh& getPolygonMesh(const char* aLabel) const;
45 
46  //PolygonMesh& getPolygonMesh(const std::string& aLabel);
47  //PolygonMesh& getPolygonMesh(const char* aLabel);
48 
49 
50 
51  void display(GLint aShaderID);
52 
53  void scale(const std::string& aNodeLabel,
54  const VEC3& aScalingFactorSet);
55 
56  virtual void scale(const char* aNodeLabel,
57  const VEC3& aScalingFactorSet);
58 
59  void rotate(const std::string& aNodeLabel,
60  float aRotationAngleInDegrees,
61  const VEC3& aRotationAxis);
62 
63 
64  virtual void rotate(const char* aNodeLabel,
65  float aRotationAngleInDegrees,
66  const VEC3& aRotationAxis);
67 
68 
69 
70  void translate(const std::string& aNodeLabel,
71  const VEC3& aTranslationVector);
72 
73  virtual void translate(const char* aNodeLabel,
74  const VEC3& aTranslationVector);
75 
76 
77  MATRIX4 getLocalTransformationMatrix(const std::string& aNodeLabel) const;
78  MATRIX4 getLocalTransformationMatrix(const char* aNodeLabel) const;
79  MATRIX4 getWorldTransformationMatrix(const std::string& aNodeLabel) const;
80  MATRIX4 getWorldTransformationMatrix(const char* aNodeLabel) const;
81 
82  void moveToCentre(const std::string& aNodeLabel);
83  void moveToCentre(const char* aNodeLabel);
84  void moveToCenter(const std::string& aNodeLabel);
85  void moveToCenter(const char* aNodeLabel);
86 
87  void moveToCentre();
88  void moveToCenter();
89 
91  virtual MATRIX4 getNodeLocalTransformationMatrix(const char* aNodeLabel) const;
92  virtual MATRIX4 getNodeWorldTransformationMatrix(const char* aNodeLabel) const;
93 
94  virtual void setRootNodeTransformationMatrix(const MATRIX4& aTransformationMatrix);
95  virtual void setNodeLocalTransformationMatrix(const char* aNodeLabel, const MATRIX4& aTransformationMatrix);
96 
97  std::pair<VEC3, VEC3> getBoundingBox();
98 
99 
100  void addPolygonMesh(const std::string& aLabel, const PolygonMesh& aPolygonMesh, const VEC3& aPosition, const std::string& aParent = "root");
101 
102 
103  SceneGraphNode* getNode(const std::string& aLabel);
104  const SceneGraphNode* getNode(const std::string& aLabel) const;
105 
106 protected:
109 };
110 
111 
112 } // namespace gVirtualXRay
113 
114 
115 #endif // __SceneGraphBinder_h
void addPolygonMesh(const std::string &aLabel, const PolygonMesh &aPolygonMesh, const VEC3 &aPosition, const std::string &aParent="root")
virtual void setRootNodeTransformationMatrix(const MATRIX4 &aTransformationMatrix)
virtual void loadSceneGraph(const char *aFileName, RATIONAL_NUMBER aUnitOfLength)
Type declarations.
std::pair< VEC3, VEC3 > getBoundingBox()
MATRIX4 getWorldTransformationMatrix(const std::string &aNodeLabel) const
void display(GLint aShaderID)
void translate(const std::string &aNodeLabel, const VEC3 &aTranslationVector)
virtual MATRIX4 getNodeLocalTransformationMatrix(const char *aNodeLabel) const
SceneGraphNode * getNode(const std::string &aLabel)
PolygonMesh is a class to handle polygon (triangles) meshes.
Definition: PolygonMesh.h:114
float RATIONAL_NUMBER
Type of data used to store real numbers.
Definition: Types.h:107
virtual void setNodeLocalTransformationMatrix(const char *aNodeLabel, const MATRIX4 &aTransformationMatrix)
virtual MATRIX4 getNodeWorldTransformationMatrix(const char *aNodeLabel) const
void scale(const std::string &aNodeLabel, const VEC3 &aScalingFactorSet)
MATRIX4 getLocalTransformationMatrix(const std::string &aNodeLabel) const
void rotate(const std::string &aNodeLabel, float aRotationAngleInDegrees, const VEC3 &aRotationAxis)
virtual MATRIX4 getRootNodeTransformationMatrix() const
SceneGraphBinder & operator=(const SceneGraphBinder &aSceneGraph)