DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IVViewer.h
1 
17 #pragma once
18 
31 #if defined(IVViewer_RECURSES)
32 #error Recursive header files inclusion detected in IVViewer.h
33 #else // defined(IVViewer_RECURSES)
34 
35 #define IVViewer_RECURSES
36 
37 #if !defined IVViewer_h
38 
39 #define IVViewer_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <string>
45 #ifdef SGI_INVENTOR
46 #include <Inventor/Xt/SoXt.h>
47 #include <Inventor/Xt/viewers/SoXtExaminerViewer.h>
48 #else
49 #include <Inventor/Qt/SoQt.h>
50 #include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
51 #endif
52 #include <Inventor/nodes/SoSeparator.h>
53 #include <Inventor/nodes/SoGroup.h>
54 #include <Inventor/nodes/SoCamera.h>
55 #include <Inventor/nodes/SoTransform.h>
56 #include <Inventor/SbRotation.h>
57 #include <Inventor/fields/SoSFRotation.h>
58 
60 
61 namespace DGtal
62 {
63 
65 // class IVViewer
74 class IVViewer
75 {
76  // ----------------------- Standard services ------------------------------
77 public:
78 
82  ~IVViewer();
83 
90  IVViewer( int argc = 0, char** argv = 0 );
91 
95  SoSeparator* root() const;
96 
100  void setTitle( const std::string & title );
101 
109  void setCamera( float latitude, float longitude );
110 
114  void show() const;
115 
116  // ----------------------- Interface --------------------------------------
117 public:
118 
123  void selfDisplay ( std::ostream & out ) const;
124 
129  bool isValid() const;
130 
131  // ------------------------- Protected Datas ------------------------------
132 private:
133  // ------------------------- Private Datas --------------------------------
134 private:
135 #ifdef SGI_INVENTOR
136 
139  Widget myWindow;
140 
144  SoXtExaminerViewer* myViewer;
145 #else
146 
149  QWidget* myWindow;
150 
154  SoQtExaminerViewer* myViewer;
155 #endif
156 
160  SoSeparator* myRoot;
161 
165  std::string myTitle;
166 
167  // ------------------------- Hidden services ------------------------------
168 protected:
169 
174  IVViewer();
175 
176 private:
177 
183  IVViewer ( const IVViewer & other );
184 
191  IVViewer & operator= ( const IVViewer & other );
192 
193  // ------------------------- Internals ------------------------------------
194 private:
195 
196 }; // end of class IVViewer
197 
198 
205 std::ostream&
206 operator<< ( std::ostream & out, const IVViewer & object );
207 
208 
209 } // namespace DGtal
210 
211 
213 // Includes inline functions.
214 #include "DGtal/io/viewers/IVViewer.ih"
215 
216 
217 // //
219 
220 #endif // !defined IVViewer_h
221 
222 #undef IVViewer_RECURSES
223 #endif // else defined(IVViewer_RECURSES)