Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VFacet Class Referenceabstract

#include <G4VFacet.hh>

+ Inheritance diagram for G4VFacet:

Public Member Functions

 G4VFacet ()
 
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 G4VFacetGetClone ()=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 () const =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
 

Protected Attributes

G4double kCarTolerance
 

Static Protected Attributes

static const G4double dirTolerance = 1.0E-14
 

Detailed Description

Definition at line 50 of file G4VFacet.hh.

Constructor & Destructor Documentation

◆ G4VFacet()

G4VFacet::G4VFacet ( )

Definition at line 44 of file G4VFacet.cc.

45{
47}
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
G4double kCarTolerance
Definition G4VFacet.hh:93

◆ ~G4VFacet()

G4VFacet::~G4VFacet ( )
virtualdefault

Member Function Documentation

◆ AllocatedMemory()

virtual G4int G4VFacet::AllocatedMemory ( )
pure virtual

◆ ApplyTranslation()

void G4VFacet::ApplyTranslation ( const G4ThreeVector & v)

Definition at line 83 of file G4VFacet.cc.

84{
86 for (G4int i = 0; i < n; ++i)
87 {
88 SetVertex(i, GetVertex(i) + v);
89 }
90}
int G4int
Definition G4Types.hh:85
virtual G4ThreeVector GetVertex(G4int i) const =0
virtual G4int GetNumberOfVertices() const =0
virtual void SetVertex(G4int i, const G4ThreeVector &val)=0

◆ Distance() [1/2]

◆ Distance() [2/2]

virtual G4double G4VFacet::Distance ( const G4ThreeVector & ,
G4double ,
const G4bool  )
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

◆ Extent()

virtual G4double G4VFacet::Extent ( const G4ThreeVector )
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

◆ GetArea()

◆ GetCircumcentre()

virtual G4ThreeVector G4VFacet::GetCircumcentre ( ) const
pure virtual

◆ GetClone()

virtual G4VFacet * G4VFacet::GetClone ( )
pure virtual

◆ GetEntityType()

virtual G4GeometryType G4VFacet::GetEntityType ( ) const
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

Referenced by StreamInfo().

◆ GetNumberOfVertices()

◆ GetPointOnFace()

virtual G4ThreeVector G4VFacet::GetPointOnFace ( ) const
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

◆ GetRadius()

virtual G4double G4VFacet::GetRadius ( ) const
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

◆ GetSurfaceNormal()

◆ GetVertex()

◆ GetVertexIndex()

virtual G4int G4VFacet::GetVertexIndex ( G4int i) const
pure virtual

◆ Intersect()

virtual G4bool G4VFacet::Intersect ( const G4ThreeVector & ,
const G4ThreeVector & ,
const G4bool ,
G4double & ,
G4double & ,
G4ThreeVector &  )
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

◆ IsDefined()

virtual G4bool G4VFacet::IsDefined ( ) const
pure virtual

◆ IsInside()

G4bool G4VFacet::IsInside ( const G4ThreeVector & p) const

Definition at line 110 of file G4VFacet.cc.

111{
112 G4ThreeVector d = p-GetVertex(0);
113 G4double displacement = d.dot(GetSurfaceNormal());
114 return displacement <= 0.0;
115}
double G4double
Definition G4Types.hh:83
double dot(const Hep3Vector &) const
virtual G4ThreeVector GetSurfaceNormal() const =0

◆ operator==()

G4bool G4VFacet::operator== ( const G4VFacet & right) const

Definition at line 55 of file G4VFacet.cc.

56{
57 G4double tolerance = kCarTolerance*kCarTolerance/4.0;
58
60 return false;
61 else if ((GetCircumcentre()-right.GetCircumcentre()).mag2() > tolerance)
62 return false;
63 else if (std::fabs((right.GetSurfaceNormal()).dot(GetSurfaceNormal())) < 0.9999999999)
64 return false;
65
66 G4bool coincident = true;
67 G4int i = 0;
68 do // Loop checking, 13.08.2015, G.Cosmo
69 {
70 coincident = false;
71 G4int j = 0;
72 do // Loop checking, 13.08.2015, G.Cosmo
73 {
74 coincident = (GetVertex(i)-right.GetVertex(j)).mag2() < tolerance;
75 } while (!coincident && ++j < GetNumberOfVertices());
76 } while (coincident && ++i < GetNumberOfVertices());
77
78 return coincident;
79}
bool G4bool
Definition G4Types.hh:86
virtual G4ThreeVector GetCircumcentre() const =0

◆ SetVertex()

virtual void G4VFacet::SetVertex ( G4int i,
const G4ThreeVector & val )
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

Referenced by ApplyTranslation().

◆ SetVertexIndex()

virtual void G4VFacet::SetVertexIndex ( G4int i,
G4int j )
pure virtual

Implemented in G4TriangularFacet.

◆ SetVertices()

virtual void G4VFacet::SetVertices ( std::vector< G4ThreeVector > * vertices)
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

◆ StreamInfo()

std::ostream & G4VFacet::StreamInfo ( std::ostream & os) const

Definition at line 94 of file G4VFacet.cc.

95{
96 os << G4endl;
97 os << "*********************************************************************"
98 << G4endl;
99 os << "FACET TYPE = " << GetEntityType() << G4endl;
100 os << "ABSOLUTE VECTORS = " << G4endl;
102 for (G4int i = 0; i < n; ++i)
103 os << "P[" << i << "] = " << GetVertex(i) << G4endl;
104 os << "*********************************************************************"
105 << G4endl;
106
107 return os;
108}
#define G4endl
Definition G4ios.hh:67
virtual G4GeometryType GetEntityType() const =0

Referenced by G4TessellatedSolid::AddFacet(), and G4TessellatedSolid::StreamInfo().

Member Data Documentation

◆ dirTolerance

const G4double G4VFacet::dirTolerance = 1.0E-14
staticprotected

Definition at line 92 of file G4VFacet.hh.

Referenced by G4QuadrangularFacet::Distance(), and G4TriangularFacet::Intersect().

◆ kCarTolerance


The documentation for this class was generated from the following files: