]> 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 c8718a31b231cb3f9505fb55f099ec504bdf7d3f..f9fb2132613a1f6214d9bb114305da103758babc 100644 (file)
@@ -1,18 +1,24 @@
 #ifndef __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__
 #define __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__
 
+#include <vector>
+
 #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;
-class vtkWindowLevelLookupTable;
+*/
 
 // -------------------------------------------------------------------------
 namespace cpExtensions
@@ -30,21 +36,26 @@ namespace cpExtensions
     public:
       vtkTypeMacro( MPRActors, vtkPropCollection );
 
-      cpPlugins_ImageSliceActors( ImageOutline, vtkImageActor );
-
     public:
       // Creation
       static MPRActors* New( );
 
       ImageSliceActors* GetSliceActors( const int& i ) const;
-      void SetInputConnection( vtkAlgorithmOutput* aout );
-      void SetInputData( vtkImageData* image );
 
-      void PushDataInto(
-        vtkRenderer* x,
-        vtkRenderer* y,
-        vtkRenderer* z,
-        vtkRenderer* w
+      int AddInputConnection(
+        vtkAlgorithmOutput* aout,
+        ImageSliceActors::LUTType lut = ImageSliceActors::LUTType_WindowLevel
+        );
+      int AddInputData(
+        vtkImageData* image,
+        ImageSliceActors::LUTType lut = ImageSliceActors::LUTType_WindowLevel
+        );
+
+      void PushActorsInto(
+        vtkRenderWindow* x,
+        vtkRenderWindow* y,
+        vtkRenderWindow* z,
+        vtkRenderWindow* w
         );
       void PopDataFrom(
         vtkRenderer* x,
@@ -54,22 +65,29 @@ namespace cpExtensions
         );
 
       // Lookup table methods
-      vtkScalarsToColors* GetLookupTable( ) const;
-      void SetLookupTable( vtkScalarsToColors* lut );
+      void SetLookupTable( unsigned int i, vtkScalarsToColors* lut );
+      vtkScalarsToColors* GetLookupTable( unsigned int i ) const;
 
       // Grayscale window/level lookup
-      vtkWindowLevelLookupTable* GetLookupTableAsWindowLevel( ) const;
-      void SetLookupTableToWindowLevel( );
-      double GetMinWindow( ) const;
-      double GetMaxWindow( ) const;
-      double GetMinLevel( ) const;
-      double GetMaxLevel( ) const;
-      double GetWindow( ) const;
-      double GetLevel( ) const;
-      void SetWindow( const double& w );
-      void SetLevel( const double& l );
-      void SetWindowLevel( const double& w, const double& l );
-      void ResetWindowLevel( );
+      void SetLookupTableToWindowLevel( unsigned int i );
+      double GetMinWindow( unsigned int i ) const;
+      double GetMaxWindow( unsigned int i ) const;
+      double GetMinLevel( unsigned int i ) const;
+      double GetMaxLevel( unsigned int i ) const;
+      double GetWindow( unsigned int i ) const;
+      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;
@@ -79,15 +97,14 @@ namespace cpExtensions
       void SetSlice( const int& axis, const double& slice );
       void ResetSlices( );
 
-      // General accessors
-      void GetImageBounds( double bounds[ 6 ] ) const;
-
     protected:
       MPRActors( );
       virtual ~MPRActors( );
 
-      vtkImageData* _InputImage( ) const;
-      void _UpdateSlices( );
+      vtkImageData* _Image( unsigned int i ) const;
+      void _Update( unsigned int i );
+
+      static void _SetSlices( double* pos, int axis, void* data );
 
     private:
       // Purposely not implemented
@@ -95,15 +112,9 @@ namespace cpExtensions
       Self& operator=( const Self& );
 
     protected:
-      vtkSmartPointer< vtkImageMapToColors > ImageMapToColors;
-      vtkSmartPointer< vtkActor >            ImageOutlineActor;
-
-      typedef
-        cpExtensions::Visualization::ImageSliceActors
-        _TSlice;
-      vtkSmartPointer< _TSlice > Slices[ 2 ][ 3 ];
-
-      unsigned int ImageOutlineActorIndex;
+      // TODO: std::vector< vtkSmartPointer< vtkImageMapToColors > > ImageMaps;
+      vtkSmartPointer< vtkActor >         ImageOutlineActor;
+      vtkSmartPointer< ImageSliceActors > Slices[ 2 ][ 3 ];
     };
 
   } // ecapseman