]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/VTK/Image3DObserver.h
More tests
[FrontAlgorithms.git] / lib / fpa / VTK / Image3DObserver.h
1 #ifndef __FPA__VTK__IMAGE3DOBSERVER__H__
2 #define __FPA__VTK__IMAGE3DOBSERVER__H__
3
4 #include <map>
5
6 #include <itkCommand.h>
7 #include <itkImage.h>
8
9 #include <vtkActor.h>
10 #include <vtkPolyData.h>
11 #include <vtkPolyDataMapper.h>
12 #include <vtkSmartPointer.h>
13
14 namespace fpa
15 {
16   namespace VTK
17   {
18     /**
19      */
20     template< class F, class R >
21     class Image3DObserver
22       : public itk::Command
23     {
24     public:
25       typedef Image3DObserver                 Self;
26       typedef itk::Command                    Superclass;
27       typedef itk::SmartPointer< Self >       Pointer;
28       typedef itk::SmartPointer< const Self > ConstPointer;
29
30       typedef F TFilter;
31       typedef R TRenderWindow;
32
33       typedef itk::Image< long, 3 > TMarks;
34
35     public:
36       itkNewMacro( Self );
37       itkTypeMacro( Image3DObserver, itkCommand );
38
39       itkGetConstMacro( RenderPercentage, double );
40       itkSetMacro( RenderPercentage, double );
41
42     public:
43       void SetRenderWindow( R* rw );
44       void Execute( itk::Object* c, const itk::EventObject& e )
45         { this->Execute( ( const itk::Object* )( c ), e ); }
46       void Execute( const itk::Object* c, const itk::EventObject& e );
47
48     protected:
49       Image3DObserver( );
50       virtual ~Image3DObserver( )
51         { }
52
53     private:
54       Image3DObserver( const Self& ); // Not impl.
55       void operator=( const Self& );  // Not impl.
56
57     protected:
58       R*            m_RenderWindow;
59       unsigned long m_Count;
60       unsigned long m_RenderCount;
61       double        m_RenderPercentage;
62
63       TMarks::Pointer                      m_Marks;
64       vtkSmartPointer< vtkPolyData >       m_Data;
65       vtkSmartPointer< vtkPolyDataMapper > m_Mapper;
66       vtkSmartPointer< vtkActor >          m_Actor;
67     };
68
69   } // ecapseman
70
71 } // ecapseman
72
73 #include <fpa/VTK/Image3DObserver.hxx>
74
75 #endif // __FPA__VTK__IMAGE3DOBSERVER__H__
76
77 // eof - $RCSfile$