Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SceneThreeDOutWrapper.hh
1 #ifndef __SCENE_THREEDOUT_WRAPPER_HH__
2 #define __SCENE_THREEDOUT_WRAPPER_HH__
3 
4 #include <bias_config.h>
5 
6 #include <Utils/ThreeDOut.hh>
7 #include <GLviewer/Scenes/SceneBase.hh>
8 #include <Base/Math/Vector3.hh>
9 #include <GLviewer/TriangleMeshSplatRendering.hh>
10 
11 // These are the flags for the protected variable RenderFlags_
12 enum {
13  RENDER_CAMERA = 1<<0,
14  DRAW_ELLIPSOIDS = 1<<1,
15  DRAW_CAM_ELLIPSOIDS = 1<<2
16 };
17 
18 namespace BIAS {
19  /** \class SceneThreeDOutWrapper
20  \brief Wrapping ThreeDOut OpenGL-functionality.
21  \author bartczak
22  \ingroup g_glviewer
23  */
24  class BIASGLviewer_EXPORT SceneThreeDOutWrapper : public SceneBase
25  {
26  public:
28  if (ownerOfThreeDOut_)
29  if (threeDOutObject_!=NULL) delete threeDOutObject_;
30  threeDOutObject_ = NULL;
31  }
32 
33  SceneThreeDOutWrapper() { threeDOutObject_ = NULL;
34  RenderFlags_ = RENDER_CAMERA;
35  ownerOfThreeDOut_ = false;
36  cameraColor_.Set(0,0,0,0);
37  covarianceColor_.Set(0,0,0,0);}
38 
39 
40  void LinkWithThreeDOut(BIAS::ThreeDOut* threeDOutObject)
41  {
42  threeDOutObject_ = threeDOutObject;
43  triangleSplatting_.AddThreeDOut(threeDOutObject_);
44  }
45  /**
46  * Set the specified flag to true or false.
47  */
48  void SetFlag(unsigned long int Flag);
49  void UnsetFlag(unsigned long int Flag);
50  bool GetFlag(unsigned long int Flag);
51  virtual void GetBoundingBox(BIAS::Vector3<double> & min,
52  BIAS::Vector3<double> & max);
53  virtual BIAS::Vector3<double> GetBoundingBoxCenter();
54  inline bool HasObject() const {return(threeDOutObject_!=NULL);};
55  virtual void MoveScene(const double& delta = 1.0);
56  void SetThreeDOutObjectOwnership(bool o){ownerOfThreeDOut_=o;};
57  void SetCameraColor(BIAS::RGBAuc color){cameraColor_ = color;};
58  void SetCovarianceColor(BIAS::RGBAuc color){covarianceColor_ = color;};
59 
60  protected:
61  virtual void Draw();
62 
63  protected:
67  unsigned long int RenderFlags_;
69  };
70 }//end of namespace
71 
72 #endif
void SetCameraColor(BIAS::RGBAuc color)
Unified output of 3D entities via OpenGL or VRML.
Definition: ThreeDOut.hh:349
Scene for rendering multiple triangle meshes generated from depth maps.
void SetCovarianceColor(BIAS::RGBAuc color)
BIAS::TriangleMeshSplatRendering triangleSplatting_
Base class for all scenes.
Definition: SceneBase.hh:68
void LinkWithThreeDOut(BIAS::ThreeDOut *threeDOutObject)
Wrapping ThreeDOut OpenGL-functionality.