32#include "DGtal/base/Common.h"
33#include "DGtal/kernel/PointVector.h"
35#include "DGtal/geometry/tools/determinant/Simple2x2DetComputer.h"
36#include "DGtal/geometry/tools/determinant/AvnaimEtAl2x2DetSignComputer.h"
38#include "DGtal/geometry/tools/determinant/COrientationFunctor2.h"
39#include "DGtal/geometry/tools/determinant/InHalfPlaneBy2x2DetComputer.h"
40#include "DGtal/geometry/tools/determinant/InHalfPlaneBySimple3x3Matrix.h"
42#include "DGtal/geometry/tools/determinant/InGeneralizedDiskOfGivenRadius.h"
56template<
typename OrientationFunctor>
61 unsigned int nbok = 0;
67 typedef typename OrientationFunctor::Value
Value;
68 typedef typename OrientationFunctor::Point
Point;
77 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
82 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
87 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
99 unsigned int nbok = 0;
113 trace.
info() << f_inf <<
" " << f_inf.isValid() << endl;
116 res = f_inf(
Point(7,3) );
117 trace.
info() << res <<
" > 0 " << std::endl;
121 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
124 res = f_inf(
Point(8,3) );
125 trace.
info() << res <<
" < 0 " << std::endl;
129 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
132 res = f_inf(
Point(10,4) );
133 trace.
info() << res <<
" == 0 " << std::endl;
137 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
139 Functor f_inf2(
false);
140 trace.
info() << f_inf2 <<
" " << f_inf2.isValid() << endl;
143 res = f_inf2(
Point(7,3) );
144 trace.
info() << res <<
" < 0 " << std::endl;
148 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
151 res = f_inf2(
Point(8,3) );
152 trace.
info() << res <<
" > 0 " << std::endl;
156 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
159 res = f_inf2(
Point(10,4) );
160 trace.
info() << res <<
" == 0 " << std::endl;
164 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
170 Functor f5(
true, 25, 1);
171 trace.
info() << f5 <<
" " << f5.isValid() << endl;
174 res = f5(
Point(-4,1) );
175 trace.
info() << res <<
" > 0 " << std::endl;
179 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
181 res = f5(
Point(-5,1) );
182 trace.
info() << res <<
" < 0 " << std::endl;
186 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
188 res = f5(
Point(-3,4) );
189 trace.
info() << res <<
" == 0 " << std::endl;
193 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
195 res = f5(
Point(-1,6) );
196 trace.
info() << res <<
" < 0 " << std::endl;
200 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
202 res = f5(
Point(-1,7) );
203 trace.
info() << res <<
" < 0 " << std::endl;
207 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
209 Functor f52(
false, 25, 1);
210 trace.
info() << f52 <<
" " << f52.isValid() << endl;
213 res = f52(
Point(4,1) );
214 trace.
info() << res <<
" < 0 " << std::endl;
218 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
220 res = f52(
Point(3,1) );
221 trace.
info() << res <<
" < 0 " << std::endl;
225 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
227 res = f52(
Point(5,1) );
228 trace.
info() << res <<
" > 0 " << std::endl;
232 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
234 res = f52(
Point(3,4) );
235 trace.
info() << res <<
" == 0 " << std::endl;
239 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
241 res = f52(
Point(4,3) );
242 trace.
info() << res <<
" == 0 " << std::endl;
246 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
248 res = f52(
Point(1,6) );
249 trace.
info() << res <<
" > 0 " << std::endl;
253 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
255 res = f52(
Point(1,7) );
256 trace.
info() << res <<
" > 0 " << std::endl;
260 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << endl;
269int main(
int argc,
char** argv )
273 for (
int i = 0; i < argc; ++i )
290 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: This class implements an orientation functor that provides a way to determine the position of ...
Aim: Class that implements an orientation functor, ie. it provides a way to compute the orientation o...
Aim: Class that implements an orientation functor, ie. it provides a way to compute the orientation o...
Aim: Implements basic operations that will be used in Point and Vector classes.
Aim: Small class useful to compute the determinant of a 2x2 matrix from its four coefficients,...
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: The traits class for all models of Cinteger.
Aim: This concept is a refinement of COrientationFunctor, useful for simple algebraic curves that can...
InHalfPlaneBySimple3x3Matrix< Point, double > Functor
bool testInGeneralizedDiskOfGivenRadius()
bool testInHalfPlane(OrientationFunctor f)