1 #ifndef __cpExtensions__QT__RendererWidget__h__
2 #define __cpExtensions__QT__RendererWidget__h__
4 #include <cpExtensions/Config.h>
6 #ifdef cpExtensions_QT4
8 #include <cpExtensions/QT/ActorsWidgetInterface.h>
9 #include <vtkSmartPointer.h>
14 // -------------------------------------------------------------------------
16 class vtkInteractorStyle;
17 class vtkOrientationMarkerWidget;
19 class vtkPropCollection;
21 // -------------------------------------------------------------------------
22 namespace cpExtensions
24 namespace Visualization
27 class WindowLevelImageActor;
34 class cpExtensions_EXPORT RendererWidget
35 : public cpExtensions_QVTKWidget,
36 public ActorsWidgetInterface
41 typedef RendererWidget Self;
42 typedef cpExtensions_QVTKWidget Superclass;
43 typedef ActorsWidgetInterface Superclass2;
45 typedef std::set< vtkSmartPointer< vtkProp > > TProps;
46 typedef std::map< std::string, TProps > TPropCollection;
48 typedef cpExtensions::Visualization::LUTImageActor TLUTActor;
49 typedef cpExtensions::Visualization::WindowLevelImageActor TWLActor;
52 explicit RendererWidget(
53 QWidget* parent = NULL, Qt::WindowFlags f = 0
55 virtual ~RendererWidget( );
57 int GetQuadrant( ) const;
58 void SetQuadrant( int q );
60 vtkRenderer* GetRenderer( );
61 const vtkRenderer* GetRenderer( ) const;
63 vtkInteractorStyle* GetStyle( );
64 const vtkInteractorStyle* GetStyle( ) const;
65 void SetStyle( vtkInteractorStyle* style );
67 vtkCamera* GetActiveCamera( );
68 const vtkCamera* GetActiveCamera( ) const;
70 void AddViewProp( vtkProp* prop, const std::string& name = "" );
72 vtkPropCollection* props, const std::string& name = ""
74 void AddAuxViewProp( vtkProp* prop, const std::string& name = "" );
76 vtkPropCollection* props, const std::string& name = ""
79 TProps& GetViewProps( const std::string& name );
80 const TProps& GetViewProps( const std::string& name ) const;
81 TProps& GetAuxViewProps( const std::string& name );
82 const TProps& GetAuxViewProps( const std::string& name ) const;
84 void RemoveViewProps( const std::string& name );
85 void RemoveViewProps( );
87 virtual void HideViewProps( const std::string& name );
88 virtual void ShowViewProps( const std::string& name );
90 virtual void ResetCamera( );
91 virtual void Render( );
93 virtual std::set< std::string > GetActorsNames( ) const cpExtensions_OVERRIDE;
94 virtual bool IsWindowLevelImageActor( const std::string& name ) const cpExtensions_OVERRIDE;
95 virtual bool IsLUTImageActor( const std::string& name ) const cpExtensions_OVERRIDE;
96 virtual bool Is3DActor( const std::string& name ) const cpExtensions_OVERRIDE;
98 virtual void GetScalarRange( const std::string& name, double r[ 2 ] ) const cpExtensions_OVERRIDE;
99 virtual void GetWindowLevel( const std::string& name, double wl[ 2 ] ) const cpExtensions_OVERRIDE;
100 virtual double GetWindow( const std::string& name ) const cpExtensions_OVERRIDE;
101 virtual double GetLevel( const std::string& name ) const cpExtensions_OVERRIDE;
102 virtual char GetImageInterpolation( const std::string& name ) const cpExtensions_OVERRIDE;
104 virtual void GetColor( const std::string& name, double& r, double& g, double& b ) const cpExtensions_OVERRIDE;
105 virtual double GetOpacity( const std::string& name ) const cpExtensions_OVERRIDE;
106 virtual double GetPointSize( const std::string& name ) const cpExtensions_OVERRIDE;
107 virtual double GetLineWidth( const std::string& name ) const cpExtensions_OVERRIDE;
108 virtual int GetRepresentation( const std::string& name ) const cpExtensions_OVERRIDE;
110 virtual void SetScalarRange( const std::string& name, double r[ 2 ] ) cpExtensions_OVERRIDE;
111 virtual void SetScalarRange( const std::string& name, double min, double max ) cpExtensions_OVERRIDE;
112 virtual void SetWindowLevel( const std::string& name, double wl[ 2 ] ) cpExtensions_OVERRIDE;
113 virtual void SetWindowLevel( const std::string& name, double w, double l ) cpExtensions_OVERRIDE;
114 virtual void SetWindow( const std::string& name, double w ) cpExtensions_OVERRIDE;
115 virtual void SetLevel( const std::string& name, double l ) cpExtensions_OVERRIDE;
116 virtual void SetImageInterpolation( const std::string& name, char i ) cpExtensions_OVERRIDE;
118 virtual void SetColor( const std::string& name, double r, double g, double b ) cpExtensions_OVERRIDE;
119 virtual void SetOpacity( const std::string& name, double o ) cpExtensions_OVERRIDE;
120 virtual void SetPointSize( const std::string& name, double s ) cpExtensions_OVERRIDE;
121 virtual void SetLineWidth( const std::string& name, double w ) cpExtensions_OVERRIDE;
122 virtual void SetRepresentationToPoints( const std::string& name ) cpExtensions_OVERRIDE;
123 virtual void SetRepresentationToSurface( const std::string& name ) cpExtensions_OVERRIDE;
124 virtual void SetRepresentationToWireframe( const std::string& name ) cpExtensions_OVERRIDE;
127 vtkSmartPointer< vtkRenderer > m_Renderer;
128 vtkSmartPointer< vtkOrientationMarkerWidget > m_Marker;
131 TPropCollection m_ViewProps;
132 TPropCollection m_AuxViewProps;
139 #endif // cpExtensions_QT4
141 #endif // __cpExtensions__QT__RendererWidget__h__