]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/QT/RendererWidget.h
Architecture updated.
[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
12 // -------------------------------------------------------------------------
13 class vtkCamera;
14 class vtkInteractorStyle;
15 class vtkOrientationMarkerWidget;
16 class vtkProp;
17 class vtkPropCollection;
18 class vtkRenderer;
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
37         std::map< std::string, vtkSmartPointer< vtkPropCollection > >
38         TProps;
39
40     public:
41       explicit RendererWidget( QWidget* parent = NULL, Qt::WindowFlags f = 0 );
42       virtual ~RendererWidget( );
43
44       int GetQuadrant( ) const;
45       void SetQuadrant( int q );
46
47       vtkRenderer* GetRenderer( );
48       const vtkRenderer* GetRenderer( ) const;
49
50       vtkInteractorStyle* GetStyle( );
51       const vtkInteractorStyle* GetStyle( ) const;
52       void SetStyle( vtkInteractorStyle* style );
53
54       vtkCamera* GetActiveCamera( );
55       const vtkCamera* GetActiveCamera( ) const;
56
57       void AddViewProp( vtkProp* prop, const std::string& name );
58       void AddViewProps( vtkPropCollection* props, const std::string& name );
59       void AddAuxViewProp( vtkProp* prop, const std::string& name );
60       void AddAuxViewProps( vtkPropCollection* props, const std::string& name );
61
62       vtkPropCollection* GetViewProps( const std::string& name );
63       const vtkPropCollection* GetViewProps( const std::string& name ) const;
64       vtkPropCollection* GetAuxViewProps( const std::string& name );
65       const vtkPropCollection* GetAuxViewProps( const std::string& name ) const;
66
67       void RemoveViewProps( const std::string& name );
68       void RemoveViewProps( );
69
70       virtual void HideViewProps( const std::string& name );
71       virtual void ShowViewProps( const std::string& name );
72
73       virtual void ResetCamera( );
74       virtual void Render( );
75
76     protected:
77       vtkSmartPointer< vtkRenderer > m_Renderer;
78       vtkSmartPointer< vtkOrientationMarkerWidget > m_Marker;
79       int m_Quadrant;
80
81       TProps m_ViewProps;
82       TProps m_AuxViewProps;
83     };
84
85   } // ecapseman
86
87 } // ecapseman
88
89 #endif // cpExtensions_QT4
90
91 #endif // __cpExtensions__QT__RendererWidget__h__
92
93 // eof - $RCSfile$