]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/MPRObjects.h
merge async example
[cpPlugins.git] / lib / cpExtensions / Visualization / MPRObjects.h
index 1a8135012044c928cd02d9af8171e60a879597b1..1920bb71a952352efee6717cc3782e5e1e051aee 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <cpExtensions/cpExtensions_Export.h>
 #include <cpExtensions/Visualization/MPRActors.h>
-#include <cpExtensions/Visualization/ImageInteractorStyle.h>
 
 #include <vtkObject.h>
 #include <vtkRenderer.h>
@@ -20,8 +19,12 @@ namespace cpExtensions
     {
     public:
       typedef MPRObjects Self;
-      typedef cpExtensions::Visualization::MPRActors            TMPRActors;
-      typedef cpExtensions::Visualization::ImageInteractorStyle TStyle;
+      typedef cpExtensions::Visualization::MPRActors TMPRActors;
+
+      typedef TMPRActors::TCursorCommand     TCursorCommand;
+      typedef TMPRActors::TMouseCommand      TMouseCommand;
+      typedef TMPRActors::TMouseWheelCommand TMouseWheelCommand;
+      typedef TMPRActors::TKeyCommand        TKeyCommand;
 
     public:
       vtkTypeMacro( MPRObjects, vtkObject );
@@ -30,13 +33,17 @@ namespace cpExtensions
       // Creation
       static MPRObjects* New( );
 
+      void AddCursorCommand( TCursorCommand command, void* data )
+      {
+        this->m_MPRActors->AddCursorCommand( command, data );
+      }
+
       void SetRenderWindows(
         vtkRenderWindow* wx, vtkRenderWindow* wy,
         vtkRenderWindow* wz, vtkRenderWindow* w3D
         );
-      void SetImage( vtkImageData* image );
-      void AddAuxiliaryImage( vtkImageData* image );
-      void ActivateInteractors( );
+      void AddImage( vtkImageData* image );
+      void ClearAll( );
 
       void ResetCamera( const int& id );
       void ResetCameras( );
@@ -51,6 +58,18 @@ namespace cpExtensions
       const vtkRenderer* GetZRenderer( ) const;
       const vtkRenderer* Get3DRenderer( ) const;
 
+      TMPRActors* GetMPRActors( );
+      const TMPRActors* GetMPRActors( ) const;
+
+      double GetWindow( ) const
+      {
+        return( this->m_MPRActors->GetWindow( ) );
+      }
+      double GetLevel( ) const
+      {
+        return( this->m_MPRActors->GetLevel( ) );
+      }
+
     protected:
       MPRObjects( );
       virtual ~MPRObjects( );
@@ -67,7 +86,13 @@ namespace cpExtensions
       // Internal pipelines
       vtkSmartPointer< TMPRActors >  m_MPRActors;
       vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
-      vtkSmartPointer< TStyle >      m_Styles[ 3 ];
+
+      std::vector< TCursorCommand >     CursorCommands;
+      std::vector< TMouseCommand >      MouseCommands;
+      std::vector< TMouseCommand >      MouseClickCommands;
+      std::vector< TMouseCommand >      MouseDoubleClickCommands;
+      std::vector< TMouseWheelCommand > MouseWheelCommands;
+      std::vector< TKeyCommand >        KeyCommands;
     };
 
   } // ecapseman