83 const EAxis IgnoreMe )
104 std::size_t noLeft =
vertices.size();
109 if (noLeft == 0)
return false;
114 min = max =
vertices[0].operator()( axis );
119 for( std::size_t i=1; i<noLeft; ++i )
122 if (component < min )
124 else if (component > max )
138 std::size_t noLeft =
vertices.size();
146 G4double min = answer->operator()(axis);
148 for( std::size_t i=1; i<noLeft; ++i )
168 std::size_t noLeft =
vertices.size();
176 G4double max = answer->operator()(axis);
178 for( std::size_t i=1; i<noLeft; ++i )
212 std::size_t noLeft =
vertices.size();
213 if (noLeft==0)
return false;
215 if (other.
Empty())
return true;
221 const G4double minOther = minPointOther->operator()(axis);
227 const G4double min = minPoint->operator()(axis);
246 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
276 std::size_t noLeft =
vertices.size();
277 if (noLeft==0)
return false;
279 if (other.
Empty())
return true;
285 const G4double maxOther = maxPointOther->operator()(axis);
291 const G4double max = maxPoint->operator()(axis);
310 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
341 std::size_t noLeft =
vertices.size();
346 if (noLeft == 0)
return false;
351 min = max = planeNormal.
dot(
vertices[0]-pointOnPlane);
356 for( std::size_t i=1; i<noLeft; ++i )
359 if (component < min )
361 else if (component > max )
377 G4ThreeVectorList tempPolygon;
391 if (tempPolygon.size() == 0)
417 G4ThreeVectorList& outputPolygon,
420 std::size_t noVertices = pPolygon.size();
423 outputPolygon.clear();
425 for (std::size_t i=0; i<noVertices; ++i)
437 if (pVoxelLimit.
Inside(vStart))
439 if (pVoxelLimit.
Inside(vEnd))
443 outputPolygon.push_back(vEnd);
450 outputPolygon.push_back(vEnd);
455 if (pVoxelLimit.
Inside(vEnd))
460 outputPolygon.push_back(vStart);
461 outputPolygon.push_back(vEnd);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
double dot(const Hep3Vector &) const
virtual G4bool GetPlanerExtent(const G4ThreeVector &pointOnPlane, const G4ThreeVector &planeNormal, G4double &min, G4double &max) const
virtual G4bool Clip(const G4VoxelLimits &voxelLimit)
virtual G4bool PartialClip(const G4VoxelLimits &voxelLimit, const EAxis IgnoreMe)
G4ThreeVectorList vertices
void ClipToSimpleLimits(G4ThreeVectorList &pPolygon, G4ThreeVectorList &outputPolygon, const G4VoxelLimits &pVoxelLimit)
virtual const G4ThreeVector * GetMinPoint(const EAxis axis) const
virtual ~G4ClippablePolygon()
virtual void AddVertexInOrder(const G4ThreeVector vertex)
virtual G4bool GetExtent(const EAxis axis, G4double &min, G4double &max) const
virtual void ClearAllVertices()
virtual void ClipAlongOneAxis(const G4VoxelLimits &voxelLimit, const EAxis axis)
virtual G4bool InFrontOf(const G4ClippablePolygon &other, EAxis axis) const
virtual G4bool BehindOf(const G4ClippablePolygon &other, EAxis axis) const
const G4ThreeVector GetNormal() const
virtual const G4ThreeVector * GetMaxPoint(const EAxis axis) const
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
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