78int main(
int argc,
char** argv )
82 QApplication application(argc,argv);
85 unsigned int nbok = 0;
88 typedef PlaneComputer::Primitive Primitive;
91 plane.
init( 2, 1, 1 );
93 bool pt0_inside = plane.extend( pt0 );
94 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") Plane=" << plane
97 bool pt1_inside = plane.extend( pt1 );
98 ++nb; nbok += pt1_inside ==
true ? 1 : 0;
99 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") add " << pt1
100 <<
" Plane=" << plane << std::endl;
101 Point pt2( 2, 7, 1 );
102 bool pt2_inside = plane.extend( pt2 );
103 ++nb; nbok += pt2_inside ==
true ? 1 : 0;
104 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") add " << pt2
105 <<
" Plane=" << plane << std::endl;
107 Point pt3( 0, 5, 12 );
108 bool pt3_inside = plane.extend( pt3 );
109 ++nb; nbok += pt3_inside ==
false ? 1 : 0;
110 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") add " << pt3
111 <<
" Plane=" << plane << std::endl;
113 Point pt4( -5, -5, 10 );
114 bool pt4_inside = plane.extend( pt4 );
115 ++nb; nbok += pt4_inside ==
false ? 1 : 0;
116 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") add " << pt4
117 <<
" Plane=" << plane << std::endl;
119 Point pt5 = pt0 + pt1 + pt2 +
Point( 0, 0, 1 );
120 bool pt5_inside = plane.extend( pt5 );
121 ++nb; nbok += pt5_inside ==
true ? 1 : 0;
122 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") add " << pt5
123 <<
" Plane=" << plane << std::endl;
126 bool pt6_inside = plane.extend( pt6 );
127 ++nb; nbok += pt6_inside ==
true ? 1 : 0;
128 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") add " << pt5
129 <<
" Plane=" << plane << std::endl;
131 Primitive strip = plane.primitive();
133 <<
" axis=" << strip.mainAxis()
134 <<
" axiswidth=" << strip.axisWidth()
135 <<
" diag=" << strip.mainDiagonal()
136 <<
" diagwidth=" << strip.diagonalWidth()
138 ++nb; nbok += strip.axisWidth() < 1.0 ? 1 : 0;
139 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") axiswidth < 1 "
141 ++nb; nbok += strip.diagonalWidth() < sqrt(3.0) ? 1 : 0;
142 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") axiswidth < sqrt(3) "
145 trace.
emphase() << ( nbok == nb ?
"Passed." :
"Error." ) << endl;
151 Color red( 255, 0, 0 );
152 Color green( 0, 255, 0 );
153 Color grey( 200, 200, 200 );
168 return application.exec();
Iterator for HyperRectDomain.
const ConstIterator & begin() const
const ConstIterator & end() const