1 #ifndef manualViewBaseContour_h
2 #define manualViewBaseContour_h
4 #include "vtkRenderWindow.h"
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>
17 #include <vtkProperty.h>
18 #include <vtkCellArray.h>
19 #include <vtkRenderer.h>
20 #include <vtkCoordinate.h>
21 #include <vtkTextProperty.h>
22 #include <vtkTextActor.h>
23 #include <vtkProperty2D.h>
24 #include <vtkPointPicker.h>
25 #include "widgets/UtilVtk3DGeometriSelection.h"
27 #include <vtkCellPicker.h>
30 #include <vtkCamera.h>
31 #include <vtkPolyLine.h>
32 #include <vtkDataSetMapper.h>
33 #include <vtkUnstructuredGrid.h>
35 #include "wxVTKRenderWindowInteractor.h"
41 #include "wxVtkBaseView.h"
44 #include "manualViewPoint.h"
45 #include "manualContourModel.h"
47 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
49 // ----------------------------------------------------------------------------
52 class creaMaracasVisu_EXPORT manualViewBaseContour{
54 manualViewBaseContour();
55 virtual ~manualViewBaseContour();
57 virtual int GetType();
58 virtual void Save(FILE *pFile);
59 virtual void Open(FILE *pFile);
62 void AddPoint( manualViewPoint * manualViewPoint );
63 void InsertPoint(int id);
65 void DeletePoint(int x, int y,int z);
66 virtual void DeletePoint(int id);
68 virtual void UpdateViewPoint(int id);
69 virtual void UpdateViewPoints();
71 void SetSelected(bool selected);
72 void SetPosibleSelected(bool posibleSelected);
74 bool GetPosibleSelected();
75 void DeleteSelectedPoints();
77 void SetEditable( bool * condition );
81 virtual int GetIdPoint(int x, int y, int z);
83 void SelectPoint(int i,bool select);
84 void SelectLstPoints();
85 void SelectAllPoints(bool select);
86 virtual int SelectPosiblePoint(int x, int y ,int z);
87 bool SelectPosibleContour(int x, int y ,int z);
88 void SelectAllPossibleSelected(bool select);
89 void SetPointSelected(int id,bool select);
90 void SetPointPosibleSelected(int id,bool select);
91 void SetIfViewControlPoints(bool ifShow);
92 bool GetIfViewControlPoints();
94 void UnSelectPoint(int i);
95 void UnSelectLstPoints();
96 void UnSelectAllPoints();
98 void SetModel(manualContourModel *manContModel);
99 void SetWxVtkBaseView(wxVtkBaseView *wxvtkbaseview);
101 virtual void Refresh();
102 int GetNumberOfPoints(); // ???
103 //int GetNumberOfPointsSpline(); //JSTG 25-02-08 In ContourModel is the same method
104 //void SetNumberOfPointsSpline(int size); //JSTG 25-02-08 In ContourModel is the same method
106 void CreateNewContour();
107 double* GetVectorPointsXManualContour();
108 double* GetVectorPointsYManualContour();
109 double* GetVectorPointsZManualContour();
111 virtual bool ifTouchContour(int x,int y, int z);
112 void UpdateColorActor();
114 void SetRange(int range);
119 wxVtkBaseView *GetWxVtkBaseView();
121 virtual void InitMove(int x, int y, int z);
122 virtual void MoveContour(int x, int y, int z);
123 virtual void MoveContour(int horizontalUnits, int verticalUnits );
124 virtual void GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ );
125 virtual void TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type=2);
128 virtual void ClearPoint(int id);
130 void SetVisible(bool ok);
131 void SetShowText(bool ok);
133 void GetSpacing(double spc[3]);
134 void SetSpacing(double spc[3]);
136 void SetColorNormalContour(double r, double g, double b);
137 void GetColorNormalContour(double &r, double &g, double &b);
138 void SetColorEditContour(double r, double g, double b);
139 void GetColorEditContour(double &r, double &g, double &b);
140 void SetColorSelectContour(double r, double g, double b);
141 void GetColorSelectContour(double &r, double &g, double &b);
143 //Addinging and removing from visualization specific actors included in the viewer contour
144 void AddCompleteContourActor( bool ifControlPoints = false);
145 void RemoveCompleteContourActor();
146 virtual void AddSplineActor();
147 virtual void RemoveSplineActor();
148 void AddControlPoints();
149 void RemoveControlPoints();
151 void RemoveTextActor();
153 virtual manualViewBaseContour * Clone();
154 void CopyAttributesTo( manualViewBaseContour *cloneObject );
155 virtual void RefreshContour();
156 void SetWidthLine(double width);
157 double GetWidthLine();
159 virtual void ConstructVTKObjects();
164 wxVtkBaseView *_wxvtkbaseview;
167 bool _posibleSelected;
168 bool _viewControlPoints;
172 vtkActor *_contourVtkActor;
173 vtkPolyDataMapper *_bboxMapper;
175 double _coulorEdit_r;
176 double _coulorEdit_g;
177 double _coulorEdit_b;
178 double _coulorNormal_r;
179 double _coulorNormal_g;
180 double _coulorNormal_b;
181 double _coulorSelection_r;
182 double _coulorSelection_g;
183 double _coulorSelection_b;
186 void DeleteVtkObjects();
187 virtual void RefreshText();
194 int _id_viewPoint_for_text;
195 vtkTextActor *_textActor;
196 manualContourModel *_manContModel;
198 // JSTG 25-02-08 --------------------------------------------
199 int _sizePointsContour;
200 //-----------------------------------------------------------
201 std::vector<manualViewPoint*> _lstViewPoints;
207 #endif // manualViewBaseContour_h