Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VFacet Class Referenceabstract

#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 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
 

Static Protected Attributes

static const G4double dirTolerance = 1.0E-14
 
static const G4double kCarTolerance
 

Detailed Description

Definition at line 60 of file G4VFacet.hh.

Constructor & Destructor Documentation

G4VFacet::~G4VFacet ( )
virtual

Definition at line 53 of file G4VFacet.cc.

54 {
55 }

Member Function Documentation

virtual G4int G4VFacet::AllocatedMemory ( )
pure virtual

Implemented in G4TriangularFacet.

Here is the caller graph for this function:

void G4VFacet::ApplyTranslation ( const G4ThreeVector  v)

Definition at line 87 of file G4VFacet.cc.

88 {
90  for (G4int i = 0; i < n; ++i)
91  {
92  SetVertex(i, GetVertex(i) + v);
93  }
94 }
virtual G4int GetNumberOfVertices() const =0
int G4int
Definition: G4Types.hh:78
virtual void SetVertex(G4int i, const G4ThreeVector &val)=0
virtual G4ThreeVector GetVertex(G4int i) const =0
virtual G4double G4VFacet::Distance ( const G4ThreeVector ,
G4double   
)
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

Here is the caller graph for this function:

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

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

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

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

virtual G4double G4VFacet::GetArea ( ) const
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

Here is the caller graph for this function:

virtual G4ThreeVector G4VFacet::GetCircumcentre ( ) const
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

Here is the caller graph for this function:

virtual G4VFacet* G4VFacet::GetClone ( )
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

Here is the caller graph for this function:

virtual G4GeometryType G4VFacet::GetEntityType ( ) const
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

virtual G4int G4VFacet::GetNumberOfVertices ( ) const
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

Here is the caller graph for this function:

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 G4TriangularFacet, and G4QuadrangularFacet.

Here is the caller graph for this function:

virtual G4ThreeVector G4VFacet::GetVertex ( G4int  i) const
pure virtual

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

Here is the caller graph for this function:

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

Implemented in G4TriangularFacet.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

G4bool G4VFacet::IsInside ( const G4ThreeVector p) const

Definition at line 114 of file G4VFacet.cc.

115 {
116  G4ThreeVector d = p - GetVertex(0);
117  G4double displacement = d.dot(GetSurfaceNormal());
118  return displacement <= 0.0;
119 }
double dot(const Hep3Vector &) const
virtual G4ThreeVector GetSurfaceNormal() const =0
double G4double
Definition: G4Types.hh:76
virtual G4ThreeVector GetVertex(G4int i) const =0

Here is the call graph for this function:

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

Definition at line 59 of file G4VFacet.cc.

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

Here is the call graph for this function:

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

Implemented in G4QuadrangularFacet, and G4TriangularFacet.

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

Implemented in G4TriangularFacet.

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

Implemented in G4TriangularFacet, and G4QuadrangularFacet.

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

Definition at line 98 of file G4VFacet.cc.

99 {
100  os << G4endl;
101  os << "*********************************************************************"
102  << G4endl;
103  os << "FACET TYPE = " << GetEntityType() << G4endl;
104  os << "ABSOLUTE VECTORS = " << G4endl;
106  for (G4int i = 0; i < n; ++i)
107  os << "P[" << i << "] = " << GetVertex(i) << G4endl;
108  os << "*********************************************************************"
109  << G4endl;
110 
111  return os;
112 }
virtual G4GeometryType GetEntityType() const =0
virtual G4int GetNumberOfVertices() const =0
int G4int
Definition: G4Types.hh:78
#define G4endl
Definition: G4ios.hh:61
virtual G4ThreeVector GetVertex(G4int i) const =0

Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 101 of file G4VFacet.hh.

const G4double G4VFacet::kCarTolerance
staticprotected
Initial value:

Definition at line 102 of file G4VFacet.hh.


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