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

#include <G4BREPSolidSphere.hh>

+ Inheritance diagram for G4BREPSolidSphere:

Public Member Functions

 G4BREPSolidSphere (const G4String &name, const G4Vector3D &origin, const G4Vector3D &xhat, const G4Vector3D &zhat, G4double radius)
 
 ~G4BREPSolidSphere ()
 
EInside Inside (register const G4ThreeVector &Pt) const
 
G4ThreeVector SurfaceNormal (const G4ThreeVector &) const
 
G4double DistanceToIn (const G4ThreeVector &) const
 
G4double DistanceToIn (register const G4ThreeVector &Pt, register const G4ThreeVector &V) const
 
G4double DistanceToOut (register const G4ThreeVector &Pt, register const G4ThreeVector &V, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
 
G4double DistanceToOut (const G4ThreeVector &) const
 
G4VSolidClone () const
 
std::ostream & StreamInfo (std::ostream &os) const
 
 G4BREPSolidSphere (__void__ &)
 
void SphReset ()
 
 G4BREPSolidSphere (const G4BREPSolidSphere &rhs)
 
G4BREPSolidSphereoperator= (const G4BREPSolidSphere &rhs)
 
- Public Member Functions inherited from G4BREPSolid
 G4BREPSolid (const G4String &name)
 
 G4BREPSolid (const G4String &, G4Surface **, G4int)
 
virtual ~G4BREPSolid ()
 
virtual void Initialize ()
 
G4bool CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
 
virtual EInside Inside (register const G4ThreeVector &Pt) const
 
virtual G4ThreeVector SurfaceNormal (const G4ThreeVector &) const
 
virtual G4double DistanceToIn (const G4ThreeVector &) const
 
virtual G4double DistanceToIn (register const G4ThreeVector &Pt, register const G4ThreeVector &V) const
 
virtual G4double DistanceToOut (const G4ThreeVector &) const
 
virtual G4double DistanceToOut (register const G4ThreeVector &Pt, register const G4ThreeVector &V, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
 
G4Point3D Scope () const
 
virtual G4String GetEntityType () const
 
virtual G4VSolidClone () const
 
virtual std::ostream & StreamInfo (std::ostream &os) const
 
void DescribeYourselfTo (G4VGraphicsScene &scene) const
 
G4PolyhedronCreatePolyhedron () const
 
G4NURBSCreateNURBS () const
 
virtual G4PolyhedronGetPolyhedron () const
 
G4int Intersect (register const G4Ray &) const
 
G4SurfaceGetSurface (G4int) const
 
void Active (G4int) const
 
G4int Active () const
 
G4double GetShortestDistance () const
 
G4int GetId () const
 
void SetId (G4int)
 
const G4StringGetName () const
 
void SetName (const G4String &name)
 
G4int GetNumberOfFaces () const
 
G4int GetNumberOfSolids () const
 
const G4Axis2Placement3DGetPlace () const
 
const G4BoundingBox3DGetBBox () const
 
G4int GetCubVolStatistics () const
 
G4double GetCubVolEpsilon () const
 
void SetCubVolStatistics (G4int st)
 
void SetCubVolEpsilon (G4double ep)
 
G4int GetAreaStatistics () const
 
G4double GetAreaAccuracy () const
 
void SetAreaStatistics (G4int st)
 
void SetAreaAccuracy (G4double ep)
 
G4double GetCubicVolume ()
 
G4double GetSurfaceArea ()
 
G4double IntersectionDistance () const
 
void IntersectionDistance (G4double) const
 
virtual void Reset () const
 
 G4BREPSolid (__void__ &)
 
 G4BREPSolid (const G4BREPSolid &rhs)
 
G4BREPSolidoperator= (const G4BREPSolid &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 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=0, G4ThreeVector *n=0) 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 G4NURBSCreateNURBS () 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)
 

Additional Inherited Members

- Protected Member Functions inherited from G4BREPSolid
G4ThreeVectorListCreateRotatedVertices (const G4AffineTransform &) const
 
G4bool IsConvex ()
 
virtual void CalcBBoxes ()
 
void CheckSurfaceNormals ()
 
void RemoveHiddenFaces (register const G4Ray &G4Rayref, G4int) const
 
void TestSurfaceBBoxes (register const G4Ray &) const
 
G4int StartInside () const
 
void StartInside (G4int si) const
 
void QuickSort (register G4Surface **SrfVec, register G4int left, register G4int right) 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
 
G4double EstimateCubicVolume (G4int nStat, G4double epsilon) const
 
G4double EstimateSurfaceArea (G4int nStat, G4double ell) const
 
- Protected Attributes inherited from G4BREPSolid
G4int Box
 
G4int Convex
 
G4int AxisBox
 
G4int PlaneSolid
 
G4Axis2Placement3Dplace
 
G4BoundingBox3Dbbox
 
G4double intersectionDistance
 
G4int active
 
G4int startInside
 
G4int nb_of_surfaces
 
G4Point3D intersection_point
 
G4Surface ** SurfaceVec
 
G4double RealDist
 
G4String solidname
 
G4int Id
 
- Protected Attributes inherited from G4VSolid
G4double kCarTolerance
 
- Static Protected Attributes inherited from G4BREPSolid
static G4int NumberOfSolids =0
 
static G4Ray Track
 
static G4double ShortestDistance = kInfinity
 

Detailed Description

Definition at line 50 of file G4BREPSolidSphere.hh.

Constructor & Destructor Documentation

◆ G4BREPSolidSphere() [1/3]

G4BREPSolidSphere::G4BREPSolidSphere ( const G4String name,
const G4Vector3D origin,
const G4Vector3D xhat,
const G4Vector3D zhat,
G4double  radius 
)

Definition at line 40 of file G4BREPSolidSphere.cc.

45 : G4BREPSolid(name)
46{
47 constructorParams.origin = origin;
48 constructorParams.xhat = xhat;
49 constructorParams.zhat = zhat;
50 constructorParams.radius = radius;
51
52 active=1;
53 InitializeSphere();
54}

◆ ~G4BREPSolidSphere()

G4BREPSolidSphere::~G4BREPSolidSphere ( )

Definition at line 61 of file G4BREPSolidSphere.cc.

62{
63}

◆ G4BREPSolidSphere() [2/3]

G4BREPSolidSphere::G4BREPSolidSphere ( __void__ &  a)

Definition at line 56 of file G4BREPSolidSphere.cc.

57 : G4BREPSolid(a)
58{
59}

◆ G4BREPSolidSphere() [3/3]

G4BREPSolidSphere::G4BREPSolidSphere ( const G4BREPSolidSphere rhs)

Definition at line 65 of file G4BREPSolidSphere.cc.

66 : G4BREPSolid(rhs)
67{
68 constructorParams.origin = rhs.constructorParams.origin;
69 constructorParams.xhat = rhs.constructorParams.xhat;
70 constructorParams.zhat = rhs.constructorParams.zhat;
71 constructorParams.radius = rhs.constructorParams.radius;
72
73 InitializeSphere();
74}

Member Function Documentation

◆ Clone()

G4VSolid * G4BREPSolidSphere::Clone ( ) const
virtual

Reimplemented from G4BREPSolid.

Definition at line 188 of file G4BREPSolidSphere.cc.

189{
190 return new G4BREPSolidSphere(*this);
191}

◆ DistanceToIn() [1/2]

G4double G4BREPSolidSphere::DistanceToIn ( const G4ThreeVector Pt) const
virtual

Reimplemented from G4BREPSolid.

Definition at line 132 of file G4BREPSolidSphere.cc.

133{
134 return std::fabs(SurfaceVec[0]->HowNear(Pt));
135}
G4Surface ** SurfaceVec
Definition: G4BREPSolid.hh:231

◆ DistanceToIn() [2/2]

G4double G4BREPSolidSphere::DistanceToIn ( register const G4ThreeVector Pt,
register const G4ThreeVector V 
) const
virtual

Reimplemented from G4BREPSolid.

Definition at line 138 of file G4BREPSolidSphere.cc.

140{
141 // SphReset();
142 G4Vector3D Pttmp(Pt);
143 G4Vector3D Vtmp(V);
144 G4Ray r(Pttmp, Vtmp);
145 G4int Result = SurfaceVec[0]->Intersect( r );
146
147 if(Result>0)
148 {
150 return std::sqrt(ShortestDistance);
151 }
152 return kInfinity;
153}
int G4int
Definition: G4Types.hh:66
static G4double ShortestDistance
Definition: G4BREPSolid.hh:221
Definition: G4Ray.hh:49
virtual G4int Intersect(const G4Ray &)
Definition: G4Surface.cc:170
G4double GetDistance() const

◆ DistanceToOut() [1/2]

G4double G4BREPSolidSphere::DistanceToOut ( const G4ThreeVector Pt) const
virtual

Reimplemented from G4BREPSolid.

Definition at line 183 of file G4BREPSolidSphere.cc.

184{
185 return std::fabs(SurfaceVec[0]->HowNear(Pt));
186}

◆ DistanceToOut() [2/2]

G4double G4BREPSolidSphere::DistanceToOut ( register const G4ThreeVector Pt,
register const G4ThreeVector V,
const G4bool  calcNorm = false,
G4bool validNorm = 0,
G4ThreeVector n = 0 
) const
virtual

Reimplemented from G4BREPSolid.

Definition at line 156 of file G4BREPSolidSphere.cc.

161{
162 if(validNorm) *validNorm = false;
163 // SphReset();
164 G4Vector3D Pttmp(Pt);
165 G4Vector3D Vtmp(V);
166 G4Ray r(Pttmp, Vtmp);
167
168 if(SurfaceVec[0]->Intersect( r ))
169 {
170 if(calcNorm)
171 {
172 if(validNorm) *validNorm = true;
173 *n = SurfaceNormal(Pt);
174 }
175
177 return std::sqrt(ShortestDistance);
178 }
179 return kInfinity;
180}
G4ThreeVector SurfaceNormal(const G4ThreeVector &) const
G4int Intersect(register const G4Ray &) const

◆ Inside()

EInside G4BREPSolidSphere::Inside ( register const G4ThreeVector Pt) const
virtual

Reimplemented from G4BREPSolid.

Definition at line 115 of file G4BREPSolidSphere.cc.

116{
117 G4double Dist = SurfaceVec[0]->HowNear(Pt);
118 if(Dist > 0+kCarTolerance) return kInside;
119 if(Dist < 0-kCarTolerance) return kOutside;
120 return kSurface;
121}
double G4double
Definition: G4Types.hh:64
virtual G4double HowNear(const G4Vector3D &x) const
Definition: G4Surface.cc:283
G4double kCarTolerance
Definition: G4VSolid.hh:307
@ kInside
Definition: geomdefs.hh:58
@ kOutside
Definition: geomdefs.hh:58
@ kSurface
Definition: geomdefs.hh:58

◆ operator=()

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

Definition at line 77 of file G4BREPSolidSphere.cc.

78{
79 // Check assignment to self
80 //
81 if (this == &rhs) { return *this; }
82
83 // Copy base class data
84 //
86
87 // Copy data
88 //
89 constructorParams.origin = rhs.constructorParams.origin;
90 constructorParams.xhat = rhs.constructorParams.xhat;
91 constructorParams.zhat = rhs.constructorParams.zhat;
92 constructorParams.radius = rhs.constructorParams.radius;
93
94 InitializeSphere();
95
96 return *this;
97}
G4BREPSolid & operator=(const G4BREPSolid &rhs)
Definition: G4BREPSolid.cc:138

◆ SphReset()

void G4BREPSolidSphere::SphReset ( )
inline

Definition at line 114 of file G4BREPSolidSphere.hh.

114{ active=1; }

◆ StreamInfo()

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

Reimplemented from G4BREPSolid.

Definition at line 193 of file G4BREPSolidSphere.cc.

194{
195 // Streams solid contents to output stream.
196
198 << "\n origin: " << constructorParams.origin
199 << "\n xhat: " << constructorParams.xhat
200 << "\n zhat: " << constructorParams.zhat
201 << "\n radius: " << constructorParams.radius
202 << "\n-----------------------------------------------------------\n";
203
204 return os;
205}
virtual std::ostream & StreamInfo(std::ostream &os) const

◆ SurfaceNormal()

G4ThreeVector G4BREPSolidSphere::SurfaceNormal ( const G4ThreeVector Pt) const
virtual

Reimplemented from G4BREPSolid.

Definition at line 124 of file G4BREPSolidSphere.cc.

125{
126 G4Vector3D n = SurfaceVec[0]->Normal(Pt);
127 G4ThreeVector norm(n.x(), n.y(), n.z());
128 return norm;
129}
virtual G4Vector3D Normal(const G4Vector3D &p) const
Definition: G4Surface.cc:162

Referenced by DistanceToOut().


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