1 #ifndef manualBaseModel_h
2 #define manualBaseModel_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 <vtkCellPicker.h>
15 #include <vtkCamera.h>
16 #include <vtkPolyLine.h>
17 #include <vtkDataSetMapper.h>
18 #include <vtkUnstructuredGrid.h>
20 #include "wxVTKRenderWindowInteractor.h"
23 #include "wxVtkBaseView.h"
25 #include "manualPoint.h"
27 // --------------------------------------------------------------------------------------------
28 // Includes the functionality to manage a contour without the spline line usage
30 class creaMaracasVisu_EXPORT manualBaseModel
34 virtual ~manualBaseModel();
36 virtual manualBaseModel * Clone();
37 void CopyAttributesTo( manualBaseModel *cloneObject );
38 virtual void Open(FILE *ff); // virtual
39 virtual void Save(FILE *ff); // virtual
40 virtual int GetTypeModel(); // virtual
42 virtual void SetNumberOfPointsSpline(int size);
44 virtual int AddPoint(double x,double y,double z);
45 virtual int InsertPoint(double x,double y,double z);
46 virtual void InsertPoint_id(int id, double x,double y,double z);
47 virtual void AddManualPoint( manualPoint* theManualPoint );
48 virtual void DeletePoint(int i);
49 virtual void DeleteAllPoints();
51 virtual void MovePoint(int i,double dx,double dy,double dz);
52 virtual void MoveLstPoints(double dx,double dy,double dz);
53 virtual void MoveAllPoints(double dx,double dy,double dz);
55 // Returns the id of the point in the coordinates and the i_range given, according to the type
56 // which corresponds to the plane where it's necessary to find the point.
57 // @param type=-1 x,y,z - type=0 y,z - type=1 x,z - type=2 x,y
58 // @return int - Returns the id of the point in the coordinates given. Returns -1 otherwise.
59 virtual int GetIdPoint(double x, double y, double z, int i_range,int type);
60 virtual manualPoint* GetManualPoint(int id);
61 virtual int GetSizeLstPoints();
62 virtual double GetPathSize();
63 virtual void Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By);
64 virtual void GetSpline_i_Point(int i, double *x, double *y, double *z);
65 virtual void GetSpline_t_Point(double t, double *x, double *y, double *z);
68 // Returns the number of points of the spline line, but not the contour control points
69 // @return int - spline points size
71 virtual int GetNumberOfPointsSpline();
72 virtual void UpdateSpline();
75 // Returns a list with the actual model
76 // @return std::vector<manualBaseModel*>
78 virtual std::vector<manualBaseModel*> ExploseModel( );
79 virtual double GetPathArea();
80 virtual void GetNearestPointAndNormal(double *p, double *rp, double *rn);
82 virtual void SetCloseContour(bool closeContour);
83 virtual bool IfCloseContour();
88 // Returns true if the point with the coordinates in parameters is one of the points in
89 // the list of points of the model,
92 // @return true if the point with the coordinates in parameters is one of the points, false otherwise
94 int IsPoint(double x, double y);
96 // CMRU 17-08-09 -----------------------------------------------------------------
99 * Assigns the parameter value to the label
100 * @param newLabel New label of the contour
102 virtual void SetLabel(std::string newLabel);
105 * Assigns the parameter value to the real size
106 * @param newRealSize New real size in milimeters of the contour
108 virtual void SetRealSize(double newRealSize);
111 * Returns the label of the contour
113 virtual std::string GetLabel();
116 * Returns the real size in milimeters of the contour
118 virtual double GetRealSize();
121 * Saves the label and the real size of the contour
122 * @param ff File where the information is stored
124 virtual void SaveData(FILE *ff);
127 * Reads and interprets the information of the label and the real size
128 * @param ff File where the information is readed
130 virtual void OpenData(FILE *ff);
133 int _sizePointsContour;
134 std::vector<manualPoint*> _lstPoints;
139 #endif // manualBaseModel_h