]> Creatis software - cpMesh.git/blob - lib/cpm/VTK/PointPickerRepresentation.h
First commit
[cpMesh.git] / lib / cpm / VTK / PointPickerRepresentation.h
1 #ifndef __CPM__VTK__POINTPICKERREPRESENTATION__H__
2 #define __CPM__VTK__POINTPICKERREPRESENTATION__H__
3
4 #include <vtkActor.h>
5 #include <vtkSmartPointer.h>
6 #include <vtkWidgetRepresentation.h>
7
8 #include <cpm/VTK/MeshMapper.h>
9
10 namespace cpm
11 {
12   namespace VTK
13   {
14     template< class M >
15     class PointPickerRepresentation
16       : public vtkWidgetRepresentation
17     {
18     public:
19       typedef PointPickerRepresentation Self;
20       typedef M TMesh;
21
22       typedef MeshMapper< M > TMapper;
23
24     public:
25       vtkTypeMacro( PointPickerRepresentation, vtkWidgetRepresentation );
26
27     public:
28       static Self* New( )
29         {
30           return( new Self( ) );
31         }
32
33       void SetMesh( M* mesh )
34         {
35           this->m_Mesh = mesh;
36           this->m_MeshMapper = vtkSmartPointer< TMapper >::New( );
37           this->m_MeshMapper->SetInputData( this->m_Mesh );
38
39           this->m_MeshActor = vtkSmartPointer< vtkActor >::New( );
40           this->m_MeshActor->SetMapper( this->m_MeshMapper );
41
42           this->Modified( );
43         }
44
45       virtual void BuildRepresentation( )
46         {
47           std::cout << "PointPickerRepresentation BuildRepresentation" << std::endl;
48           std::exit( 1 );
49         }
50       virtual void PlaceWidget( double* bounds[ 6 ] )
51         {
52           std::cout << "PointPickerRepresentation PlaceWidget" << std::endl;
53           std::exit( 1 );
54         }
55       virtual void StartWidgetInteraction( double eventPos[ 2 ] )
56         {
57           std::cout << "PointPickerRepresentation StartWidgetInteraction" << std::endl;
58           std::exit( 1 );
59         }
60       virtual void WidgetInteraction( double newEventPos[ 2 ] )
61         {
62           std::cout << "PointPickerRepresentation WidgetInteraction" << std::endl;
63           std::exit( 1 );
64         }
65       virtual void EndWidgetInteraction( double newEventPos[ 2 ] )
66         {
67           std::cout << "PointPickerRepresentation EndWidgetInteraction" << std::endl;
68           std::exit( 1 );
69         }
70       virtual int ComputeInteractionState( int X, int Y, int modify = 0 )
71         {
72           std::cout << "PointPickerRepresentation ComputeInteractionState" << std::endl;
73           std::exit( 1 );
74         }
75       virtual int GetInteractionState( )
76         {
77           std::cout << "PointPickerRepresentation GetInteractionState" << std::endl;
78           std::exit( 1 );
79         }
80       virtual void Highlight(int highlightOn )
81         {
82           std::cout << "PointPickerRepresentation Highlight" << std::endl;
83           std::exit( 1 );
84         }
85
86     protected:
87       PointPickerRepresentation( )
88         : Superclass( )
89         {
90         }
91
92       virtual ~PointPickerRepresentation( )
93         {
94         }
95
96     private:
97       // Purposely not implemented
98       PointPickerRepresentation( const Self& );
99       void operator=( const Self& );
100
101     protected:
102       typename M::Pointer         m_Mesh;
103       vtkSmartPointer< TMapper >  m_MeshMapper;
104       vtkSmartPointer< vtkActor > m_MeshActor;
105     };
106
107   } // ecapseman
108
109 } // ecapseman
110
111 #endif // __CPM__VTK__POINTPICKERREPRESENTATION__H__
112
113 // eof - $RCSfile$