30 BOITE_3D::BOITE_3D(
double xmin,
double ymin,
double zmin,
double xmax,
double ymax,
double zmax):x(xmin),y(ymin),z(zmin),dx(xmax-xmin),dy(ymax-ymin),dz(zmax-zmin)
32 bool recentrage=
false;
37 if (recentrage==
true)
x=
x-
dx/2.;
42 if (recentrage==
true)
y=
y-
dy/2.;
47 if (recentrage==
true)
z=
z-
dz/2.;
55 void BOITE_3D::reinit(
double xmin,
double ymin,
double zmin,
double xmax,
double ymax,
double zmax)
63 bool recentrage=
false;
68 if (recentrage==
true)
x=
x-
dx/2.;
73 if (recentrage==
true)
y=
y-
dy/2.;
78 if (recentrage==
true)
z=
z-
dz/2.;
183 reinit(centre[0]-
dx/2.,centre[1]-
dy/2.,centre[2]-
dz/2.,centre[0]+
dx/2.,centre[1]+
dy/2.,centre[2]+
dz/2.);
191 if (
x<(boite.
x+boite.
dx))
192 if (
y<(boite.
y+boite.
dy))
193 if (
z<(boite.
z+boite.
dz))
214 if (
x<(boite.
x+boite.
dx))
215 if (
y<(boite.
y+boite.
dy))
216 if (
z<(boite.
z+boite.
dz))
224 double xmin1=boite1.
x;
225 double ymin1=boite1.
y;
226 double zmin1=boite1.
z;
227 double xmin2=boite2.
x;
228 double ymin2=boite2.
y;
229 double zmin2=boite2.
z;
230 double xmax1=boite1.
x+boite1.
dx;
231 double ymax1=boite1.
y+boite1.
dy;
232 double zmax1=boite1.
z+boite1.
dz;
233 double xmax2=boite2.
x+boite2.
dx;
234 double ymax2=boite2.
y+boite2.
dy;
235 double zmax2=boite2.
z+boite2.
dz;
236 double xmin=std::max(xmin1,xmin2);
237 double ymin=std::max(ymin1,ymin2);
238 double zmin=std::max(zmin1,zmin2);
239 double xmax=std::min(xmax1,xmax2);
240 double ymax=std::min(ymax1,ymax2);
241 double zmax=std::min(zmax1,zmax2);
242 BOITE_3D tmp(xmin,ymin,zmin,xmax,ymax,zmax);
249 double xmin1=boite1.
x;
250 double ymin1=boite1.
y;
251 double zmin1=boite1.
z;
252 double xmin2=boite2.
x;
253 double ymin2=boite2.
y;
254 double zmin2=boite2.
z;
255 double xmax1=boite1.
x+boite1.
dx;
256 double ymax1=boite1.
y+boite1.
dy;
257 double zmax1=boite1.
z+boite1.
dz;
258 double xmax2=boite2.
x+boite2.
dx;
259 double ymax2=boite2.
y+boite2.
dy;
260 double zmax2=boite2.
z+boite2.
dz;
261 double xmin=std::min(xmin1,xmin2);
262 double ymin=std::min(ymin1,ymin2);
263 double zmin=std::min(zmin1,zmin2);
264 double xmax=std::max(xmax1,xmax2);
265 double ymax=std::max(ymax1,ymax2);
266 double zmax=std::max(zmax1,zmax2);
267 BOITE_3D tmp(xmin,ymin,zmin,xmax,ymax,zmax);