]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Interaction/ImageSlicePointPlacer.h
yet another refactoring
[cpPlugins.git] / lib / cpExtensions / Interaction / ImageSlicePointPlacer.h
1 #ifndef __cpExtensions__Interaction__ImageSlicePointPlacer__h__
2 #define __cpExtensions__Interaction__ImageSlicePointPlacer__h__
3
4 #include <cpExtensions/Config.h>
5 #include <vtkPointPlacer.h>
6
7 class vtkBoundedPlanePointPlacer;
8 class vtkImageSlice;
9 class vtkRenderer;
10
11 namespace cpExtensions
12 {
13   namespace Interaction
14   {
15     /**
16      */
17     class cpExtensions_EXPORT ImageSlicePointPlacer
18       : public vtkPointPlacer
19     {
20     public:
21       typedef ImageSlicePointPlacer Self;
22       vtkTypeMacro( ImageSlicePointPlacer, vtkPointPlacer );
23
24       vtkGetObjectMacro( ImageSlice, vtkImageSlice );
25       vtkSetVector6Macro( Bounds, double );
26       vtkGetVector6Macro( Bounds, double );
27
28     public:
29       static Self* New( );
30
31       int ComputeWorldPosition(
32         vtkRenderer* ren,
33         double displayPos[ 2 ],
34         double worldPos[ 3 ],
35         double worldOrient[ 9 ]
36         );
37       int ComputeWorldPosition(
38         vtkRenderer* ren,
39         double displayPos[ 2 ],
40         double refWorldPos[ 2 ],
41         double worldPos[ 3 ],
42         double worldOrient[ 9 ]
43         );
44       int ValidateWorldPosition( double worldPos[ 3 ] );
45       int ValidateWorldPosition(
46         double worldPos[ 3 ], double worldOrient[ 9 ]
47         );
48       int UpdateWorldPosition(
49         vtkRenderer* ren, double worldPos[ 3 ], double worldOrient[ 9 ]
50         );
51       int UpdateInternalState( );
52
53       void SetImageSlice( vtkImageSlice* slice );
54       virtual void SetWorldTolerance( double tol );
55
56     protected:
57       ImageSlicePointPlacer( );
58       virtual ~ImageSlicePointPlacer( );
59
60     private:
61       // Purposely not implemented
62       ImageSlicePointPlacer( const Self& );
63       Self& operator=( const Self& );
64
65     protected:
66       vtkImageSlice* ImageSlice;
67       vtkBoundedPlanePointPlacer* Placer;
68       double SavedBounds[ 6 ];
69       double Bounds[ 6 ];
70     };
71
72   } // ecapseman
73
74 } // ecapseman
75
76 #endif // __cpExtensions__Interaction__ImageSlicePointPlacer__h__
77
78 // eof - $RCSfile$