42 G4Point3D(+kInfinity, +kInfinity, +kInfinity) );
68 : box_min(right.box_min), box_max(right.box_max),
69 distance(right.distance), test_result(right.test_result),
70 MiddlePoint(right.MiddlePoint), GeantBox(right.GeantBox),
71 kCarTolerance(right.kCarTolerance)
77 if (&right ==
this)
return *
this;
78 box_min = right.box_min;
79 box_max = right.box_max;
80 distance = right.distance;
81 test_result = right.test_result;
82 MiddlePoint = right.MiddlePoint;
83 GeantBox = right.GeantBox;
84 kCarTolerance = right.kCarTolerance;
97 box_min.
setX( std::min(p1.
x(), p2.
x()) - kCarTolerance );
98 box_min.
setY( std::min(p1.
y(), p2.
y()) - kCarTolerance );
99 box_min.
setZ( std::min(p1.
z(), p2.
z()) - kCarTolerance );
100 box_max.
setX( std::max(p1.
x(), p2.
x()) + kCarTolerance );
101 box_max.
setY( std::max(p1.
y(), p2.
y()) + kCarTolerance );
102 box_max.
setZ( std::max(p1.
z(), p2.
z()) + kCarTolerance );
105 GeantBox = (box_max - box_min)*0.5;
106 MiddlePoint = (box_min + box_max)*0.5;
115 box_min= box_max= MiddlePoint=
p;
132 if (p.
x() < box_min.
x())
133 box_min.
setX( p.
x() - kCarTolerance );
134 else if (p.
x() > box_max.
x())
135 box_max.
setX( p.
x() + kCarTolerance );
137 if (p.
y() < box_min.
y())
138 box_min.
setY( p.
y() - kCarTolerance );
139 else if (p.
y() > box_max.
y())
140 box_max.
setY( p.
y() + kCarTolerance );
142 if (p.
z() < box_min.
z())
143 box_min.
setZ( p.
z() - kCarTolerance );
144 else if (p.
z() > box_max.
z())
145 box_max.
setZ( p.
z() + kCarTolerance );
149 GeantBox = (box_max - box_min)*0.5;
150 MiddlePoint = (box_min + box_max)*0.5;
166 rayx = ray_start.
x();
167 rayy = ray_start.
y();
168 rayz = ray_start.
z();
171 if((rayx < box_min.
x()) || (rayx > box_max.
x()) ||
172 (rayy < box_min.
y()) || (rayy > box_max.
y()) ||
173 (rayz < box_min.
z()) || (rayz > box_max.
z()) )
180 distance = DistanceToIn(ray_start2, ray_dir);
220 safx=std::fabs(p.
x())-fdx;
221 safy=std::fabs(p.
y())-fdy;
222 safz=std::fabs(p.
z())-fdz;
229 if ( ( (p.
x()*v.
x()>=0.0 ) && safx>0.0 ) ||
230 ( (p.
y()*v.
y()>=0.0 ) && safy>0.0 ) ||
231 ( (p.
z()*v.
z()>=0.0 ) && safz>0.0 ) )
263 G4double safx, safy, safz, snxt = 0;
274 safx = std::fabs(p.
x())-fdx;
275 safy = std::fabs(p.
y())-fdy;
276 safz = std::fabs(p.
z())-fdz;
283 if ( ( ( p.
x()*v.
x()>=0.0 ) && safx>0.0) ||
284 ( ( p.
y()*v.
y()>=0.0 ) && safy>0.0) ||
285 ( ( p.
z()*v.
z()>=0.0 ) && safz>0.0) )
294 smaxx = fdx/std::fabs(v.
x()) - p.
x()/v.
x();
305 stmp = std::fabs(v.
x());
307 smaxx = (fdx+std::fabs(p.
x()))/stmp;
316 smaxy = fdy/std::fabs(v.
y()) - p.
y()/v.
y();
327 stmp = std::fabs(v.
y());
329 smaxy = (fdy+std::fabs(p.
y()))/stmp;
338 smaxz = fdz/std::fabs(v.
z()) - p.
z()/v.
z();
349 stmp = std::fabs(v.
z());
351 smaxz = (fdz+std::fabs(p.
z()))/stmp;
375 if ((smin>0.) && (smin<=
smax)) { snxt=smin; }
385 if( ( Pt.
x() >= box_min.
x() && Pt.
x() <= box_max.
x() ) &&
386 ( Pt.
y() >= box_min.
y() && Pt.
y() <= box_max.
y() ) &&
387 ( Pt.
z() >= box_min.
z() && Pt.
z() <= box_max.
z() ) )