48 vertices.push_back( vertex );
69 return (!vertices.empty());
77 const EAxis IgnoreMe )
86 return (!vertices.empty());
98 std::size_t noLeft = vertices.size();
103 if (noLeft == 0) {
return false; }
108 min = max = vertices[0].operator()(
axis );
113 for( std::size_t i=1; i<noLeft; ++i )
116 if (component < min )
120 else if (component > max )
136 std::size_t noLeft = vertices.size();
146 for( std::size_t i=1; i<noLeft; ++i )
151 answer = &(vertices[i]);
166 std::size_t noLeft = vertices.size();
176 for( std::size_t i=1; i<noLeft; ++i )
181 answer = &(vertices[i]);
210 std::size_t noLeft = vertices.size();
211 if (noLeft==0) {
return false; }
213 if (other.
Empty()) {
return true; }
219 const G4double minOther = minPointOther->operator()(
axis);
230 if (min < minOther-kCarTolerance) {
return true; }
232 if (minOther < min-kCarTolerance) {
return false; }
244 if (std::fabs(normalOther(
axis)) > std::fabs(normal(
axis)))
249 answer = (normalOther(
axis) > 0) ? (minP < -kCarTolerance)
250 : (maxP > +kCarTolerance);
257 answer = (normal(
axis) > 0) ? (maxP > +kCarTolerance)
258 : (minP < -kCarTolerance);
274 std::size_t noLeft = vertices.size();
275 if (noLeft==0) {
return false; }
277 if (other.
Empty()) {
return true; }
283 const G4double maxOther = maxPointOther->operator()(
axis);
294 if (max > maxOther+kCarTolerance) {
return true; }
296 if (maxOther > max+kCarTolerance) {
return false; }
308 if (std::fabs(normalOther(
axis)) > std::fabs(normal(
axis)))
313 answer = (normalOther(
axis) > 0) ? (maxP > +kCarTolerance)
314 : (minP < -kCarTolerance);
321 answer = (normal(
axis) > 0) ? (minP < -kCarTolerance)
322 : (maxP > +kCarTolerance);
339 std::size_t noLeft = vertices.size();
344 if (noLeft == 0) {
return false; }
349 min = max = planeNormal.
dot(vertices[0]-pointOnPlane);
354 for( std::size_t i=1; i<noLeft; ++i )
356 G4double component = planeNormal.
dot(vertices[i] - pointOnPlane);
357 if (component < min )
361 else if (component > max )
379 G4ThreeVectorList tempPolygon;
387 ClipToSimpleLimits( vertices, tempPolygon, simpleLimit1 );
393 if (tempPolygon.empty())
405 ClipToSimpleLimits( tempPolygon, vertices, simpleLimit2 );
410 if (vertices.empty()) {
return; }
422 std::size_t noVertices = pPolygon.size();
425 outputPolygon.clear();
427 for (std::size_t i=0; i<noVertices; ++i)
439 if (pVoxelLimit.
Inside(vStart))
441 if (pVoxelLimit.
Inside(vEnd))
445 outputPolygon.push_back(vEnd);
452 outputPolygon.push_back(vEnd);
457 if (pVoxelLimit.
Inside(vEnd))
462 outputPolygon.push_back(vStart);
463 outputPolygon.push_back(vEnd);
std::vector< G4ThreeVector > G4ThreeVectorList
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
double dot(const Hep3Vector &) const
G4bool GetPlanerExtent(const G4ThreeVector &pointOnPlane, const G4ThreeVector &planeNormal, G4double &min, G4double &max) const
G4bool Clip(const G4VoxelLimits &voxelLimit)
G4bool PartialClip(const G4VoxelLimits &voxelLimit, const EAxis IgnoreMe)
void AddVertexInOrder(const G4ThreeVector &vertex)
const G4ThreeVector * GetMinPoint(const EAxis axis) const
G4bool GetExtent(const EAxis axis, G4double &min, G4double &max) const
void ClipAlongOneAxis(const G4VoxelLimits &voxelLimit, const EAxis axis)
G4bool InFrontOf(const G4ClippablePolygon &other, EAxis axis) const
G4bool BehindOf(const G4ClippablePolygon &other, EAxis axis) const
const G4ThreeVector GetNormal() const
const G4ThreeVector * GetMaxPoint(const EAxis axis) const
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
G4VoxelLimits represents limitation/restrictions of space, where restrictions are only made perpendic...
G4double GetMinExtent(const EAxis pAxis) const
G4bool ClipToLimits(G4ThreeVector &pStart, G4ThreeVector &pEnd) const
void AddLimit(const EAxis pAxis, const G4double pMin, const G4double pMax)
G4double GetMaxExtent(const EAxis pAxis) const
G4bool Inside(const G4ThreeVector &pVec) const
const axis_t axis_to_type< N >::axis