]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.h
2c5f8935ace4fc7e3a4f9725b8117abef21b1f2a
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualContourBaseControler.h
1 #ifndef manualContourBaseControler_h
2 #define manualContourBaseControler_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
18
19 #include <vtkCamera.h> 
20 #include <vtkPolyLine.h>
21 #include <vtkDataSetMapper.h>
22 #include <vtkUnstructuredGrid.h>
23
24 #include <vtkActor.h>
25 #include <vtkProperty.h>
26
27 #include <vtkCellArray.h>
28 #include <vtkRenderer.h>
29 #include <vtkCoordinate.h>
30 #include <vtkTextProperty.h>
31 #include <vtkTextActor.h>
32 #include <vtkProperty2D.h>
33 #include <vtkPointPicker.h>
34 //#include "widgets/UtilVtk3DGeometriSelection.h"
35 #include "UtilVtk3DGeometriSelection.h"
36 //#include "widgets/InteractorStyleMaracas.h"
37 #include "InteractorStyleMaracas.h"
38
39 #include "wxVTKRenderWindowInteractor.h"
40
41
42 //--
43
44 #include <vector>
45 #include "wxVtkBaseView.h"
46 #include "marTypes.h"
47
48 #include "manualContourModel.h"
49 #include "manualViewBaseContour.h"
50
51
52 // ----------------------------------------------------------------------------
53 // ----------------------------------------------------------------------------
54 // ----------------------------------------------------------------------------
55
56 class creaMaracasVisu_EXPORT manualContourBaseControler: public InteractorStyleMaracas
57 {
58 public:
59         manualContourBaseControler();
60         virtual ~manualContourBaseControler();
61
62         virtual manualContourBaseControler * Clone();
63         void CopyAttributesTo( manualContourBaseControler *cloneObject );
64
65         virtual bool  OnChar();
66         virtual bool  OnMouseMove();
67         virtual bool  OnLeftButtonDown(); 
68         virtual bool  OnLeftButtonUp();
69         virtual bool  OnLeftDClick();
70         virtual bool  OnMiddleButtonDown(); 
71         virtual bool  OnMiddleButtonUp();
72         virtual bool  OnRightButtonDown();
73         virtual bool  OnRightButtonUp();
74
75         void    SetModelView(manualBaseModel *manContModel, manualViewBaseContour *manViewBaseCont);
76         manualBaseModel         * GetManualContourModel();
77         manualViewBaseContour   * GetManualViewBaseContour();
78
79
80         virtual void    MouseClickLeft(int x, int y);
81         virtual void    MouseClickRight(int x, int y);
82         virtual void    MouseDLeft(int x, int y);
83
84         virtual void    MouseMove(int x, int y);
85         virtual void    MouseReleaseLeft(int x, int y);
86
87         void    SetState(int state);
88         int             GetState();
89         bool    IsEditable();
90         virtual void    SetEditable(  bool condition  );
91         bool    GetPosibleToMove();
92         void    SetPosibleToMove(  bool condition  );
93         bool    IsMoving();
94         void    SetMoving(  bool condition  );
95         void    SetCompleteCreation( bool condition );
96         bool    GetIfCompleteCreation ( );
97         void    SetKeyBoardMoving( bool condition );
98         bool    GetKeyBoardMoving(  );
99         
100         void    CreateNewManualContour();
101         int             GetNumberOfPointsManualContour();
102         int             GetNumberOfPointsSplineManualContour();
103         void    DeleteContour();
104         virtual void    DeleteActualMousePoint(int x, int y );
105         double* GetVectorPointsXManualContour();
106         double* GetVectorPointsYManualContour();
107         
108
109         void    SetZ(int z);
110         virtual int             GetZ();
111
112         // VIRTUAL - Adds a point in an specified position
113         // @param x - int
114         // @param y - int
115         // @param z - int
116         virtual void    AddPoint(int x, int y, int z);
117         virtual void    InsertPoint(int x, int y, int z);
118
119         virtual void    SetPoint(       int id ,int x ,int y ,int z);
120                         void    SetPointX(      int id ,int x );
121                         void    SetPointY(      int id ,int y );
122                         void    SetPointZ(      int id ,int z );
123
124                         void    Magnet(int x, int y);
125         virtual void    ResetContour();
126
127         virtual void Configure();
128
129
130 //EED Borrame
131 //      virtual manualContourBaseControler * Clone( manualViewBaseContour * cloneView = NULL, manualContourModel * cloneModel = NULL );
132
133
134 protected:
135         
136         // Reference to the contour or element view 
137         manualViewBaseContour   *_manViewBaseCont;
138
139         // Reference to the model contour or element model 
140         manualBaseModel         *_manContModel;
141
142         int                                             _z;
143         int                                             _state;
144         bool                                    _editable;      
145         bool                                    _posibleToMove;
146         bool                                    _moving;
147         bool                                    _created;
148         bool                                    _keyBoardMoving;
149                 
150 }; 
151
152
153 #endif // manualContourBaseControler_h