]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/Contour/AutoControlPoints.h
a1ae4fbcbce154c3d15b973e412aa7d61db64e49
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / Contour / AutoControlPoints.h
1 #ifndef __AutoControlPoints_h_INCLUDED__
2 #define __AutoControlPoints_h_INCLUDED__
3
4 #include "manualContourModel.h"
5 #include "Propagation.h"
6 #include "vectorFunctions.h"
7
8 class AutoControlPoints : Vector
9 {
10         public:
11                         AutoControlPoints();
12                         ~AutoControlPoints();           
13                         int GetSizeVector       ( std::vector<double>*Vector );
14
15                         void PointLeft          ( std::vector<double>*IndX, std::vector<double>*InY, std::vector<double>*InZ, 
16                                                                   double* lex, double* ley, double* lez );
17                         void PointRight         ( std::vector<double>*IndX, std::vector<double>*InY, std::vector<double>*InZ, 
18                                                                   double* rix, double* riy, double* riz );
19                         void PointHigh          ( std::vector<double>*IndX, std::vector<double>*InY, std::vector<double>*InZ, 
20                                                                   double* hix, double* hiy, double* hiz );
21                         void PointLow           ( std::vector<double>*IndX, std::vector<double>*InY, std::vector<double>*InZ, 
22                                                                   double* lox, double* loy, double* loz );
23                         void TwoPoints          ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
24                         
25                         void Intersection       ( double x01, double y01, double x02, double y02, double mn, double m2, double* x, double* y );
26                         void InterBetweenContours                       ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
27                         void GetInterBetweenContours            ( std::vector<Vector>*interVX, std::vector<Vector>*interVY );
28                         void IntersectionPoints                         ( );
29                         void GetIntersectionPoints                      ( std::vector<Vector>*interVX, std::vector<Vector>*interVY );
30                         void GetErrorBetweenContours            ( std::vector<double>*vec );
31                         void CalculeControlPoints                       ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
32                         void GetControlPoints                           ( std::vector<double>*OutX, std::vector<double>*OutY, std::vector<double>*OutZ );
33                         void CalculeInitialControlPoints        ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
34                         void GetInitialControlPoints            ( std::vector<double>*OutX, std::vector<double>*OutY, std::vector<double>*OutZ );
35                         void SetNumSplineInterpolation          ( int num ); 
36         
37         private:
38                         void ChargeSpline                                       ( );
39                         double  Slope                                           ( double x0, double y0, double x1, double y1 );
40                         double  Normal                                          ( double x0, double y0, double* m, double xi );
41                         void    CircleCenter                            ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ, double *cx, double *cy, double *r );
42                         void    CirclePoints                            ( double cx, double cy, double r, double grad, double *x, double *y );  
43                         void    InterCircle                                     ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
44                         void    maxminLocal                                     ( );
45                         void    fixBetweenPoints                        ( double val );
46                         void    ErrorBetweenContours            ( );
47                         void    AddControlPoint                         ( bool activate );
48                         void    InterBetweenControl                     ( );
49                         void    fixBetweenControl                       ( );
50                         void    PossibleIntersections           ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
51                         void    ControlInContour                        ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
52                         void    NearMaxError2Control            ( );
53                         void    MoveControlPointInContour       ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
54                         double  MoveAndAverage                          ( int dir, std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
55                         void    MoveControlPoints                       ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
56                         void    GetNewPoints                            ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
57                         void    GetInitialNewPoints                     ( std::vector<double>*InX, std::vector<double>*InY, std::vector<double>*InZ );
58                         
59                         int                                             _SizeVectorIn;
60                         std::vector<double>             _controlpointsX;
61                         std::vector<double>             _controlpointsY;
62                         std::vector<double>             _controlpointsZ;
63
64                         manualContourModel              *_mContourModel;
65                         int                                             _numspline;
66                         double                                  _pathsize;
67
68                         std::vector<double>             _chargecontrolpointsX;
69                         std::vector<double>             _chargecontrolpointsY;
70                         std::vector<double>             _chargecontrolpointsZ;
71
72                         std::vector<double>             _circleX;
73                         std::vector<double>             _circleY;
74                         std::vector<double>             _intercircleX;
75                         std::vector<double>             _intercircleY;
76                         std::vector<double>             _intercircleDist;
77                         std::vector<double>             _interbewteencircleX;
78                         std::vector<double>             _interbewteencircleY;
79                         std::vector<double>             _interbewteencircleDist;
80                         std::vector<int>                _interbewteencirclePos;
81
82                         std::vector<int>                _posmaxlocal;
83                         std::vector<int>                _posminlocal;
84                         std::vector<double>             _maxlocalX;
85                         std::vector<double>             _maxlocalY;
86                         std::vector<double>             _minlocalX;
87                         std::vector<double>             _minlocalY;
88                         std::vector<double>             _minmaxlocalX;
89                         std::vector<double>             _minmaxlocalY;
90                         std::vector<int>                _posminmaxlocal;
91
92                         std::vector<Vector>             _intervectorX;
93                         std::vector<Vector>             _intervectorY;
94                         std::vector<double>             _interpointsX;
95                         std::vector<double>             _interpointsY;
96                         int                                             _posA;
97                         int                                             _posB;
98
99                         double                                  _errorpos;
100                         std::vector<double>             _errorvector;
101                         
102                         std::vector<Vector>             _intervecXX;
103                         std::vector<Vector>             _intervecYY;
104                         std::vector<Vector>             _interitselfX;
105                         std::vector<Vector>             _interitselfY;
106
107                         int                                             _posn;
108                         std::vector<int>                _contIncontpos; 
109
110 };
111
112 #endif //  __AutoControlPoints_h_INCLUDED__
113  
114