]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewPoint.h
2ee3c3cd9fb311065f5a79bb6b0b26244faff4a3
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualViewPoint.h
1 #ifndef manualViewPoint_h
2 #define manualViewPoint_h
3
4 #include "vtkRenderWindow.h"
5
6 #include "vtkRenderer.h"
7 #include "vtkRenderWindowInteractor.h" //extremely important with VC++ don't remove !
8 #include "vtkCommand.h"
9 #include "vtkPolyData.h"
10 #include "vtkCellArray.h"
11 #include "vtkPolyDataMapper.h"
12 #include "vtkInteractorObserver.h"
13 #include "vtkInteractorStyleImage.h"
14 #include <vtkKochanekSpline.h> 
15
16 #include <vtkCellPicker.h> 
17 #include <vtkCamera.h> 
18 #include <vtkPolyLine.h>
19 #include <vtkDataSetMapper.h>
20 #include <vtkUnstructuredGrid.h>
21
22 #include "wxVTKRenderWindowInteractor.h"
23
24 #include <vector>
25 #include "wxVtkBaseView.h"
26 #include "marTypes.h"
27
28 //--------------------------------------------------------
29
30 class manualViewPoint{
31 public:
32
33         manualViewPoint(wxVtkBaseView *wxvtkbaseview);
34         virtual ~manualViewPoint();
35
36         virtual manualViewPoint * Clone();
37         void CopyAttributesTo( manualViewPoint *cloneObject );
38         void            SetSelected(bool selected);
39         void            SetPosibleSelected(bool posibleSelected);
40         bool            GetSelected();
41         bool            GetPosibleSelected();
42         void            DeleteVtkObjects();
43         vtkActor*       CreateVtkPointActor();
44
45         //
46         // Sets the x,y,z position to the actual point. Establishes a range of the points respect 
47         // to the final coordinate.
48         // @param x - double
49         // @param y - double
50         // @param z - double
51         // @param range - double
52         //
53         void            SetPositionXY(double x, double y, double range, double posZ);
54
55         //
56         // Get ViewPoint VtkActor
57         // @return vtkActor*
58         //
59         vtkActor*   GetVtkActor();
60         
61         //
62         // Updates the color and width of the actual point if the VTK Actor has been created
63         //
64         void            UpdateColorActor();     
65
66         //
67         // Updates the point normal color of the actual point.
68         //
69         void UpdateColorActor(double nR, double nG, double nB);
70
71         void            GetSpacing(double spc[3]);
72         void            SetSpacing(double spc[3]);
73         void            SetWidthLine( double width);
74
75
76 private:
77
78         //
79         // Is point selected
80         //
81         bool                            _selected;      
82         bool                            _posibleSelected;
83         
84         vtkPoints                       *_pts;
85         
86         //
87         // Point VTK PolyData object 
88         //
89         vtkPolyData                     *_pd;
90
91         //
92         // Point VTK Actor
93         //
94         vtkActor                        *_pointVtkActor;
95
96         //
97         // Point VTK PolyData mapper
98         //
99         vtkPolyDataMapper       *_bboxMapper;
100
101         //
102         // Reference to VtkBaseView
103         //
104         wxVtkBaseView           *_wxvtkbaseview;
105
106         //
107         // Line Width (def=1)
108         //
109         double                          _widthline;
110 protected:
111
112         //
113         // Point spacing (def=1)
114         //
115         double          _spc[3];
116
117         // Point normal color
118         double          _colorNormal_r;
119         double          _colorNormal_g;
120         double          _colorNormal_b;
121
122         // Posible selected point color
123         double          _colorPosibleSelected_r;
124         double          _colorPosibleSelected_g;
125         double          _colorPosibleSelected_b;
126 };
127
128 #endif // manualViewPoint_h