Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CSGSolid Class Reference

#include <G4CSGSolid.hh>

+ Inheritance diagram for G4CSGSolid:

Public Member Functions

 G4CSGSolid (const G4String &pName)
 
virtual ~G4CSGSolid ()
 
virtual std::ostream & StreamInfo (std::ostream &os) const
 
virtual G4PolyhedronGetPolyhedron () const
 
 G4CSGSolid (__void__ &)
 
 G4CSGSolid (const G4CSGSolid &rhs)
 
G4CSGSolidoperator= (const G4CSGSolid &rhs)
 
- Public Member Functions inherited from G4VSolid
 G4VSolid (const G4String &name)
 
virtual ~G4VSolid ()
 
G4bool operator== (const G4VSolid &s) const
 
G4String GetName () const
 
void SetName (const G4String &name)
 
G4double GetTolerance () const
 
virtual void BoundingLimits (G4ThreeVector &pMin, G4ThreeVector &pMax) const
 
virtual G4bool CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
 
virtual EInside Inside (const G4ThreeVector &p) const =0
 
virtual G4ThreeVector SurfaceNormal (const G4ThreeVector &p) const =0
 
virtual G4double DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const =0
 
virtual G4double DistanceToIn (const G4ThreeVector &p) const =0
 
virtual G4double DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const =0
 
virtual G4double DistanceToOut (const G4ThreeVector &p) const =0
 
virtual void ComputeDimensions (G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
 
virtual G4double GetCubicVolume ()
 
virtual G4double GetSurfaceArea ()
 
virtual G4GeometryType GetEntityType () const =0
 
virtual G4ThreeVector GetPointOnSurface () const
 
virtual G4VSolidClone () const
 
virtual std::ostream & StreamInfo (std::ostream &os) const =0
 
void DumpInfo () const
 
virtual void DescribeYourselfTo (G4VGraphicsScene &scene) const =0
 
virtual G4VisExtent GetExtent () const
 
virtual G4PolyhedronCreatePolyhedron () const
 
virtual G4PolyhedronGetPolyhedron () const
 
virtual const G4VSolidGetConstituentSolid (G4int no) const
 
virtual G4VSolidGetConstituentSolid (G4int no)
 
virtual const G4DisplacedSolidGetDisplacedSolidPtr () const
 
virtual G4DisplacedSolidGetDisplacedSolidPtr ()
 
 G4VSolid (__void__ &)
 
 G4VSolid (const G4VSolid &rhs)
 
G4VSolidoperator= (const G4VSolid &rhs)
 
G4double EstimateCubicVolume (G4int nStat, G4double epsilon) const
 
G4double EstimateSurfaceArea (G4int nStat, G4double ell) const
 

Protected Member Functions

G4double GetRadiusInRing (G4double rmin, G4double rmax) const
 
- Protected Member Functions inherited from G4VSolid
void CalculateClippedPolygonExtent (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
 
void ClipCrossSection (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
 
void ClipBetweenSections (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
 
void ClipPolygon (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const
 

Protected Attributes

G4double fCubicVolume = 0.0
 
G4double fSurfaceArea = 0.0
 
G4bool fRebuildPolyhedron = false
 
G4PolyhedronfpPolyhedron = nullptr
 
- Protected Attributes inherited from G4VSolid
G4double kCarTolerance
 

Detailed Description

Definition at line 41 of file G4CSGSolid.hh.

Constructor & Destructor Documentation

◆ G4CSGSolid() [1/3]

G4CSGSolid::G4CSGSolid ( const G4String pName)

Definition at line 49 of file G4CSGSolid.cc.

49 :
50 G4VSolid(name)
51{
52}

◆ ~G4CSGSolid()

G4CSGSolid::~G4CSGSolid ( )
virtual

Definition at line 69 of file G4CSGSolid.cc.

70{
71 delete fpPolyhedron; fpPolyhedron = nullptr;
72}
G4Polyhedron * fpPolyhedron
Definition: G4CSGSolid.hh:73

◆ G4CSGSolid() [2/3]

G4CSGSolid::G4CSGSolid ( __void__ &  a)

Definition at line 59 of file G4CSGSolid.cc.

60 : G4VSolid(a)
61{
62}

◆ G4CSGSolid() [3/3]

G4CSGSolid::G4CSGSolid ( const G4CSGSolid rhs)

Definition at line 79 of file G4CSGSolid.cc.

82{
83}
G4double fSurfaceArea
Definition: G4CSGSolid.hh:71
G4double fCubicVolume
Definition: G4CSGSolid.hh:70

Member Function Documentation

◆ GetPolyhedron()

G4Polyhedron * G4CSGSolid::GetPolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 129 of file G4CSGSolid.cc.

130{
131 if (fpPolyhedron == nullptr ||
135 {
136 G4AutoLock l(&polyhedronMutex);
137 delete fpPolyhedron;
139 fRebuildPolyhedron = false;
140 l.unlock();
141 }
142 return fpPolyhedron;
143}
G4bool fRebuildPolyhedron
Definition: G4CSGSolid.hh:72
G4int GetNumberOfRotationStepsAtTimeOfCreation() const
virtual G4Polyhedron * CreatePolyhedron() const
Definition: G4VSolid.cc:700
static G4int GetNumberOfRotationSteps()

Referenced by G4ScoringBox::Draw(), G4ScoringCylinder::Draw(), and G4ScoringBox::DrawColumn().

◆ GetRadiusInRing()

G4double G4CSGSolid::GetRadiusInRing ( G4double  rmin,
G4double  rmax 
) const
protected

Definition at line 109 of file G4CSGSolid.cc.

110{
111 G4double k = G4QuickRand();
112 return (rmin <= 0) ? rmax*std::sqrt(k)
113 : std::sqrt(k*rmax*rmax + (1. - k)*rmin*rmin);
114}
G4double G4QuickRand()
Definition: G4QuickRand.hh:34
double G4double
Definition: G4Types.hh:83

Referenced by G4Cons::GetPointOnSurface(), and G4Torus::GetPointOnSurface().

◆ operator=()

G4CSGSolid & G4CSGSolid::operator= ( const G4CSGSolid rhs)

Definition at line 89 of file G4CSGSolid.cc.

90{
91 // Check assignment to self
92 //
93 if (this == &rhs) { return *this; }
94
95 // Copy base class data
96 //
98
99 // Copy data
100 //
103 fRebuildPolyhedron = false;
104 delete fpPolyhedron; fpPolyhedron = nullptr;
105
106 return *this;
107}
G4VSolid & operator=(const G4VSolid &rhs)
Definition: G4VSolid.cc:107

Referenced by G4Box::operator=(), G4Cons::operator=(), G4CutTubs::operator=(), G4Orb::operator=(), G4Para::operator=(), G4Sphere::operator=(), G4Torus::operator=(), G4Trap::operator=(), G4Trd::operator=(), and G4Tubs::operator=().

◆ StreamInfo()

std::ostream & G4CSGSolid::StreamInfo ( std::ostream &  os) const
virtual

Implements G4VSolid.

Reimplemented in G4Box, G4Cons, G4CutTubs, G4Orb, G4Para, G4Sphere, G4Torus, G4Trap, G4Trd, and G4Tubs.

Definition at line 116 of file G4CSGSolid.cc.

117{
118 os << "-----------------------------------------------------------\n"
119 << " *** Dump for solid - " << GetName() << " ***\n"
120 << " ===================================================\n"
121 << " Solid type: " << GetEntityType() << "\n"
122 << " Parameters: \n"
123 << " NOT available !\n"
124 << "-----------------------------------------------------------\n";
125
126 return os;
127}
G4String GetName() const
virtual G4GeometryType GetEntityType() const =0

Member Data Documentation

◆ fCubicVolume

◆ fpPolyhedron

G4Polyhedron* G4CSGSolid::fpPolyhedron = nullptr
mutableprotected

Definition at line 73 of file G4CSGSolid.hh.

Referenced by GetPolyhedron(), operator=(), and ~G4CSGSolid().

◆ fRebuildPolyhedron

◆ fSurfaceArea


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