120int main(
int argc,
char** argv )
124 unsigned int nbok = 0;
126 QApplication application(argc,argv);
128 unsigned int diameter = argc > 1 ? atoi( argv[ 1 ] ) : 10;
129 int a = argc > 2 ? atoi( argv[ 2 ] ) : 2;
130 int b = argc > 3 ? atoi( argv[ 3 ] ) : 3;
131 int c = argc > 4 ? atoi( argv[ 4 ] ) : 5;
132 int mu = argc > 5 ? atoi( argv[ 5 ] ) : 0;
133 trace.
beginBlock (
"Testing class ChordGenericStandardPlaneComputer" );
135 << mu <<
" <= " << a <<
" * x + "
136 << b <<
" * y + " << c <<
" * z < "
137 << (mu+abs(a)+abs(b)+abs(c)) << std::endl;
138 Domain domain1(
Point( -diameter, -diameter, -diameter ),
139 Point( diameter, diameter, diameter ) );
143 typedef PlaneComputer::Primitive Primitive;
149 ++nb, nbok += plane.extend( recognized.begin(), recognized.end() ) ? 1 : 0;
151 <<
") All points are recognized." << std::endl;
154 Primitive strip = plane.primitive();
156 <<
" axis=" << strip.mainAxis()
157 <<
" axiswidth=" << strip.axisWidth()
158 <<
" diag=" << strip.mainDiagonal()
159 <<
" diagwidth=" << strip.diagonalWidth()
161 ++nb, nbok += ( strip.diagonalWidth() < sqrt(3.0) ) ? 1 : 0;
163 <<
") Diagonal width < sqrt(3)." << std::endl;
164 trace.
emphase() << ( (nb == nbok) ?
"Passed." :
"Error." ) << endl;
170 Color red( 255, 0, 0 );
171 Color green( 0, 255, 0 );
172 Color grey( 200, 200, 200 );
173 Domain domain2(
Point( -2*diameter, -2*diameter, -2*diameter ),
174 Point( 2*diameter, 2*diameter, 2*diameter ) );
176 for ( std::vector<Point>::const_iterator it = recognized.begin(),
177 itE = recognized.end(); it != itE; ++it )
178 if ( ! strip( *it ) ) viewer << *it;
184 trace.
info() <<
"- Points in green have been recognized as belonging to this standard plane." << std::endl;
185 trace.
info() <<
"- Points in grey belongs also to the parallel strip of the recognized standard plane." << std::endl;
186 trace.
info() <<
"- Points in red belongs to the parallel strip of the recognized standard plane but not to the input standard plane: NONE should be red." << std::endl;
188 return application.exec();
Iterator for HyperRectDomain.
const ConstIterator & begin() const
const ConstIterator & end() const
std::vector< typename Domain::Point > pointsInStandardPlane(const Domain &domain, typename Domain::Integer a, typename Domain::Integer b, typename Domain::Integer c, typename Domain::Integer mu)