]> 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         void                    Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By);
59
60         void                    DeletePoint(int i);
61         void                    DeleteAllPoints();
62
63         void                    MovePoint(int i,double dx,double dy,double dz);
64         void                    MoveLstPoints(double dx,double dy,double dz);
65         void                    MoveAllPoints(double dx,double dy,double dz);
66
67         int                             GetIdPoint(double x, double y, double z, int i_range,int type);
68         manualPoint*    GetManualPoint(int id);
69         int                             GetSizeLstPoints();
70         int                             GetNumberOfPointsSpline();
71         void                    SetNumberOfPointsSpline(int size);
72
73         virtual void    UpdateSpline();
74         void                    SetCloseContour(bool closeContour);
75         bool                    IfCloseContour();
76 //JSTG 25-02-08 -----------------------------------------------------------------
77         //void                  GetSplinePoint(double t, double &x, double &y, double &z);      //Method Original
78         //void                  GetSplineiPoint(int i, double &x, double &y, double &z);        //Method Original
79 //-------------------------------------------------------------------------------
80         double                  GetPathSize();
81         double                  GetPathArea();
82
83         void                    GetNearestPointAndNormal(double *p, double *rp,  double *rn);
84         
85 // JSTG 25-02-08 -----------------------------------------------------------------
86         virtual void    GetSpline_i_Point(int i, double *x, double *y, double *z);
87         void                    GetSpline_t_Point(double t, double *x, double *y, double *z);
88 //--------------------------------------------------------------------------------
89
90         virtual std::vector<manualContourModel*> ExploseModel(  );
91
92 private:
93         int                                                     _sizePointsContour;
94         std::vector<manualPoint*>       _lstPoints;
95         bool                                            _closeContour;
96     vtkKochanekSpline                   *_cntSplineX;
97     vtkKochanekSpline                   *_cntSplineY;
98     vtkKochanekSpline                   *_cntSplineZ;
99
100 //JSTG 25-02-08 ----------------------------------------
101         double                  _delta_JSTG;
102 //------------------------------------------------------
103
104 }; 
105
106
107 #endif // manualContourModel_h