52 : aMin(0.), aMax(0.), bMin(0.), bMax(0.),
68 : aMin(0.), aMax(0.), bMin(0.), bMax(0.),
83 for( i=0; i < n; i++, rOut++, zOut++, rIn--, zIn-- )
107 G4Exception(
"G4ReduciblePolygon::Create()",
"GeomSolids0002",
110 const G4double *anext = a, *bnext = b;
115 newVertex->
a = *anext;
116 newVertex->
b = *bnext;
124 prev->
next = newVertex;
128 }
while( ++anext, ++bnext < b+n );
141 : aMin(0.), aMax(0.), bMin(0.), bMax(0.), numVertices(0), vertexHead(0)
222 *prev = 0, *next = 0;
228 if (std::fabs(curr->
a-next->a) < tolerance &&
229 std::fabs(curr->
b-next->b) < tolerance )
249 if (prev) prev->next = curr;
else vertexHead = curr;
280 G4double tolerance2 = tolerance*tolerance;
292 db = next->b - curr->
b;
308 if (test==curr)
break;
314 dbt = test->
b - curr->
b;
316 if (std::fabs(dat*db-dbt*da)>tolerance2)
break;
340 if ((curr != next) && (next != test))
delete next;
400 if (save == 0)
break;
425 G4double tolerance2 = tolerance*tolerance;
437 db1 = next1->b-curr1->
b;
448 db2 = next2->
b-curr2->
b;
450 b12 = curr2->
b-curr1->
b;
456 if (std::fabs(deter) > tolerance2)
459 s1 = (a12*db2-b12*da2)/deter;
461 if (s1 >= zero && s1 < one)
463 s2 = -(da1*b12-db1*a12)/deter;
464 if (s2 >= zero && s2 < one)
return true;
485 G4int nNeg = 0, nPos = 0;
488 G4double len12 = std::sqrt( a12*a12 + b12*b12 );
489 a12 /= len12; b12 /= len12;
499 if (cross < -tolerance)
501 if (nPos)
return true;
504 else if (cross > tolerance)
506 if (nNeg)
return true;
536 answer += curr->
a*next->b - curr->
b*next->a;
574 else if (curr->
a >
aMax)
579 else if (curr->
b >
bMax)
G4DLLIMPORT std::ostream G4cerr
G4ReduciblePolygon(const G4double a[], const G4double b[], G4int n)
G4bool BisectedBy(G4double a1, G4double b1, G4double a2, G4double b2, G4double tolerance)
void Create(const G4double a[], const G4double b[], G4int n)
void ScaleB(G4double scale)
void CopyVertices(G4double a[], G4double b[]) const
virtual ~G4ReduciblePolygon()
G4bool RemoveDuplicateVertices(G4double tolerance)
G4bool RemoveRedundantVertices(G4double tolerance)
G4bool CrossesItself(G4double tolerance)
void ScaleA(G4double scale)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)