]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/QT/RendererWidget.h
Start contour tracer widget debugging: change interactor style.
[cpPlugins.git] / lib / cpExtensions / QT / RendererWidget.h
index b43a3bc7aafe438a93ff87a4d300d23b1edbec7b..c90803b26b30aaa1f57c773c43085c6ae66fa9de 100644 (file)
@@ -8,6 +8,7 @@
 #include <vtkSmartPointer.h>
 #include <map>
 #include <set>
+#include <string>
 
 // -------------------------------------------------------------------------
 class vtkCamera;
@@ -15,7 +16,6 @@ class vtkInteractorStyle;
 class vtkOrientationMarkerWidget;
 class vtkProp;
 class vtkPropCollection;
-class vtkRenderer;
 
 // -------------------------------------------------------------------------
 namespace cpExtensions
@@ -33,12 +33,13 @@ namespace cpExtensions
       typedef RendererWidget          Self;
       typedef cpExtensions_QVTKWidget Superclass;
 
-      typedef
-        std::map< std::string, vtkSmartPointer< vtkPropCollection > >
-        TProps;
+      typedef std::set< vtkSmartPointer< vtkProp > > TProps;
+      typedef std::map< std::string, TProps >        TPropCollection;
 
     public:
-      explicit RendererWidget( QWidget* parent = NULL, Qt::WindowFlags f = 0 );
+      explicit RendererWidget(
+        QWidget* parent = NULL, Qt::WindowFlags f = 0
+        );
       virtual ~RendererWidget( );
 
       int GetQuadrant( ) const;
@@ -54,15 +55,19 @@ namespace cpExtensions
       vtkCamera* GetActiveCamera( );
       const vtkCamera* GetActiveCamera( ) const;
 
-      void AddViewProp( vtkProp* prop, const std::string& name );
-      void AddViewProps( vtkPropCollection* props, const std::string& name );
-      void AddAuxViewProp( vtkProp* prop, const std::string& name );
-      void AddAuxViewProps( vtkPropCollection* props, const std::string& name );
+      void AddViewProp( vtkProp* prop, const std::string& name = "" );
+      void AddViewProps(
+        vtkPropCollection* props, const std::string& name = ""
+        );
+      void AddAuxViewProp( vtkProp* prop, const std::string& name = "" );
+      void AddAuxViewProps(
+        vtkPropCollection* props, const std::string& name = ""
+        );
 
-      vtkPropCollection* GetViewProps( const std::string& name );
-      const vtkPropCollection* GetViewProps( const std::string& name ) const;
-      vtkPropCollection* GetAuxViewProps( const std::string& name );
-      const vtkPropCollection* GetAuxViewProps( const std::string& name ) const;
+      TProps& GetViewProps( const std::string& name );
+      const TProps& GetViewProps( const std::string& name ) const;
+      TProps& GetAuxViewProps( const std::string& name );
+      const TProps& GetAuxViewProps( const std::string& name ) const;
 
       void RemoveViewProps( const std::string& name );
       void RemoveViewProps( );
@@ -74,12 +79,12 @@ namespace cpExtensions
       virtual void Render( );
 
     protected:
-      vtkSmartPointer< vtkRenderer > m_Renderer;
+      vtkSmartPointer< vtkRenderer >                m_Renderer;
       vtkSmartPointer< vtkOrientationMarkerWidget > m_Marker;
       int m_Quadrant;
 
-      TProps m_ViewProps;
-      TProps m_AuxViewProps;
+      TPropCollection m_ViewProps;
+      TPropCollection m_AuxViewProps;
     };
 
   } // ecapseman