]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/MPRObjects.h
Some bugs...
[cpPlugins.git] / lib / cpExtensions / Visualization / MPRObjects.h
index c21fca66f55e2fc36614e1442e502ad0c6af86a7..c800fc1ce626b11602c066f54a10b7ed363341f3 100644 (file)
@@ -8,6 +8,13 @@
 #include <vtkRenderer.h>
 #include <vtkRenderWindow.h>
 
+// -------------------------------------------------------------------------
+#define cpExtensions_MPRObjects_Renderer( DIR )                         \
+  inline vtkRenderer* Get##DIR##Renderer( )                             \
+  { return( this->m_Renderers[ Self::MPRDirections_##DIR ] ); }         \
+  inline const vtkRenderer* Get##DIR##Renderer( ) const                 \
+  { return( this->m_Renderers[ Self::MPRDirections_##DIR ] ); }
+
 namespace cpExtensions
 {
   namespace Visualization
@@ -33,39 +40,75 @@ namespace cpExtensions
       typedef MPRActors::TEnterCommand            TEnterCommand;
       typedef MPRActors::TLeaveCommand            TLeaveCommand;
 
+      enum MPRDirections
+      {
+        MPRDirections_X = 0,
+        MPRDirections_Y = 1,
+        MPRDirections_Z = 2,
+        MPRDirections_W = 3
+      };
+
     public:
       vtkTypeMacro( MPRObjects, vtkObject );
 
+      cpExtensions_MPRObjects_Renderer( X );
+      cpExtensions_MPRObjects_Renderer( Y );
+      cpExtensions_MPRObjects_Renderer( Z );
+      cpExtensions_MPRObjects_Renderer( W );
+
     public:
       // Creation
       static MPRObjects* New( );
 
+      // Association
       void SetRenderWindows(
-        vtkRenderWindow* wx, vtkRenderWindow* wy,
-        vtkRenderWindow* wz, vtkRenderWindow* w3D
+        vtkRenderWindow* x, vtkRenderWindow* y,
+        vtkRenderWindow* z, vtkRenderWindow* w
+        );
+
+      void SetInputConnection( vtkAlgorithmOutput* aout );
+      void SetInputImage( vtkImageData* data );
+      int AddBinaryConnection(
+        vtkAlgorithmOutput* aout,
+        const double& r, const double& g, const double& b
         );
-      void AddImage( vtkImageData* image );
+      int AddBinaryImage(
+        vtkImageData* data,
+        const double& r, const double& g, const double& b
+        );
+      void Show( );
+      void Hide( );
+      void Clear( );
+
+      vtkImageData* GetInputImage( );
+      const vtkImageData* GetInputImage( ) const;
       unsigned int GetNumberOfImages( ) const;
-      void ClearAll( );
 
-      void ResetCamera( const int& id );
-      void ResetCameras( );
-      void Render( const int& id, const double& t );
-      void RenderAll( const double& t );
-      vtkRenderer* GetXRenderer( );
-      vtkRenderer* GetYRenderer( );
-      vtkRenderer* GetZRenderer( );
-      vtkRenderer* Get3DRenderer( );
-      const vtkRenderer* GetXRenderer( ) const;
-      const vtkRenderer* GetYRenderer( ) const;
-      const vtkRenderer* GetZRenderer( ) const;
-      const vtkRenderer* Get3DRenderer( ) const;
-
-      MPRActors* GetMPRActors( );
-      const MPRActors* GetMPRActors( ) const;
+      void SetInterpolate( bool v );
+      void InterpolateOn( );
+      void InterpolateOff( );
 
+      double GetMinWindow( ) const;
+      double GetMaxWindow( ) const;
+      double GetMinLevel( ) const;
+      double GetMaxLevel( ) const;
       double GetWindow( ) const;
       double GetLevel( ) const;
+      void SetWindow( double w );
+      void SetLevel( double l );
+      void SetWindowLevel( double w, double l );
+      void ResetWindowLevel( );
+
+      int GetSliceNumber( const int& axis ) const;
+      int GetSliceNumberMinValue( const int& axis ) const;
+      int GetSliceNumberMaxValue( const int& axis ) const;
+      void SetSliceNumber( const int& axis, const int& slice );
+      void SetSlice( const int& axis, double* pos );
+
+      void Render( const double& t );
+      void Render( const int& axis, const double& t );
+      void ResetCamera( const int& axis );
+      void ResetCameras( );
 
     protected:
       MPRObjects( );