]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/MPRActors.h
Widget integration (step 5/6): Just one step leftgit shortlog !
[cpPlugins.git] / lib / cpExtensions / Visualization / MPRActors.h
index 0aafebef6f5ab227410ac9b594e32dfdda72edde..f9fb2132613a1f6214d9bb114305da103758babc 100644 (file)
@@ -6,15 +6,19 @@
 #include <cpExtensions/cpExtensions_Export.h>
 #include <cpExtensions/Visualization/ImageSliceActors.h>
 
+/*
 #include <vtkSmartPointer.h>
 #include <vtkActor.h>
 #include <vtkImageMapToColors.h>
+*/
 
 // -------------------------------------------------------------------------
+/*
 class vtkAlgorithmOutput;
 class vtkImageData;
 class vtkRenderer;
 class vtkScalarsToColors;
+*/
 
 // -------------------------------------------------------------------------
 namespace cpExtensions
@@ -38,19 +42,20 @@ namespace cpExtensions
 
       ImageSliceActors* GetSliceActors( const int& i ) const;
 
-      int AddInputConnection( vtkAlgorithmOutput* aout );
-      int AddInputData( vtkImageData* image );
-
-      /*
-        void SetInputConnection( vtkAlgorithmOutput* aout );
-        void SetInputData( vtkImageData* image );
-      */
+      int AddInputConnection(
+        vtkAlgorithmOutput* aout,
+        ImageSliceActors::LUTType lut = ImageSliceActors::LUTType_WindowLevel
+        );
+      int AddInputData(
+        vtkImageData* image,
+        ImageSliceActors::LUTType lut = ImageSliceActors::LUTType_WindowLevel
+        );
 
-      void PushDataInto(
-        vtkRenderer* x,
-        vtkRenderer* y,
-        vtkRenderer* z,
-        vtkRenderer* w
+      void PushActorsInto(
+        vtkRenderWindow* x,
+        vtkRenderWindow* y,
+        vtkRenderWindow* z,
+        vtkRenderWindow* w
         );
       void PopDataFrom(
         vtkRenderer* x,
@@ -58,12 +63,6 @@ namespace cpExtensions
         vtkRenderer* z,
         vtkRenderer* w
         );
-      void LinkInteractors( )
-        {
-          this->_Update( 0 );
-          this->_Update( 1 );
-          this->_Update( 2 );
-        }
 
       // Lookup table methods
       void SetLookupTable( unsigned int i, vtkScalarsToColors* lut );
@@ -79,8 +78,17 @@ namespace cpExtensions
       double GetLevel( unsigned int i ) const;
       void SetWindow( unsigned int i, const double& w );
       void SetLevel( unsigned int i, const double& l );
+      void SetWindowLevel( unsigned int i, const double& w, const double& l );
       void ResetWindowLevel( unsigned int i );
 
+      // Color lookup table
+      void SetLookupTableToColor(
+        unsigned int i,
+        const double& r = double( 1 ),
+        const double& g = double( 0 ),
+        const double& b = double( 0 )
+        );
+
       // Slice access
       int GetSliceNumberMinValue( const int& axis ) const;
       int GetSliceNumberMaxValue( const int& axis ) const;
@@ -96,13 +104,15 @@ namespace cpExtensions
       vtkImageData* _Image( unsigned int i ) const;
       void _Update( unsigned int i );
 
+      static void _SetSlices( double* pos, int axis, void* data );
+
     private:
       // Purposely not implemented
       MPRActors( const Self& );
       Self& operator=( const Self& );
 
     protected:
-      std::vector< vtkSmartPointer< vtkImageMapToColors > > ImageMaps;
+      // TODO: std::vector< vtkSmartPointer< vtkImageMapToColors > > ImageMaps;
       vtkSmartPointer< vtkActor >         ImageOutlineActor;
       vtkSmartPointer< ImageSliceActors > Slices[ 2 ][ 3 ];
     };