122int main(
int argc,
char** argv )
126 unsigned int nbok = 0;
128 QApplication application(argc,argv);
130 unsigned int diameter = argc > 1 ? atoi( argv[ 1 ] ) : 10;
131 int a = argc > 2 ? atoi( argv[ 2 ] ) : 2;
132 int b = argc > 3 ? atoi( argv[ 3 ] ) : 3;
133 int c = argc > 4 ? atoi( argv[ 4 ] ) : 5;
134 int mu = argc > 5 ? atoi( argv[ 5 ] ) : 0;
137 << mu <<
" <= " << a <<
" * x + "
138 << b <<
" * y + " << c <<
" * z < "
139 << (mu+abs(a)+abs(b)+abs(c)) << std::endl;
140 Domain domain1(
Point( -diameter, -diameter, -diameter ),
141 Point( diameter, diameter, diameter ) );
144 typedef PlaneComputer::Primitive Primitive;
146 plane.
init( 2*diameter, 1, 1 );
150 ++nb, nbok += plane.extend( recognized.begin(), recognized.end() ) ? 1 : 0;
152 <<
") All points are recognized." << std::endl;
155 Primitive strip = plane.primitive();
157 <<
" axis=" << strip.mainAxis()
158 <<
" axiswidth=" << strip.axisWidth()
159 <<
" diag=" << strip.mainDiagonal()
160 <<
" diagwidth=" << strip.diagonalWidth()
162 ++nb, nbok += ( strip.diagonalWidth() < sqrt(3.0) ) ? 1 : 0;
164 <<
") Diagonal width < sqrt(3)." << std::endl;
165 trace.
emphase() << ( (nb == nbok) ?
"Passed." :
"Error." ) << endl;
171 Color red( 255, 0, 0 );
172 Color green( 0, 255, 0 );
173 Color grey( 200, 200, 200 );
174 Domain domain2(
Point( -2*diameter, -2*diameter, -2*diameter ),
175 Point( 2*diameter, 2*diameter, 2*diameter ) );
177 for ( std::vector<Point>::const_iterator it = recognized.begin(),
178 itE = recognized.end(); it != itE; ++it )
179 if ( ! strip( *it ) ) viewer << *it;
185 trace.
info() <<
"- Points in green have been recognized as belonging to this standard plane." << std::endl;
186 trace.
info() <<
"- Points in grey belongs also to the parallel strip of the recognized standard plane." << std::endl;
187 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;
189 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)