94 FindSomePoints( logger,
true );
95 FindSomePoints( logger,
false );
97 PatchInconsistencies( logger );
109 if (points.size() == 0)
return;
114 std::sort( points.begin(), points.end() );
119 std::vector<G4GeomTestPoint>::iterator curr = points.begin();
122 std::vector<G4GeomTestPoint>::iterator next = curr + 1;
127 while (next != points.end() &&
128 next->GetDistance()-curr->GetDistance() < kCarTolerance) {
132 if (next->Entering() != curr->Entering()) {
142 next = points.erase(next);
147 if (curr == points.end())
break;
153 if (!curr->Entering()) {
176 if (curr != points.begin()) {
177 std::vector<G4GeomTestPoint>::iterator prev = curr - 1;
179 ds = prev->GetDistance();
182 p1 = p + 10*kCarTolerance*v;
198 logger->
SolidProblem( solid,
"Spurious exiting intersection point", p );
199 curr = points.erase(curr);
207 if (next == points.end() || next->Entering() ) {
224 if (next != points.end()) {
228 ds = next->GetDistance();
230 p1 = p - 10*kCarTolerance*v;
244 logger->
SolidProblem( solid,
"Spurious entering intersection point", p );
245 curr = points.erase(curr);
248 if(curr!=points.end()){curr = next + 1;}
250 }
while( curr != points.end() );
257 "Solid has odd number of intersection points", p0 );
281 switch(solid->
Inside(p)) {
284 if (dist >= kInfinity) {
286 "DistanceToOut(p,v) = kInfinity for point inside", p );
294 if (dist >= kInfinity)
return;
300 if(std::fabs(vSurfN)<kCarTolerance)vSurfN=0;
301 entering = (vSurfN < 0);
305 "Inside returns illegal enumerated value", p );
344 "Push fails to fix geometry inconsistency", p );
364 if (dist >= kInfinity) {
366 "DistanceToOut(p,v) = kInfinity for point inside", p );
370 if ( (dist > kCarTolerance)
377 "Entering point is outside (possible roundoff error)",p);
380 "DistanceToOut(p,v) brings trajectory well outside solid",p);
388 if (dist >= kInfinity)
return;
390 if ( (dist > kCarTolerance)
397 "Exiting point is inside (possible roundoff error)", p);
400 "DistanceToIn(p,v) brings trajectory well inside solid", p);
virtual void SolidProblem(const G4VSolid *solid, const G4String &message, const G4ThreeVector &point)=0
G4int GetNumberPoints() const
const G4ThreeVector & GetV() const
const G4VSolid * GetSolid() const
const G4ThreeVector & GetP() const
G4GeomTestSegment(const G4VSolid *theSolid, const G4ThreeVector &theP, const G4ThreeVector &theV, G4GeomTestLogger *logger)
const G4GeomTestPoint & GetPoint(G4int i) const
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0