92 if (leng1 <= delta || leng2 <= delta || leng3 <= delta)
112 message <<
"Facet is too small or too narrow." <<
G4endl
117 <<
"Side1 length (P0->P1) = " << leng1 <<
G4endl
118 <<
"Side2 length (P1->P2) = " << leng2 <<
G4endl
119 <<
"Side3 length (P2->P0) = " << leng3;
120 G4Exception(
"G4TriangularFacet::G4TriangularFacet()",
147 fVertices =
new vector<G4ThreeVector>(3);
173 char *
p = (
char *) &rhs;
174 copy(p, p +
sizeof(*
this), (
char *)
this);
178 fVertices =
new vector<G4ThreeVector>(3);
192 fA = move(rhs.
fA);
fB = move(rhs.
fB);
fC = move(rhs.
fC);
367 if (numer >= denom) {q = 1.0; t = 0.0;
fSqrDist =
fA + 2.0*d +
f;}
378 if (tmp1 <= 0.0) {t = 1.0;
fSqrDist =
fC + 2.0*e +
f;}
379 else if (e >= 0.0) {t = 0.0;
fSqrDist =
f;}
394 if (numer >= denom) {t = 1.0; q = 0.0;
fSqrDist = fC + 2.0*e +
f;}
405 if (tmp1 <= 0.0) {q = 1.0;
fSqrDist =
fA + 2.0*d +
f;}
406 else if (d >= 0.0) {q = 0.0;
fSqrDist =
f;}
425 if (numer >= denom) {q = 1.0; t = 0.0;
fSqrDist =
fA + 2.0*d +
f;}
528 G4bool wrongSide = (dir > 0.0 && !outgoing) || (dir < 0.0 && outgoing);
535 if (wrongSide) dist = 0.0;
538 else if (!wrongSide) dist = dist1;
554 if (sp > ss) ss =
sp;
556 if (sp > ss) ss =
sp;
627 wrongSide = (outgoing && distFromSurface < 0.0)
628 || (!outgoing && distFromSurface > 0.0);
684 vprime, P0prime, E0prime, E1prime, loc))
692 G4double s0 = (loc[0] - pprime).mag()/vprimemag;
693 G4double s1 = (loc[1] - pprime).mag()/vprimemag;
697 if ((normDist0 < 0.0 && normDist1 < 0.0)
698 || (normDist0 > 0.0 && normDist1 > 0.0)
699 || (normDist0 == 0.0 && normDist1 == 0.0) )
708 G4double dnormDist = normDist1 - normDist0;
713 if (!outgoing) distFromSurface = -distFromSurface;
718 distance = s0 - normDist0*(s1-
s0)/dnormDist;
720 if (!outgoing) distFromSurface = -distFromSurface;
740 distance = distFromSurface /
w;
753 if (ss < -sTolerance || t < -tTolerance || ( ss+t -
fDet ) > detTolerance)
768 if (!outgoing) distFromSurface = -distFromSurface;
783 if (u+v > 1.) { u = 1. -
u; v = 1. -
v; }
802 return "G4TriangularFacet";