]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuManualContourModel_Box.h
#3485 ShowNPionts for Multiple Groups
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuManualContourModel_Box.h
1 //===== 
2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
3 //===== 
4 #ifndef __bbcreaMaracasVisuManualContourModel_Box_h_INCLUDED__
5 #define __bbcreaMaracasVisuManualContourModel_Box_h_INCLUDED__
6 #include "bbcreaMaracasVisu_EXPORT.h"
7 #include "bbtkAtomicBlackBox.h"
8 #include "iostream"
9
10 namespace bbcreaMaracasVisu
11 {
12
13 class bbcreaMaracasVisu_EXPORT ManualContourModel_Box
14  : 
15    public bbtk::AtomicBlackBox
16 {
17   BBTK_BLACK_BOX_INTERFACE(ManualContourModel_Box,bbtk::AtomicBlackBox);
18 //===== 
19 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
20 //===== 
21   BBTK_DECLARE_INPUT(Active,bool);
22   BBTK_DECLARE_INPUT(Type,int);
23   BBTK_DECLARE_INPUT(DoubleContour,int);
24   BBTK_DECLARE_INPUT(OpenClose,bool);
25   BBTK_DECLARE_INPUT(OpenClose2,bool);
26   BBTK_DECLARE_INPUT(NbPoints,int);
27   BBTK_DECLARE_INPUT(LstIndexsIn,std::vector<int>);
28   BBTK_DECLARE_INPUT(LstControlPointsX,std::vector<double>);
29   BBTK_DECLARE_INPUT(LstControlPointsY,std::vector<double>);
30   BBTK_DECLARE_INPUT(LstControlPointsZ,std::vector<double>);
31   BBTK_DECLARE_INPUT(Param,std::vector<double>);
32
33
34   BBTK_DECLARE_OUTPUT(LstContourPointsX,std::vector<double>);
35   BBTK_DECLARE_OUTPUT(LstContourPointsY,std::vector<double>);
36   BBTK_DECLARE_OUTPUT(LstContourPointsZ,std::vector<double>);
37   BBTK_DECLARE_OUTPUT(LstIndexsOut,std::vector<int>);
38   BBTK_DECLARE_OUTPUT(LstPssblIncnsnstntCntrY,std::vector<double>);
39   BBTK_DECLARE_OUTPUT(LstPssblIncnsnstntCntrID,std::vector<int>);
40
41   BBTK_PROCESS(Process);
42   void Process();
43
44
45 void ClockwisePoints(   std::vector<double> *lstInX,
46                                         std::vector<double> *lstInY, 
47                                         std::vector<double> *lstOuZ,
48                                         std::vector<int> *lstIndexsIn );
49
50 void ShiftValues(       std::vector<double> *lstInX,
51                                         std::vector<double> *lstInY, 
52                                         std::vector<double> *lstOuZ,
53                                         std::vector<int> *lstIndexsIn );
54
55
56   void ProcessBySegment(        
57                         int Type, 
58                         int &iGeneral, int sizeSegment,
59                         std::vector<double> *lstInX,std::vector<double> *lstInY, std::vector<double> *lstInZ,
60                         std::vector<double> *lstOutX,std::vector<double> *lstOutY, std::vector<double> *lstOutZ,
61                         std::vector<int>        *lstIndexsOut,
62                         bool open );
63
64
65 // Linear Distribution
66 void RedistributionPoints(      std::vector<double> *lstOutX,
67                                                         std::vector<double> *lstOutY, 
68                                                         std::vector<double> *lstOutZ, 
69                                                         std::vector<int> *lstIndexsOut );
70
71
72
73 // sin distribution
74 void RedistributionPoints_SIN_iContour(int iContour,    
75                                                         std::vector<double> *lstOutX,
76                                                         std::vector<double> *lstOutY, 
77                                                         std::vector<double> *lstOutZ, 
78                                                         std::vector<int> *lstIndexsOut,double alpha,double beta );
79 // find best sin distribution
80 void RedistributionPointsAllContours_SIN(       std::vector<double> *lstOutX,
81                                                                                         std::vector<double> *lstOutY, 
82                                                                                         std::vector<double> *lstOutZ, 
83                                                                                         std::vector<int> *lstIndexsOut );
84
85 void findAlphaBetaSinDistribution(      std::vector<double> *lstTmp2X,
86                                                                                                                         std::vector<double> *lstTmp2Y,
87                                                                                                                         std::vector<double> *lstTmp2Z ,
88                                                                                                                         int sizeContour,
89                                                                                                                         std::vector<double> *lstTmp1X,
90                                                                                                                         std::vector<double> *lstTmp1Y,
91                                                                                                                         std::vector<double> *lstTmp1Z,  
92                                                                                                                         double *alpha,
93                                                                                                                         double *beta); 
94
95 void Redistribution_SIN(        double alpha,
96                                                         double beta,
97                                                         std::vector<double> *lstC1X,
98                                                         std::vector<double> *lstC1Y, 
99                                                         std::vector<double> *lstC1Z,
100                                                         double sizeOfContour,
101                                                         std::vector<double> *lstC2X,
102                                                         std::vector<double> *lstC2Y, 
103                                                         std::vector<double> *lstC2Z );
104
105 double SizeContour(     std::vector<double> *lstX,
106                                         std::vector<double> *lstY, 
107                                         std::vector<double> *lstZ );
108
109 void CalculeLstSizeContours(    std::vector<double> *lstOutX,
110                                                                 std::vector<double> *lstOutY,
111                                                                 std::vector<double> *lstOutZ,
112                                                                 std::vector<int>        *lstIndexsOut,
113                                                                 std::vector<double>     *lstSizeContours        );
114
115
116 void ExtractContour(std::vector<double> *lstX,
117                                         std::vector<double> *lstY, 
118                                         std::vector<double> *lstZ,
119                                         std::vector<int> *lstIndexs,
120                                         int contour,
121                                         std::vector<double> *lstOutX,
122                                         std::vector<double> *lstOutY, 
123                                         std::vector<double> *lstOutZ );
124
125 void PutPointsInContour(        std::vector<double> *lstTmpX,
126                                                         std::vector<double> *lstTmpY, 
127                                                         std::vector<double> *lstTmpZ,
128                                                         int iContour,
129                                                         std::vector<double> *lstOutX,
130                                                         std::vector<double> *lstOutY, 
131                                                         std::vector<double> *lstOutZ,
132                                                         std::vector<int>        *lstOutIndexs );
133
134 double IntegralDistanceTwoContours( std::vector<double> *lstTmpAX,
135                                                                         std::vector<double> *lstTmpAY, 
136                                                                         std::vector<double> *lstTmpAZ,
137                                                                         std::vector<double> *lstTmpBX,
138                                                                         std::vector<double> *lstTmpBY, 
139                                                                         std::vector<double> *lstTmpBZ );
140                                                                         
141 void CopyContour2InContour1(    std::vector<double> *lstInX,
142                                                                 std::vector<double> *lstInY, 
143                                                                 std::vector<double> *lstInZ,
144                                                                 std::vector<double> *lstOutX,
145                                                                 std::vector<double> *lstOutY, 
146                                                                 std::vector<double> *lstOutZ );
147
148 std::vector<double> lstInconsistentContourY;
149 std::vector<int>        lstInconsistentContourID;
150
151 //===== 
152 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
153 //===== 
154 };
155
156 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ManualContourModel_Box,bbtk::AtomicBlackBox);
157   BBTK_NAME("ManualContourModel_Box");
158   BBTK_AUTHOR("InfoDev");
159   BBTK_DESCRIPTION("No Description.");
160   BBTK_CATEGORY("empty");
161
162   BBTK_INPUT(ManualContourModel_Box,Active,"(true default) Active true/false",bool,"");
163   BBTK_INPUT(ManualContourModel_Box,Type,"(1 default) 1=spline, 2=rectangle, 3=circle, 4=bullEye, 6=Line, 7=points, 8=rotationTool, 10=polygon, 12=Spline3D",int,"");
164   BBTK_INPUT(ManualContourModel_Box,DoubleContour,"(0 default) 0=Simple, 1=Double (This is used to construct surface, use LstIndexesIn)",int,"");
165   BBTK_INPUT(ManualContourModel_Box,OpenClose,"(false default) false=open, true=close",bool,"");
166   BBTK_INPUT(ManualContourModel_Box,OpenClose2,"(false default) false=open, true=close.  Used with the DoubleContour option.",bool,"");
167   BBTK_INPUT(ManualContourModel_Box,NbPoints,"(100 default) Number of points int the spline",int,"");
168   BBTK_INPUT(ManualContourModel_Box,LstIndexsIn,"Lst number of points by segment",std::vector<int>,"");
169   BBTK_INPUT(ManualContourModel_Box,LstControlPointsX,"List of control points",std::vector<double>,"");
170   BBTK_INPUT(ManualContourModel_Box,LstControlPointsY,"List of control points",std::vector<double>,"");
171   BBTK_INPUT(ManualContourModel_Box,LstControlPointsZ,"List of control points",std::vector<double>,"");
172   BBTK_INPUT(ManualContourModel_Box,Param,"(default 0) 0:Nothing  1:If OpenClose=true RedistributionPointsAllContours_SIN   2:Nothing ",std::vector<double>,"");
173   BBTK_OUTPUT(ManualContourModel_Box,LstContourPointsX,"List of points in the contour",std::vector<double>,"");
174   BBTK_OUTPUT(ManualContourModel_Box,LstContourPointsY,"List of points in the contour",std::vector<double>,"");
175   BBTK_OUTPUT(ManualContourModel_Box,LstContourPointsZ,"List of points in the contour",std::vector<double>,"");
176   BBTK_OUTPUT(ManualContourModel_Box,LstIndexsOut,"Lst number of points by segment",std::vector<int>,"");
177   BBTK_OUTPUT(ManualContourModel_Box,LstPssblIncnsnstntCntrY,"Lst of possible Inconsinstent Contour Y, little contour between two big contour, Difficult for the SIN distribution (DoubleContour 1)",std::vector<double>,"");
178   BBTK_OUTPUT(ManualContourModel_Box,LstPssblIncnsnstntCntrID,"Lst of possible Inconsinstent Contour ID, little contour between two big contour, Difficult for the SIN distribution (DoubleContour 1)",std::vector<int>,"");
179
180
181
182 BBTK_END_DESCRIBE_BLACK_BOX(ManualContourModel_Box);
183 //===== 
184 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
185 //===== 
186 }
187 // EO namespace bbcreaMaracasVisu
188
189 #endif // __bbcreaMaracasVisuManualContourModel_Box_h_INCLUDED__
190
191
192
193
194