70 unsigned int nbok = 0;
75 typedef Z3::Point
Point;
93 Point p1( -50, -50, -50 );
94 Point p2( 50, 50, 50 );
99 Adj6 adj6(
domain, madj6 );
100 Adj18 adj18(
domain, madj18 );
107 double radius = (double) (r+1);
112 sstr <<
"Creating 3D ball( r < " << radius <<
" ) ...";
113 trace.beginBlock ( sstr.str() );
114 for ( DomainConstIterator it =
domain.begin();
118 if ( (*it - c ).norm() < radius )
124 trace.beginBlock (
"Testing Object instanciation and smart copy ..." );
125 ObjectType ball( dt6_18, ball_set );
126 ObjectType ball2( ball );
128 trace.info() <<
"ball.size() = " << ball.size()
129 <<
" 4/3*pi*r^3 = " << ( 4.0*M_PI*radius*radius*radius/3.0 )
131 trace.info() <<
"ball = " << ball << endl;
132 trace.info() <<
"ball2 = " << ball2 << endl;
135 trace.beginBlock (
"Testing border extraction ..." );
136 ObjectType sphere = ball.border();
138 trace.info() << sphere << endl;
139 trace.info() <<
"sphere.size() = " << sphere.size()
140 <<
" 4*pi*r^2 = " << ( 4.0*M_PI*radius*radius )
144 trace.beginBlock (
"Testing expansion by layers in the ball from center..." );
145 ObjectExpander expander( ball, c );
146 while ( ! expander.finished() )
148 trace.info() << expander << std::endl;
149 expander.nextLayer();
151 nbok += expander.distance() <= sqrt(3.0)*radius ? 1 : 0;
153 trace.info() <<
"(" << nbok <<
"/" << nb <<
") "
154 <<
"expander.distance() = " << expander.distance()
155 <<
" <= " << sqrt(3.0)*radius << std::endl;
158 trace.beginBlock (
"Testing expansion by layers on the sphere from a point ..." );
159 ObjectExpander expander2( sphere, l );
160 while ( ! expander2.finished() )
162 trace.info() << expander2 << std::endl;
163 expander2.nextLayer();
165 nbok += expander2.distance() <= sqrt(2.0)*M_PI*radius ? 1 : 0;
167 trace.info() <<
"(" << nbok <<
"/" << nb <<
") "
168 <<
"expander2.distance() = " << expander2.distance()
169 <<
" <= " << sqrt(2.0)*M_PI*radius << std::endl;
Aim: Given a domain and an adjacency, limits the given adjacency to the specified domain for all adja...
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.