75 SetVertex(1, vt0 + vt1);
76 SetVertex(2, vt0 + vt2);
77 SetVertex(3, vt0 + vt3);
84 G4double length2 = (GetVertex(2)-GetVertex(1)).mag();
85 G4double length3 = (GetVertex(3)-GetVertex(2)).mag();
91 bool isDefined = (length1 > kCarTolerance && length2 > kCarTolerance &&
92 length3 > kCarTolerance && length4 > kCarTolerance &&
93 normal1.
dot(normal2) >= 0.9999999999);
106 + fFacet2.GetSurfaceNormal();
111 fFacet1.SetSurfaceNormal (normal);
112 fFacet2.SetSurfaceNormal (normal);
115 fCircumcentre = GetVertex(0) + vtmp;
117 fRadius = std::sqrt(radiusSqr);
121 G4Exception(
"G4QuadrangularFacet::G4QuadrangularFacet()",
123 "Length of sides of facet are too small or sides not planar.");
149 fFacet1 = rhs.fFacet1;
150 fFacet2 = rhs.fFacet2;
162 fFacet1 = rhs.fFacet1;
163 fFacet2 = rhs.fFacet2;
186 if (v1.
mag2() < v2.
mag2())
return v1;
222 for (
G4int i = 0; i <= 3; ++i)
225 if (sp > ss) ss =
sp;
240 fFacet1.
Intersect(p,v,outgoing,distance,distFromSurface,normal);
241 if (!intersect) intersect =
242 fFacet2.
Intersect(p,v,outgoing,distance,distFromSurface,normal);
245 distance = distFromSurface = kInfinity;
276 return "G4QuadrangularFacet";
void set(double x, double y, double z)
ThreeVector shoot(const G4int Ap, const G4int Af)
G4bool Intersect(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool outgoing, G4double &distance, G4double &distFromSurface, G4ThreeVector &normal)
double dot(const Hep3Vector &) const
G4double Extent(const G4ThreeVector axis)
G4ThreeVector GetSurfaceNormal() const
G4bool Intersect(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool outgoing, G4double &distance, G4double &distFromSurface, G4ThreeVector &normal)
G4QuadrangularFacet(const G4ThreeVector &Pt0, const G4ThreeVector &vt1, const G4ThreeVector &vt2, const G4ThreeVector &vt3, G4FacetVertexType)
G4GLOB_DLL std::ostream G4cout
G4ThreeVector GetVertex(G4int i) const
static const G4double dirTolerance
G4ThreeVector GetPointOnFace() const
G4QuadrangularFacet & operator=(const G4QuadrangularFacet &right)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Hep3Vector cross(const Hep3Vector &) const
G4ThreeVector GetPointOnFace() const
G4ThreeVector GetSurfaceNormal() const
G4ThreeVector Distance(const G4ThreeVector &p)
G4GeometryType GetEntityType() const
G4ThreeVector Distance(const G4ThreeVector &p)