#include <G4VFacet.hh>
Inheritance diagram for G4VFacet:
Public Member Functions | |
virtual | ~G4VFacet () |
G4bool | operator== (const G4VFacet &right) const |
virtual G4int | GetNumberOfVertices () const =0 |
virtual G4ThreeVector | GetVertex (G4int i) const =0 |
virtual void | SetVertex (G4int i, const G4ThreeVector &val)=0 |
virtual G4GeometryType | GetEntityType () const =0 |
virtual G4ThreeVector | GetSurfaceNormal () const =0 |
virtual G4bool | IsDefined () const =0 |
virtual G4ThreeVector | GetCircumcentre () const =0 |
virtual G4double | GetRadius () const =0 |
virtual G4VFacet * | GetClone ()=0 |
virtual G4double | Distance (const G4ThreeVector &, G4double)=0 |
virtual G4double | Distance (const G4ThreeVector &, G4double, const G4bool)=0 |
virtual G4double | Extent (const G4ThreeVector)=0 |
virtual G4bool | Intersect (const G4ThreeVector &, const G4ThreeVector &, const G4bool, G4double &, G4double &, G4ThreeVector &)=0 |
virtual G4double | GetArea ()=0 |
virtual G4ThreeVector | GetPointOnFace () const =0 |
void | ApplyTranslation (const G4ThreeVector v) |
std::ostream & | StreamInfo (std::ostream &os) const |
G4bool | IsInside (const G4ThreeVector &p) const |
virtual G4int | AllocatedMemory ()=0 |
virtual void | SetVertexIndex (G4int i, G4int j)=0 |
virtual G4int | GetVertexIndex (G4int i) const =0 |
virtual void | SetVertices (std::vector< G4ThreeVector > *vertices)=0 |
Static Protected Attributes | |
static const G4double | dirTolerance = 1.0E-14 |
static const G4double | kCarTolerance |
Definition at line 60 of file G4VFacet.hh.
G4VFacet::~G4VFacet | ( | ) | [virtual] |
virtual G4int G4VFacet::AllocatedMemory | ( | ) | [pure virtual] |
void G4VFacet::ApplyTranslation | ( | const G4ThreeVector | v | ) |
Definition at line 87 of file G4VFacet.cc.
References GetNumberOfVertices(), GetVertex(), CLHEP::detail::n, and SetVertex().
00088 { 00089 G4int n = GetNumberOfVertices(); 00090 for (G4int i = 0; i < n; ++i) 00091 { 00092 SetVertex(i, GetVertex(i) + v); 00093 } 00094 }
virtual G4double G4VFacet::Distance | ( | const G4ThreeVector & | , | |
G4double | , | |||
const | G4bool | |||
) | [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
virtual G4double G4VFacet::Distance | ( | const G4ThreeVector & | , | |
G4double | ||||
) | [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
Referenced by G4TessellatedSolid::Normal(), G4TessellatedSolid::SafetyFromInside(), and G4TessellatedSolid::SafetyFromOutside().
virtual G4double G4VFacet::Extent | ( | const | G4ThreeVector | ) | [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
virtual G4double G4VFacet::GetArea | ( | ) | [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
Referenced by G4TessellatedSolid::GetSurfaceArea().
virtual G4ThreeVector G4VFacet::GetCircumcentre | ( | ) | const [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
Referenced by G4TessellatedSolid::AddFacet(), and operator==().
virtual G4VFacet* G4VFacet::GetClone | ( | ) | [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
Referenced by G4TessellatedSolid::operator+=().
virtual G4GeometryType G4VFacet::GetEntityType | ( | ) | const [pure virtual] |
virtual G4int G4VFacet::GetNumberOfVertices | ( | ) | const [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
Referenced by ApplyTranslation(), G4TessellatedSolid::CreatePolyhedron(), operator==(), StreamInfo(), and G4GDMLWriteSolids::TessellatedWrite().
virtual G4ThreeVector G4VFacet::GetPointOnFace | ( | ) | const [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
virtual G4double G4VFacet::GetRadius | ( | ) | const [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
virtual G4ThreeVector G4VFacet::GetSurfaceNormal | ( | ) | const [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
Referenced by IsInside(), G4TessellatedSolid::Normal(), and operator==().
virtual G4ThreeVector G4VFacet::GetVertex | ( | G4int | i | ) | const [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
Referenced by ApplyTranslation(), IsInside(), operator==(), and StreamInfo().
virtual G4bool G4VFacet::Intersect | ( | const G4ThreeVector & | , | |
const G4ThreeVector & | , | |||
const | G4bool, | |||
G4double & | , | |||
G4double & | , | |||
G4ThreeVector & | ||||
) | [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
virtual G4bool G4VFacet::IsDefined | ( | ) | const [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
Referenced by G4TessellatedSolid::AddFacet().
G4bool G4VFacet::IsInside | ( | const G4ThreeVector & | p | ) | const |
Definition at line 114 of file G4VFacet.cc.
References GetSurfaceNormal(), and GetVertex().
00115 { 00116 G4ThreeVector d = p - GetVertex(0); 00117 G4double displacement = d.dot(GetSurfaceNormal()); 00118 return displacement <= 0.0; 00119 }
Definition at line 59 of file G4VFacet.cc.
References GetCircumcentre(), GetNumberOfVertices(), GetSurfaceNormal(), GetVertex(), and kCarTolerance.
00060 { 00061 G4double tolerance = kCarTolerance*kCarTolerance/4.0; 00062 00063 if (GetNumberOfVertices() != right.GetNumberOfVertices()) 00064 return false; 00065 else if ((GetCircumcentre()-right.GetCircumcentre()).mag2() > tolerance) 00066 return false; 00067 else if (std::fabs((right.GetSurfaceNormal()).dot(GetSurfaceNormal())) < 0.9999999999) 00068 return false; 00069 00070 G4bool coincident = true; 00071 G4int i = 0; 00072 do 00073 { 00074 coincident = false; 00075 G4int j = 0; 00076 do 00077 { 00078 coincident = (GetVertex(i)-right.GetVertex(j)).mag2() < tolerance; 00079 } while (!coincident && ++j < GetNumberOfVertices()); 00080 } while (coincident && ++i < GetNumberOfVertices()); 00081 00082 return coincident; 00083 }
virtual void G4VFacet::SetVertex | ( | G4int | i, | |
const G4ThreeVector & | val | |||
) | [pure virtual] |
Implemented in G4TriangularFacet.
virtual void G4VFacet::SetVertices | ( | std::vector< G4ThreeVector > * | vertices | ) | [pure virtual] |
Implemented in G4QuadrangularFacet, and G4TriangularFacet.
std::ostream & G4VFacet::StreamInfo | ( | std::ostream & | os | ) | const |
Definition at line 98 of file G4VFacet.cc.
References G4endl, GetEntityType(), GetNumberOfVertices(), GetVertex(), and CLHEP::detail::n.
Referenced by G4TessellatedSolid::AddFacet(), and G4TessellatedSolid::StreamInfo().
00099 { 00100 os << G4endl; 00101 os << "*********************************************************************" 00102 << G4endl; 00103 os << "FACET TYPE = " << GetEntityType() << G4endl; 00104 os << "ABSOLUTE VECTORS = " << G4endl; 00105 G4int n = GetNumberOfVertices(); 00106 for (G4int i = 0; i < n; ++i) 00107 os << "P[" << i << "] = " << GetVertex(i) << G4endl; 00108 os << "*********************************************************************" 00109 << G4endl; 00110 00111 return os; 00112 }
const G4double G4VFacet::dirTolerance = 1.0E-14 [static, protected] |
Definition at line 101 of file G4VFacet.hh.
Referenced by G4QuadrangularFacet::Distance(), and G4TriangularFacet::Intersect().
const G4double G4VFacet::kCarTolerance [static, protected] |
Initial value:
Definition at line 102 of file G4VFacet.hh.
Referenced by G4TriangularFacet::Distance(), G4QuadrangularFacet::G4QuadrangularFacet(), G4TriangularFacet::G4TriangularFacet(), G4TriangularFacet::Intersect(), and operator==().