33 #include "DGtal/base/Common.h" 34 #include "DGtal/helpers/StdDefs.h" 37 #include "DGtal/shapes/EuclideanShapesDecorator.h" 40 #include "DGtal/shapes/implicit/ImplicitBall.h" 44 using namespace DGtal;
52 unsigned int nbok = 0;
58 typedef ShapeA::RealPoint RealPoint;
65 CSG s_union ( shapeA );
66 s_union.plus( shapeB );
68 CSG s_intersec ( shapeA );
69 s_intersec.plus( shapeB );
70 s_intersec.intersection( shapeC );
72 CSG s_minus ( shapeA );
73 s_minus.minus( shapeC );
76 nbok += (( s_union.orientation( RealPoint( -5.1, 0.0 )) ==
INSIDE )
77 || ( s_union.orientation( RealPoint( -5.1, 0.0 )) ==
ON ))? 0 : 1;
78 nbok += (( s_union.orientation( RealPoint( 0.0, 0.0 )) ==
INSIDE )
79 || ( s_union.orientation( RealPoint( 0.0, 0.0 )) ==
ON ))? 1 : 0;
80 nbok += (( s_union.orientation( RealPoint( 4.6, 0.0 )) ==
INSIDE )
81 || ( s_union.orientation( RealPoint( 4.6, 0.0 )) ==
ON ))? 0 : 1;
82 nbok += (( s_union.orientation( RealPoint( 4.5, 0.0 )) ==
INSIDE )
83 || ( s_union.orientation( RealPoint( 4.5, 0.0 )) ==
ON ))? 1 : 0;
84 nbok += (( s_union.orientation( RealPoint( -5.0, 0.0 )) ==
INSIDE )
85 || ( s_union.orientation( RealPoint( -5.0, 0.0 )) ==
ON ))? 1 : 0;
88 nbok += (( s_intersec.orientation( RealPoint( -2.6, 0.0 )) ==
INSIDE )
89 || ( s_intersec.orientation( RealPoint( -2.6, 0.0 )) ==
ON ))? 0 : 1;
90 nbok += (( s_intersec.orientation( RealPoint( 2.5, 0.0 )) ==
INSIDE )
91 || ( s_intersec.orientation( RealPoint( 2.5, 0.0 )) ==
ON ))? 1 : 0;
92 nbok += (( s_intersec.orientation( RealPoint( 2.6, 0.0 )) ==
INSIDE )
93 || ( s_intersec.orientation( RealPoint( 2.6, 0.0 )) ==
ON ))? 0 : 1;
94 nbok += (( s_intersec.orientation( RealPoint( 0.0, 2.5 )) ==
INSIDE )
95 || ( s_intersec.orientation( RealPoint( 0.0, 2.5 )) ==
ON ))? 0 : 1;
98 nbok += (( s_minus.orientation( RealPoint( -5.0, 0.0 )) ==
INSIDE )
99 || ( s_minus.orientation( RealPoint( -5.0, 0.0 )) ==
ON ))? 1 : 0;
100 nbok += (( s_minus.orientation( RealPoint( -1.0, 0.0 )) ==
INSIDE )
101 || ( s_minus.orientation( RealPoint( -1.0, 0.0 )) ==
ON ))? 0 : 1;
102 nbok += (( s_minus.orientation( RealPoint( 0.0, 2.0 )) ==
INSIDE )
103 || ( s_minus.orientation( RealPoint( 0.0, 2.0 )) ==
ON ))? 0 : 1;
104 nbok += (( s_minus.orientation( RealPoint( -2.6, 0.0 )) ==
INSIDE )
105 || ( s_minus.orientation( RealPoint( -2.6, 0.0 )) ==
ON ))? 1 : 0;
111 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " 112 <<
"true == true" << std::endl;
120 int main(
int argc,
char** argv )
124 for (
int i = 0; i < argc; ++i )
129 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << std::endl;
void beginBlock(const std::string &keyword="")
bool testEuclideanShapesDecorator()
Aim: Implements basic operations that will be used in Point and Vector classes.
Aim: Constructive Solid Geometry (CSG) between models of CEuclideanBoundedShape and CEuclideanOriente...
int main(int argc, char **argv)
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD...
DGtal is the top-level namespace which contains all DGtal functions and types.