Import Geant4 11.4.0 source tree
This commit is contained in:
@@ -28,11 +28,11 @@
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Base class defining the facets which are components of a
|
||||
// G4TessellatedSolid shape.
|
||||
// Base class defining the facets which are components of a
|
||||
// G4TessellatedSolid shape.
|
||||
|
||||
// 31 October 2004, P R Truscott, QinetiQ Ltd, UK - Created.
|
||||
// 12 October 2012, M Gayer, CERN, - Reviewed optimised implementation.
|
||||
// Author: P.R.Truscott (QinetiQ Ltd, UK), 31.10.2004 - Created.
|
||||
// M.Gayer (CERN), 12.10.2012 - Reviewed optimised implementation.
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4VFACET_HH
|
||||
#define G4VFACET_HH
|
||||
@@ -47,45 +47,137 @@
|
||||
|
||||
enum G4FacetVertexType { ABSOLUTE, RELATIVE };
|
||||
|
||||
/**
|
||||
* @brief G4VFacet is a base class defining the facets which are components
|
||||
* of a G4TessellatedSolid shape.
|
||||
*/
|
||||
|
||||
class G4VFacet
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor and default Destructor.
|
||||
*/
|
||||
G4VFacet();
|
||||
virtual ~G4VFacet ();
|
||||
virtual ~G4VFacet() = default;
|
||||
|
||||
/**
|
||||
* Equality operator.
|
||||
*/
|
||||
G4bool operator== (const G4VFacet& right) const;
|
||||
|
||||
/**
|
||||
* Returns the number of vertices of the facet.
|
||||
*/
|
||||
virtual G4int GetNumberOfVertices () const = 0;
|
||||
|
||||
/**
|
||||
* Returns the vertex based on the index 'i'.
|
||||
*/
|
||||
virtual G4ThreeVector GetVertex (G4int i) const = 0;
|
||||
|
||||
/**
|
||||
* Methods to set the vertices.
|
||||
*/
|
||||
virtual void SetVertex (G4int i, const G4ThreeVector& val) = 0;
|
||||
virtual void SetVertices(std::vector<G4ThreeVector>* vertices) = 0;
|
||||
|
||||
/**
|
||||
* Returns the type ID of the facet.
|
||||
*/
|
||||
virtual G4GeometryType GetEntityType () const = 0;
|
||||
|
||||
/**
|
||||
* Returns the normal vector to the facet.
|
||||
*/
|
||||
virtual G4ThreeVector GetSurfaceNormal () const = 0;
|
||||
|
||||
/**
|
||||
* Returns true if the facet is defined.
|
||||
*/
|
||||
virtual G4bool IsDefined () const = 0;
|
||||
|
||||
/**
|
||||
* Returns the circumcentre point of the facet.
|
||||
*/
|
||||
virtual G4ThreeVector GetCircumcentre () const = 0;
|
||||
|
||||
/**
|
||||
* Returns the radius to the anchor point and centered on the circumcentre.
|
||||
*/
|
||||
virtual G4double GetRadius () const = 0;
|
||||
|
||||
/**
|
||||
* Returns a pointer to a newly allocated duplicate copy of the facet.
|
||||
*/
|
||||
virtual G4VFacet* GetClone () = 0;
|
||||
virtual G4double Distance (const G4ThreeVector&, G4double) = 0;
|
||||
virtual G4double Distance (const G4ThreeVector&, G4double,
|
||||
|
||||
/**
|
||||
* Determines the closest distance between point p and the facet.
|
||||
*/
|
||||
virtual G4double Distance (const G4ThreeVector&, G4double minDist) = 0;
|
||||
|
||||
/**
|
||||
* Determines the distance to point 'p'. kInfinity is returned if either:
|
||||
* (1) outgoing is TRUE and the dot product of the normal vector to the
|
||||
* facet and the displacement vector from p to the triangle is negative.
|
||||
* (2) outgoing is FALSE and the dot product of the normal vector to the
|
||||
* facet and the displacement vector from p to the triangle is positive.
|
||||
*/
|
||||
virtual G4double Distance (const G4ThreeVector&, G4double minDist,
|
||||
const G4bool) = 0;
|
||||
virtual G4double Extent (const G4ThreeVector) = 0;
|
||||
virtual G4bool Intersect (const G4ThreeVector&, const G4ThreeVector&,
|
||||
const G4bool, G4double&, G4double&,
|
||||
G4ThreeVector&) = 0;
|
||||
|
||||
/**
|
||||
* Calculates the furthest the triangle extends in fA particular
|
||||
* direction defined by the vector axis.
|
||||
*/
|
||||
virtual G4double Extent (const G4ThreeVector axis) = 0;
|
||||
|
||||
/**
|
||||
* Finds the next intersection when going from 'p' in the direction of 'v'.
|
||||
* If 'outgoing' is true, only consider the face if we are going out
|
||||
* through the face; otherwise, if false, only consider the face if we are
|
||||
* going in through the face.
|
||||
* @returns true if there is an intersection, false otherwise.
|
||||
*/
|
||||
virtual G4bool Intersect (const G4ThreeVector& p, const G4ThreeVector& v,
|
||||
const G4bool outgoing, G4double& distance,
|
||||
G4double& distFromSurface,
|
||||
G4ThreeVector& normal) = 0;
|
||||
|
||||
/**
|
||||
* Auxiliary method for returning the surface area.
|
||||
*/
|
||||
virtual G4double GetArea() const = 0;
|
||||
|
||||
/**
|
||||
* Auxiliary method to get a uniform random point on the facet.
|
||||
*/
|
||||
virtual G4ThreeVector GetPointOnFace() const = 0;
|
||||
|
||||
/**
|
||||
* Adds a translation 'v' to the vertices of the facet.
|
||||
*/
|
||||
void ApplyTranslation (const G4ThreeVector& v);
|
||||
|
||||
/**
|
||||
* Streams the object contents to an output stream.
|
||||
*/
|
||||
std::ostream& StreamInfo(std::ostream& os) const;
|
||||
|
||||
/**
|
||||
* Returns true if point 'p' is inside the facet.
|
||||
*/
|
||||
G4bool IsInside(const G4ThreeVector& p) const;
|
||||
|
||||
/**
|
||||
* Logger methods for allocated memory of facets.
|
||||
*/
|
||||
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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user