53{
54 unsigned int nbok = 0;
55 unsigned int nb = 0;
56
58 {
59
61
62
64 std::vector<Dimension> v1, v2;
65 v1.push_back(0); v1.push_back(2);
66 v2.push_back(2); v2.push_back(1);
67 Projector2D proj1, proj2, proj3;
68 proj1.
init(v1.begin(), v1.end());
69 proj2.init(v2.begin(), v2.end());
70
71
73 trace.
info() <<
"p " << p <<
" => " << proj1(p) <<
" == " << res1 << std::endl;
74 nbok += ( proj1(p) == res1 ) ? 1 : 0;
75 nb++;
76
78 trace.
info() <<
"p " << p <<
" => " << proj2(p) <<
" == " << res2 << std::endl;
79 nbok += ( proj2(p) == res2 ) ? 1 : 0;
80 nb++;
81
83 trace.
info() <<
"p " << p <<
" => " << proj3(p) <<
" == " << res3 << std::endl;
84 nbok += ( proj3(p) == res3 ) ? 1 : 0;
85 nb++;
86 }
88
90 {
91
93
94
96 std::vector<Dimension> v1, v2, v4;
97 v1.push_back(0); v1.push_back(2); v1.push_back(1);
98 v2.push_back(1); v2.push_back(0);
99 v4.push_back(1);
100 Projector3D proj1, proj2, proj3;
101 proj1.init(v1.begin(), v1.end());
102 proj2.init(v2.begin(), v2.end());
103 Projector3D proj4(-1);
104 proj4.init(v4.begin(), v4.end());
105
106
109
117
118 trace.
info() <<
"pt " << pt <<
" => " << sliceRot(pt) <<
" == " << ptR << std::endl;
119 nbok += ( sliceRot(pt) == ptR ) ? 1 : 0;
120 nb++;
121
122 trace.
info() <<
"pt " << pt_2 <<
" => " << sliceRot2(pt_2) <<
" == " << ptR2 << std::endl;
123 nbok += ( sliceRot2(pt_2) == ptR2 ) ? 1 : 0;
124 nb++;
125
126
129 ptOrigin3D,
137 nb++;
138
141 nb++;
142
143
146 pt2Origin3D,
148 4);
153 nb++;
154
157 nb++;
158
159
163 pt2Origin3D,
165 dirXaxis, 4);
170 nb++;
171
174 nb++;
175
176
180 nb++;
181
182
184 trace.
info() <<
"p " << p <<
" => " << proj1(p) <<
" == " << res1 << std::endl;
185 nbok += ( proj1(p) == res1 ) ? 1 : 0;
186 nb++;
187
189 trace.
info() <<
"p " << p <<
" => " << proj2(p) <<
" == " << res2 << std::endl;
190 nbok += ( proj2(p) == res2 ) ? 1 : 0;
191 nb++;
192
194 trace.
info() <<
"p " << p <<
" => " << proj3(p) <<
" == " << res3 << std::endl;
195 nbok += ( proj3(p) == res3 ) ? 1 : 0;
196 nb++;
197
199 trace.
info() <<
"p " << p <<
" => " << proj4(p) <<
" == " << res4
200 << "(-1 as default value)" << std::endl;
201 nbok += ( proj4(p) == res4 ) ? 1 : 0;
202 nb++;
203 }
205
206
208 {
209
211 std::vector< SpaceND<2, int>::Size > aGridSize;
212 aGridSize.push_back(5);
213 aGridSize.push_back(5);
216 aGridSize,
217 shiftVector);
218 trace.
info()<<
"Subsampling functor on 2D domain " << domainSource <<
" with grid size "
219 << aGridSize[0] << " " << aGridSize[1] << " and shift vector "<< shiftVector <<std::endl ;
222 trace.
info() <<
"Sampling point of coordinate "<< pointTest <<
", => coordinates in source domain:"
224 nb++;
226
227
229 std::vector< SpaceND<3, int>::Size > aGridSize3D;
230 aGridSize3D.push_back(5);
231 aGridSize3D.push_back(3);
232 aGridSize3D.push_back(1);
235 aGridSize3D, shiftVector3D);
236 trace.
info()<<
"Subsampling functor on 3D domain " << domainSource3D <<
" with grid size "
237 << aGridSize3D[0] << " " << aGridSize3D[1]<< " " << aGridSize3D[2] << " and shift vector "<< shiftVector3D <<std::endl ;
242 trace.
info() <<
"Sampling point of coordinate "<< pointTest3D <<
", => coordinates in source domain:"
244 trace.
info() <<
"Sampling point of coordinate "<< pointTest3D2 <<
", => coordinates in source domain:"
246 nb++;
249
250
251 std::vector<HyperRectDomain<SpaceND<3, int> >
::Dimension> vectFlip;
252 vectFlip.push_back(1);
253 vectFlip.push_back(2);
255 trace.
info() <<
"Flip point of coordinate "<< pointTest3D <<
", => fliped coordinates with axis 1 and 2:"
256 << flipFunctorAxis12(pointTest3D) <<
" == " <<
PointVector<3,int>(0, 9, 8) << std::endl;
257 nb++;
259
260
261
262
263 std::vector< double > aGridSizeReSample;
264 aGridSizeReSample.push_back(0.25);
265 aGridSizeReSample.push_back(0.5);
268 aGridSizeReSample, shiftVector);
269
270 trace.
info()<<
"Resampling functor on 2D domain " << domainSource <<
" with grid size "
271 << aGridSizeReSample[0] << " " << aGridSizeReSample[1] << " and shift vector "<< shiftVector <<std::endl ;
274 trace.
info() <<
"Sampling point of coordinate "<< pointTestRS <<
", => coordinates in source domain:"
276 nb++;
278
279
280
281 }
282 return nbok == nb;
283}
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Aim: Functor that subsamples an initial domain by given a grid size and a shift vector....
Aim: Functor that flips the domain coordinate system from some selected axis. For instance,...
Aim: Functor that embeds a 2D point into a 3D space from two axis vectors and an origin point given i...
Special Point Functor that adds one dimension to a 2D point and apply on it a rotation of angle alpha...
DGtal::uint32_t Dimension
boost::int32_t int32_t
signed 32-bit integer.
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an ...
void init(const TIterator &itb, const TIterator &ite)