]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/QT/RendererWidget.h
Start contour tracer widget debugging: change interactor style.
[cpPlugins.git] / lib / cpExtensions / QT / RendererWidget.h
1 #ifndef __cpExtensions__QT__RendererWidget__h__
2 #define __cpExtensions__QT__RendererWidget__h__
3
4 #include <cpExtensions/Config.h>
5
6 #ifdef cpExtensions_QT4
7
8 #include <vtkSmartPointer.h>
9 #include <map>
10 #include <set>
11 #include <string>
12
13 // -------------------------------------------------------------------------
14 class vtkCamera;
15 class vtkInteractorStyle;
16 class vtkOrientationMarkerWidget;
17 class vtkProp;
18 class vtkPropCollection;
19
20 // -------------------------------------------------------------------------
21 namespace cpExtensions
22 {
23   namespace QT
24   {
25     /**
26      */
27     class cpExtensions_EXPORT RendererWidget
28       : public cpExtensions_QVTKWidget
29     {
30       Q_OBJECT;
31
32     public:
33       typedef RendererWidget          Self;
34       typedef cpExtensions_QVTKWidget Superclass;
35
36       typedef std::set< vtkSmartPointer< vtkProp > > TProps;
37       typedef std::map< std::string, TProps >        TPropCollection;
38
39     public:
40       explicit RendererWidget(
41         QWidget* parent = NULL, Qt::WindowFlags f = 0
42         );
43       virtual ~RendererWidget( );
44
45       int GetQuadrant( ) const;
46       void SetQuadrant( int q );
47
48       vtkRenderer* GetRenderer( );
49       const vtkRenderer* GetRenderer( ) const;
50
51       vtkInteractorStyle* GetStyle( );
52       const vtkInteractorStyle* GetStyle( ) const;
53       void SetStyle( vtkInteractorStyle* style );
54
55       vtkCamera* GetActiveCamera( );
56       const vtkCamera* GetActiveCamera( ) const;
57
58       void AddViewProp( vtkProp* prop, const std::string& name = "" );
59       void AddViewProps(
60         vtkPropCollection* props, const std::string& name = ""
61         );
62       void AddAuxViewProp( vtkProp* prop, const std::string& name = "" );
63       void AddAuxViewProps(
64         vtkPropCollection* props, const std::string& name = ""
65         );
66
67       TProps& GetViewProps( const std::string& name );
68       const TProps& GetViewProps( const std::string& name ) const;
69       TProps& GetAuxViewProps( const std::string& name );
70       const TProps& GetAuxViewProps( const std::string& name ) const;
71
72       void RemoveViewProps( const std::string& name );
73       void RemoveViewProps( );
74
75       virtual void HideViewProps( const std::string& name );
76       virtual void ShowViewProps( const std::string& name );
77
78       virtual void ResetCamera( );
79       virtual void Render( );
80
81     protected:
82       vtkSmartPointer< vtkRenderer >                m_Renderer;
83       vtkSmartPointer< vtkOrientationMarkerWidget > m_Marker;
84       int m_Quadrant;
85
86       TPropCollection m_ViewProps;
87       TPropCollection m_AuxViewProps;
88     };
89
90   } // ecapseman
91
92 } // ecapseman
93
94 #endif // cpExtensions_QT4
95
96 #endif // __cpExtensions__QT__RendererWidget__h__
97
98 // eof - $RCSfile$