]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/VTK/Image3DObserver.h
...
[FrontAlgorithms.git] / lib / fpa / VTK / Image3DObserver.h
index 344ede4bf0d599058456f2ffae4bd97a5cfacdfe..6b6af4324c397aab87c5a8facb01c1c876f2fbe0 100644 (file)
@@ -4,9 +4,9 @@
 #include <map>
 
 #include <itkCommand.h>
-#include <itkImage.h>
 
 #include <vtkActor.h>
+#include <vtkImageData.h>
 #include <vtkPolyData.h>
 #include <vtkPolyDataMapper.h>
 #include <vtkSmartPointer.h>
@@ -27,11 +27,70 @@ namespace fpa
       typedef itk::SmartPointer< Self >       Pointer;
       typedef itk::SmartPointer< const Self > ConstPointer;
 
+      typedef F                             TFilter;
+      typedef R                             TRenderWindow;
+      typedef typename TFilter::TInputImage TImage;
+      typedef typename TFilter::TVertex     TVertex;
+
+      typedef std::set< TVertex > TVertices;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( Image3DObserver, itkCommand );
+
+      itkGetConstMacro( RenderPercentage, double );
+      itkSetMacro( RenderPercentage, double );
+
+    public:
+      void SetRenderWindow( R* rw );
+      void SetPixel(
+        typename TImage::IndexType idx,
+        unsigned char red,
+        unsigned char green,
+        unsigned char blue,
+        unsigned char alpha
+        );
+      void Render( );
+      void Execute( itk::Object* c, const itk::EventObject& e )
+        { this->Execute( ( const itk::Object* )( c ), e ); }
+      void Execute( const itk::Object* c, const itk::EventObject& e );
+
+    protected:
+      Image3DObserver( );
+      virtual ~Image3DObserver( );
+
+    private:
+      Image3DObserver( const Self& ); // Not impl.
+      void operator=( const Self& );  // Not impl.
+
+    protected:
+      vtkSmartPointer< vtkImageData >      m_Stencil;
+      vtkSmartPointer< vtkPolyData >       m_PolyData;
+      vtkSmartPointer< vtkPolyDataMapper > m_PolyDataMapper;
+      vtkSmartPointer< vtkActor >          m_PolyDataActor;
+
+      R*            m_RenderWindow;
+      unsigned long m_Count;
+      unsigned long m_RenderCount;
+      double        m_RenderPercentage;
+    };
+
+    /**
+     */
+    /*
+    template< class F, class R >
+    class Image3DObserver
+      : public itk::Command
+    {
+    public:
+      typedef Image3DObserver                 Self;
+      typedef itk::Command                    Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
       typedef F TFilter;
       typedef R TRenderWindow;
 
-      typedef itk::Image< long, 3 > TMarks;
-
     public:
       itkNewMacro( Self );
       itkTypeMacro( Image3DObserver, itkCommand );
@@ -60,11 +119,11 @@ namespace fpa
       unsigned long m_RenderCount;
       double        m_RenderPercentage;
 
-      TMarks::Pointer                      m_Marks;
       vtkSmartPointer< vtkPolyData >       m_Data;
       vtkSmartPointer< vtkPolyDataMapper > m_Mapper;
       vtkSmartPointer< vtkActor >          m_Actor;
     };
+    */
 
   } // ecapseman