1 #ifndef manualContourModel_h
2 #define manualContourModel_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>
16 #include <vtkCellPicker.h>
19 #include <vtkCamera.h>
20 #include <vtkPolyLine.h>
21 #include <vtkDataSetMapper.h>
22 #include <vtkUnstructuredGrid.h>
24 #include "wxVTKRenderWindowInteractor.h"
30 #include "wxVtkBaseView.h"
32 #include "manualPoint.h"
33 #include "manualBaseModel.h"
36 // ----------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------
38 // ----------------------------------------------------------------------------
41 class creaMaracasVisu_EXPORT manualContourModel : public manualBaseModel
45 virtual ~manualContourModel();
47 virtual manualContourModel * Clone();
48 void CopyAttributesTo( manualContourModel *cloneObject );
49 void Open(FILE *ff); // virtual
50 virtual void Save(FILE *ff); // virtual
51 virtual int GetTypeModel(); // virtual
53 virtual int AddPoint(double x,double y,double z);
54 virtual int InsertPoint(double x,double y,double z);
55 //JSTG 25-04-08 -------------------------------------------------------
56 virtual void InsertPoint_id(int id, double x,double y,double z);
57 //---------------------------------------------------------------------
58 virtual void AddManualPoint( manualPoint* theManualPoint );
59 virtual void Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By);
61 virtual void DeletePoint(int i);
62 virtual void DeleteAllPoints();
64 virtual void MovePoint(int i,double dx,double dy,double dz);
65 virtual void MoveLstPoints(double dx,double dy,double dz);
66 virtual void MoveAllPoints(double dx,double dy,double dz);
68 virtual int GetIdPoint(double x, double y, double z, int i_range,int type);
69 virtual manualPoint* GetManualPoint(int id);
70 virtual int GetSizeLstPoints();
71 int GetNumberOfPointsSpline();
72 virtual void SetNumberOfPointsSpline(int size);
74 virtual void UpdateSpline();
75 void SetCloseContour(bool closeContour);
76 bool IfCloseContour();
77 //JSTG 25-02-08 -----------------------------------------------------------------
78 //void GetSplinePoint(double t, double &x, double &y, double &z); //Method Original
79 //void GetSplineiPoint(int i, double &x, double &y, double &z); //Method Original
80 //-------------------------------------------------------------------------------
81 virtual double GetPathSize();
82 virtual double GetPathArea();
84 void GetNearestPointAndNormal(double *p, double *rp, double *rn);
86 // JSTG 25-02-08 -----------------------------------------------------------------
87 virtual void GetSpline_i_Point(int i, double *x, double *y, double *z);
88 void GetSpline_t_Point(double t, double *x, double *y, double *z);
89 //--------------------------------------------------------------------------------
91 virtual std::vector<manualBaseModel*> ExploseModel( );
93 // CMRU 17-08-09 -----------------------------------------------------------------
96 * Assigns the parameter value to the label
97 * @param newLabel New label of the contour
99 void SetLabel(std::string newLabel);
102 * Assigns the parameter value to the real size
103 * @param newRealSize New real size in milimeters of the contour
105 void SetRealSize(double newRealSize);
108 * Returns the label of the contour
110 std::string GetLabel();
113 * Returns the real size in milimeters of the contour
115 double GetRealSize();
118 * Saves the label and the real size of the contour
119 * @param ff File where the information is stored
121 void SaveData(FILE *ff);
124 * Reads and interprets the information of the label and the real size
125 * @param ff File where the information is readed
127 void OpenData(FILE *ff);
128 //--------------------------------------------------------------------------------
131 //int _sizePointsContour;
132 //std::vector<manualPoint*> _lstPoints;
134 vtkKochanekSpline *_cntSplineX;
135 vtkKochanekSpline *_cntSplineY;
136 vtkKochanekSpline *_cntSplineZ;
138 //JSTG 25-02-08 ----------------------------------------
140 //------------------------------------------------------
142 //CMRU 17-08-09 -----------------------------------------------------------------
144 * Represents the real size in milimeters of the contour
149 * Represents the label associated with the contour
152 //--------------------------------------------------------------------------------
157 #endif // manualContourModel_h