]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualContourModel.h
1 #ifndef manualContourModel_h
2 #define manualContourModel_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 "wxVTKRenderWindowInteractor.h"
25
26
27 //--
28
29 #include <vector>
30 #include "wxVtkBaseView.h"
31 #include "marTypes.h"
32 #include "manualPoint.h"
33
34
35 // ----------------------------------------------------------------------------
36 // ----------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------
38
39
40 class creaMaracasVisu_EXPORT manualContourModel
41 {
42 public:
43         manualContourModel();
44         virtual ~manualContourModel();
45
46         virtual manualContourModel * Clone();
47         void CopyAttributesTo( manualContourModel *cloneObject );
48         virtual void Open(FILE *ff);    // virtual
49         virtual void Save(FILE *ff);    // virtual
50         virtual int GetTypeModel();                     // virtual 
51
52         int                             AddPoint(double x,double y,double z);
53         int                             InsertPoint(double x,double y,double z);
54 //JSTG 25-04-08 -------------------------------------------------------
55         void                    InsertPoint_id(int id, double x,double y,double z);
56 //---------------------------------------------------------------------
57         void                    AddManualPoint( manualPoint* theManualPoint );
58
59         void                    DeletePoint(int i);
60         void                    DeleteAllPoints();
61
62         void                    MovePoint(int i,double dx,double dy,double dz);
63         void                    MoveLstPoints(double dx,double dy,double dz);
64         void                    MoveAllPoints(double dx,double dy,double dz);
65
66         int                             GetIdPoint(double x, double y, double z, int i_range,int type);
67         manualPoint*    GetManualPoint(int id);
68         int                             GetSizeLstPoints();
69         int                             GetNumberOfPointsSpline();
70         void                    SetNumberOfPointsSpline(int size);
71
72         virtual void    UpdateSpline();
73         void                    SetCloseContour(bool closeContour);
74         bool                    IfCloseContour();
75 //JSTG 25-02-08 -----------------------------------------------------------------
76         //void                  GetSplinePoint(double t, double &x, double &y, double &z);      //Method Original
77         //void                  GetSplineiPoint(int i, double &x, double &y, double &z);        //Method Original
78 //-------------------------------------------------------------------------------
79         double                  GetPathSize();
80         double                  GetPathArea();
81
82         void                    GetNearestPointAndNormal(double *p, double *rp,  double *rn);
83         
84 // JSTG 25-02-08 -----------------------------------------------------------------
85         virtual void    GetSpline_i_Point(int i, double *x, double *y, double *z);
86         void                    GetSpline_t_Point(double t, double *x, double *y, double *z);
87 //--------------------------------------------------------------------------------
88
89         virtual std::vector<manualContourModel*> ExploseModel(  );
90
91 private:
92         int                                                     _sizePointsContour;
93         std::vector<manualPoint*>       _lstPoints;
94         bool                                            _closeContour;
95     vtkKochanekSpline                   *_cntSplineX;
96     vtkKochanekSpline                   *_cntSplineY;
97     vtkKochanekSpline                   *_cntSplineZ;
98
99 //JSTG 25-02-08 ----------------------------------------
100         double                  _delta_JSTG;
101 //------------------------------------------------------
102
103 }; 
104
105
106 #endif // manualContourModel_h