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

G4VCSGfaceted is a virtual class defining a CSG-like type shape that is built entirely of G4CSGface faces. More...

#include <G4VCSGfaceted.hh>

Inheritance diagram for G4VCSGfaceted:

Public Member Functions

 G4VCSGfaceted (const G4String &name)
 ~G4VCSGfaceted () override
 G4VCSGfaceted (const G4VCSGfaceted &source)
G4VCSGfacetedoperator= (const G4VCSGfaceted &source)
G4bool CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const override
EInside Inside (const G4ThreeVector &p) const override
G4ThreeVector SurfaceNormal (const G4ThreeVector &p) const override
G4double DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const override
G4double DistanceToIn (const G4ThreeVector &p) const override
G4double DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const override
G4double DistanceToOut (const G4ThreeVector &p) const override
G4GeometryType GetEntityType () const override
std::ostream & StreamInfo (std::ostream &os) const override
G4PolyhedronCreatePolyhedron () const override=0
void DescribeYourselfTo (G4VGraphicsScene &scene) const override
G4VisExtent GetExtent () const override
G4PolyhedronGetPolyhedron () const override
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 () override
G4double GetSurfaceArea () override
 G4VCSGfaceted (__void__ &)
Public Member Functions inherited from G4VSolid
 G4VSolid (const G4String &name)
virtual ~G4VSolid ()
 G4VSolid (const G4VSolid &rhs)
G4VSolidoperator= (const G4VSolid &rhs)
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 void ComputeDimensions (G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
virtual G4ThreeVector GetPointOnSurface () const
virtual G4int GetNumOfConstituents () const
virtual G4bool IsFaceted () const
virtual G4VSolidClone () const
void DumpInfo () const
virtual const G4VSolidGetConstituentSolid (G4int no) const
virtual G4VSolidGetConstituentSolid (G4int no)
virtual const G4DisplacedSolidGetDisplacedSolidPtr () const
virtual G4DisplacedSolidGetDisplacedSolidPtr ()
 G4VSolid (__void__ &)
G4double EstimateCubicVolume (G4int nStat, G4double epsilon) const
G4double EstimateSurfaceArea (G4int nStat, G4double epsilon) const

Protected Member Functions

virtual G4double DistanceTo (const G4ThreeVector &p, const G4bool outgoing) const
G4ThreeVector GetPointOnSurfaceGeneric () const
void CopyStuff (const G4VCSGfaceted &source)
void DeleteStuff ()
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

G4int numFace = 0
G4VCSGface ** faces = nullptr
G4double fCubicVolume = 0.0
G4double fSurfaceArea = 0.0
G4bool fRebuildPolyhedron = false
G4PolyhedronfpPolyhedron = nullptr
Protected Attributes inherited from G4VSolid
G4double kCarTolerance

Detailed Description

G4VCSGfaceted is a virtual class defining a CSG-like type shape that is built entirely of G4CSGface faces.

Definition at line 48 of file G4VCSGfaceted.hh.

Constructor & Destructor Documentation

◆ G4VCSGfaceted() [1/3]

◆ ~G4VCSGfaceted()

G4VCSGfaceted::~G4VCSGfaceted ( )
override

Destructor.

Definition at line 76 of file G4VCSGfaceted.cc.

77{
79 delete fpPolyhedron; fpPolyhedron = nullptr;
80}
G4Polyhedron * fpPolyhedron

◆ G4VCSGfaceted() [2/3]

G4VCSGfaceted::G4VCSGfaceted ( const G4VCSGfaceted & source)

Copy constructor and assignment operator.

Definition at line 86 of file G4VCSGfaceted.cc.

87 : G4VSolid( source )
88{
89 fStatistics = source.fStatistics;
90 fCubVolEpsilon = source.fCubVolEpsilon;
91 fAreaAccuracy = source.fAreaAccuracy;
92
93 CopyStuff( source );
94}
void CopyStuff(const G4VCSGfaceted &source)

◆ G4VCSGfaceted() [3/3]

G4VCSGfaceted::G4VCSGfaceted ( __void__ & a)

Fake default constructor for usage restricted to direct object persistency for clients requiring preallocation of memory for persistifiable objects.

Definition at line 67 of file G4VCSGfaceted.cc.

68 : G4VSolid(a),
69 fStatistics(1000000), fCubVolEpsilon(0.001), fAreaAccuracy(-1.)
70{
71}

Member Function Documentation

◆ CalculateExtent()

G4bool G4VCSGfaceted::CalculateExtent ( const EAxis pAxis,
const G4VoxelLimits & pVoxelLimit,
const G4AffineTransform & pTransform,
G4double & pmin,
G4double & pmax ) const
overridevirtual

Calculates the minimum and maximum extent of the solid, when under the specified transform, and within the specified limits.

Parameters
[in]pAxisThe axis along which compute the extent.
[in]pVoxelLimitThe limiting space dictated by voxels.
[in]pTransformThe internal transformation applied to the solid.
[out]pMinThe minimum extent value.
[out]pMaxThe maximum extent value.
Returns
True if the solid is intersected by the extent region.

Implements G4VSolid.

Definition at line 170 of file G4VCSGfaceted.cc.

175{
176 G4SolidExtentList extentList( axis, voxelLimit );
177
178 //
179 // Loop over all faces, checking min/max extent as we go.
180 //
181 G4VCSGface **face = faces;
182 do // Loop checking, 13.08.2015, G.Cosmo
183 {
184 (*face)->CalculateExtent( axis, voxelLimit, transform, extentList );
185 } while( ++face < faces + numFace );
186
187 //
188 // Return min/max value
189 //
190 return extentList.GetExtent( min, max );
191}
G4VCSGface ** faces
const axis_t axis_to_type< N >::axis
Definition pugixml.cc:9668

◆ CopyStuff()

void G4VCSGfaceted::CopyStuff ( const G4VCSGfaceted & source)
protected

Copy parameters from other solid or reset them. Used in copy constructor and assignment operator.

Definition at line 126 of file G4VCSGfaceted.cc.

127{
128 numFace = source.numFace;
129 if (numFace == 0) { return; } // odd, but permissable?
130
131 faces = new G4VCSGface*[numFace];
132
133 G4VCSGface **face = faces,
134 **sourceFace = source.faces;
135 do // Loop checking, 13.08.2015, G.Cosmo
136 {
137 *face = (*sourceFace)->Clone();
138 } while( ++sourceFace, ++face < faces+numFace );
139 fCubicVolume = source.fCubicVolume;
140 fSurfaceArea = source.fSurfaceArea;
141 fRebuildPolyhedron = false;
142 fpPolyhedron = nullptr;
143}
virtual G4VCSGface * Clone()=0
G4double fCubicVolume
G4bool fRebuildPolyhedron
G4double fSurfaceArea

Referenced by G4VCSGfaceted(), and operator=().

◆ CreatePolyhedron()

G4Polyhedron * G4VCSGfaceted::CreatePolyhedron ( ) const
overridepure virtual

Returns a pointer to a generated polyhedron used for visualisation.

Reimplemented from G4VSolid.

Implemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Referenced by GetPolyhedron().

◆ DeleteStuff()

void G4VCSGfaceted::DeleteStuff ( )
protected

Definition at line 151 of file G4VCSGfaceted.cc.

152{
153 if (numFace != 0)
154 {
155 G4VCSGface **face = faces;
156 do // Loop checking, 13.08.2015, G.Cosmo
157 {
158 delete *face;
159 } while( ++face < faces + numFace );
160
161 delete [] faces;
162 }
163 delete fpPolyhedron; fpPolyhedron = nullptr;
164}

Referenced by operator=(), G4Polycone::Reset(), G4Polyhedra::Reset(), and ~G4VCSGfaceted().

◆ DescribeYourselfTo()

void G4VCSGfaceted::DescribeYourselfTo ( G4VGraphicsScene & scene) const
overridevirtual

Methods for creating graphical representations (i.e. for visualisation).

Implements G4VSolid.

Definition at line 397 of file G4VCSGfaceted.cc.

398{
399 scene.AddSolid( *this );
400}
virtual void AddSolid(const G4Box &)=0

◆ DistanceTo()

G4double G4VCSGfaceted::DistanceTo ( const G4ThreeVector & p,
const G4bool outgoing ) const
protectedvirtual

Protected method used in DistanceToIn() and DistanceToOut().

Definition at line 379 of file G4VCSGfaceted.cc.

381{
382 G4VCSGface **face = faces;
383 G4double best = kInfinity;
384 do // Loop checking, 13.08.2015, G.Cosmo
385 {
386 G4double distance = (*face)->Distance( p, outgoing );
387 if (distance < best) { best = distance; }
388 } while( ++face < faces + numFace );
389
390 return (best < 0.5*kCarTolerance) ? 0. : best;
391}
double G4double
Definition G4Types.hh:83
G4double kCarTolerance
Definition G4VSolid.hh:418

Referenced by DistanceToIn(), and DistanceToOut().

◆ DistanceToIn() [1/2]

G4double G4VCSGfaceted::DistanceToIn ( const G4ThreeVector & p) const
overridevirtual

Calculates the distance to the nearest surface of a shape from an outside point. The distance can be an underestimate.

Parameters
[in]pThe point at offset p.
Returns
The safety distance to enter the shape.

Implements G4VSolid.

Definition at line 291 of file G4VCSGfaceted.cc.

292{
293 return DistanceTo( p, false );
294}
virtual G4double DistanceTo(const G4ThreeVector &p, const G4bool outgoing) const

◆ DistanceToIn() [2/2]

G4double G4VCSGfaceted::DistanceToIn ( const G4ThreeVector & p,
const G4ThreeVector & v ) const
overridevirtual

Returns the distance along the normalised vector 'v' to the shape, from the point at offset 'p'. If there is no intersection, returns kInfinity. The first intersection resulting from 'leaving' a surface/volume is discarded. Hence, it is tolerant of points on the surface of the shape.

Parameters
[in]pThe point at offset p.
[in]vThe normalised direction vector.
Returns
The distance to enter the shape.

Implements G4VSolid.

Definition at line 249 of file G4VCSGfaceted.cc.

251{
252 G4double distance = kInfinity;
253 G4double distFromSurface = kInfinity;
254 G4VCSGface **face = faces;
255 G4VCSGface *bestFace = *face;
256 do // Loop checking, 13.08.2015, G.Cosmo
257 {
258 G4double faceDistance,
259 faceDistFromSurface;
260 G4ThreeVector faceNormal;
261 G4bool faceAllBehind;
262 if ((*face)->Intersect( p, v, false, kCarTolerance/2,
263 faceDistance, faceDistFromSurface,
264 faceNormal, faceAllBehind ) )
265 {
266 //
267 // Intersecting face
268 //
269 if (faceDistance < distance)
270 {
271 distance = faceDistance;
272 distFromSurface = faceDistFromSurface;
273 bestFace = *face;
274 if (distFromSurface <= 0) { return 0; }
275 }
276 }
277 } while( ++face < faces + numFace );
278
279 if (distance < kInfinity && distFromSurface<kCarTolerance/2)
280 {
281 if (bestFace->Distance(p,false) < kCarTolerance/2) { distance = 0; }
282 }
283
284 return distance;
285}
CLHEP::Hep3Vector G4ThreeVector
bool G4bool
Definition G4Types.hh:86
virtual G4double Distance(const G4ThreeVector &p, G4bool outgoing)=0

Referenced by G4GenericPolycone::DistanceToIn(), G4GenericPolycone::DistanceToIn(), G4Polycone::DistanceToIn(), G4Polycone::DistanceToIn(), G4Polyhedra::DistanceToIn(), and G4Polyhedra::DistanceToIn().

◆ DistanceToOut() [1/2]

G4double G4VCSGfaceted::DistanceToOut ( const G4ThreeVector & p) const
overridevirtual

Calculates the distance to the nearest surface of a shape from an inside point 'p'. The distance can be an underestimate.

Parameters
[in]pThe point at offset p.
Returns
The safety distance to exit the shape.

Implements G4VSolid.

Definition at line 368 of file G4VCSGfaceted.cc.

369{
370 return DistanceTo( p, true );
371}

◆ DistanceToOut() [2/2]

G4double G4VCSGfaceted::DistanceToOut ( const G4ThreeVector & p,
const G4ThreeVector & v,
const G4bool calcNorm = false,
G4bool * validNorm = nullptr,
G4ThreeVector * n = nullptr ) const
overridevirtual

Returns the distance along the normalised vector 'v' to the shape, from a point at an offset 'p' inside or on the surface of the shape. Intersections with surfaces, when the point is less than Tolerance/2 from a surface must be ignored.

Parameters
[in]pThe point at offset p.
[in]vThe normalised direction vector.
[in]calcNormFlag to indicate if to calculate the normal or not.
[out]validNormFlag set to true if the solid lies entirely behind or on the exiting surface. It is set false if the solid does not lie entirely behind or on the exiting surface. 'calcNorm' must be true, otherwise it is unused.
[out]nThe exiting outwards normal vector (undefined Magnitude). 'calcNorm' must be true, otherwise it is unused.
Returns
The distance to exit the shape.

Implements G4VSolid.

Definition at line 300 of file G4VCSGfaceted.cc.

305{
306 G4bool allBehind = true;
307 G4double distance = kInfinity;
308 G4double distFromSurface = kInfinity;
309 G4ThreeVector normal;
310
311 G4VCSGface **face = faces;
312 G4VCSGface *bestFace = *face;
313 do // Loop checking, 13.08.2015, G.Cosmo
314 {
315 G4double faceDistance,
316 faceDistFromSurface;
317 G4ThreeVector faceNormal;
318 G4bool faceAllBehind;
319 if ((*face)->Intersect( p, v, true, kCarTolerance/2,
320 faceDistance, faceDistFromSurface,
321 faceNormal, faceAllBehind ) )
322 {
323 //
324 // Intersecting face
325 //
326 if ( (distance < kInfinity) || (!faceAllBehind) ) { allBehind = false; }
327 if (faceDistance < distance)
328 {
329 distance = faceDistance;
330 distFromSurface = faceDistFromSurface;
331 normal = faceNormal;
332 bestFace = *face;
333 if (distFromSurface <= 0.) { break; }
334 }
335 }
336 } while( ++face < faces + numFace );
337
338 if (distance < kInfinity)
339 {
340 if (distFromSurface <= 0.)
341 {
342 distance = 0.;
343 }
344 else if (distFromSurface<kCarTolerance/2)
345 {
346 if (bestFace->Distance(p,true) < kCarTolerance/2) { distance = 0.; }
347 }
348
349 if (calcNorm)
350 {
351 *validNorm = allBehind;
352 *n = normal;
353 }
354 }
355 else
356 {
357 if (Inside(p) == kSurface) { distance = 0.; }
358 if (calcNorm) { *validNorm = false; }
359 }
360
361 return distance;
362}
EInside Inside(const G4ThreeVector &p) const override
@ kSurface
Definition geomdefs.hh:69

◆ GetAreaAccuracy()

G4double G4VCSGfaceted::GetAreaAccuracy ( ) const

Definition at line 515 of file G4VCSGfaceted.cc.

516{
517 return fAreaAccuracy;
518}

◆ GetAreaStatistics()

G4int G4VCSGfaceted::GetAreaStatistics ( ) const

Definition at line 506 of file G4VCSGfaceted.cc.

507{
508 return fStatistics;
509}

◆ GetCubicVolume()

G4double G4VCSGfaceted::GetCubicVolume ( )
overridevirtual

Returning an estimation of the solid volume (capacity) and surface area, in internal units. Caches the computed value once computed the first time.

Reimplemented from G4VSolid.

Definition at line 544 of file G4VCSGfaceted.cc.

545{
546 if (fCubicVolume == 0)
547 {
548 G4AutoLock l(&vcsgMutex);
549 fCubicVolume = EstimateCubicVolume(fStatistics,fCubVolEpsilon);
550 l.unlock();
551 }
552 return fCubicVolume;
553}
G4TemplateAutoLock< G4Mutex > G4AutoLock
G4double EstimateCubicVolume(G4int nStat, G4double epsilon) const
Definition G4VSolid.cc:229

◆ GetCubVolEpsilon()

G4double G4VCSGfaceted::GetCubVolEpsilon ( ) const

Definition at line 477 of file G4VCSGfaceted.cc.

478{
479 return fCubVolEpsilon;
480}

◆ GetCubVolStatistics()

G4int G4VCSGfaceted::GetCubVolStatistics ( ) const

Accessors and modifiers for capacity and area computation.

Definition at line 468 of file G4VCSGfaceted.cc.

469{
470 return fStatistics;
471}

◆ GetEntityType()

G4GeometryType G4VCSGfaceted::GetEntityType ( ) const
overridevirtual

Returns the type ID, "G4CSGfaceted" of the solid.

Implements G4VSolid.

Definition at line 442 of file G4VCSGfaceted.cc.

443{
444 return {"G4CSGfaceted"};
445}

◆ GetExtent()

G4VisExtent G4VCSGfaceted::GetExtent ( ) const
overridevirtual

Provides extent (bounding box) as possible hint to the graphics view.

Reimplemented from G4VSolid.

Definition at line 408 of file G4VCSGfaceted.cc.

409{
410 static const G4ThreeVector xMax(1,0,0), xMin(-1,0,0),
411 yMax(0,1,0), yMin(0,-1,0),
412 zMax(0,0,1), zMin(0,0,-1);
413 static const G4ThreeVector *axes[6] =
414 { &xMin, &xMax, &yMin, &yMax, &zMin, &zMax };
415
416 G4double answers[6] =
417 {-kInfinity, -kInfinity, -kInfinity, -kInfinity, -kInfinity, -kInfinity};
418
419 G4VCSGface **face = faces;
420 do // Loop checking, 13.08.2015, G.Cosmo
421 {
422 const G4ThreeVector **axis = axes+5 ;
423 G4double* answer = answers+5;
424 do // Loop checking, 13.08.2015, G.Cosmo
425 {
426 G4double testFace = (*face)->Extent( **axis );
427 if (testFace > *answer) { *answer = testFace; }
428 }
429 while( --axis, --answer >= answers );
430
431 } while( ++face < faces + numFace );
432
433 return { -answers[0], answers[1],
434 -answers[2], answers[3],
435 -answers[4], answers[5] };
436}

◆ GetPointOnSurfaceGeneric()

G4ThreeVector G4VCSGfaceted::GetPointOnSurfaceGeneric ( ) const
protected

Returns a random point located on the surface of the solid in case of generic Polycone or generic Polyhedra.

Definition at line 595 of file G4VCSGfaceted.cc.

596{
597 // Preparing variables
598 //
599 G4ThreeVector answer=G4ThreeVector(0.,0.,0.);
600 G4VCSGface **face = faces;
601 G4double area = 0.;
602 G4int i;
603 std::vector<G4double> areas;
604
605 // First step: calculate surface areas
606 //
607 do // Loop checking, 13.08.2015, G.Cosmo
608 {
609 G4double result = (*face)->SurfaceArea( );
610 areas.push_back(result);
611 area=area+result;
612 } while( ++face < faces + numFace );
613
614 // Second Step: choose randomly one surface
615 //
616 G4VCSGface **face1 = faces;
617 G4double chose = area*G4QuickRand();
618 G4double Achose1, Achose2;
619 Achose1=0.; Achose2=0.;
620 i=0;
621
622 do
623 {
624 Achose2+=areas[i];
625 if(chose>=Achose1 && chose<Achose2)
626 {
627 G4ThreeVector point;
628 point= (*face1)->GetPointOnFace();
629 return point;
630 }
631 ++i;
632 Achose1=Achose2;
633 } while( ++face1 < faces + numFace );
634
635 return answer;
636}
G4double G4QuickRand(uint32_t seed=0)
int G4int
Definition G4Types.hh:85

◆ GetPolyhedron()

G4Polyhedron * G4VCSGfaceted::GetPolyhedron ( ) const
overridevirtual

Smart access function - creates on request and stores for future access. A null pointer means "not available".

Reimplemented from G4VSolid.

Definition at line 574 of file G4VCSGfaceted.cc.

575{
576 if (fpPolyhedron == nullptr ||
578 fpPolyhedron->GetNumberOfRotationStepsAtTimeOfCreation() !=
579 fpPolyhedron->GetNumberOfRotationSteps())
580 {
581 G4AutoLock l(&polyhedronMutex);
582 delete fpPolyhedron;
584 fRebuildPolyhedron = false;
585 l.unlock();
586 }
587 return fpPolyhedron;
588}
G4Polyhedron * CreatePolyhedron() const override=0

◆ GetSurfaceArea()

G4double G4VCSGfaceted::GetSurfaceArea ( )
overridevirtual

Returns an estimation of the solid surface area in internal units. This method may be overloaded by derived classes to compute the exact geometrical quantity for solids where this is possible, or anyway to cache the computed value. Note: the computed value is NOT cached.

Reimplemented from G4VSolid.

Definition at line 559 of file G4VCSGfaceted.cc.

560{
561 if (fSurfaceArea == 0)
562 {
563 G4AutoLock l(&vcsgMutex);
564 fSurfaceArea = EstimateSurfaceArea(fStatistics,fAreaAccuracy);
565 l.unlock();
566 }
567 return fSurfaceArea;
568}
G4double EstimateSurfaceArea(G4int nStat, G4double epsilon) const
Definition G4VSolid.cc:290

◆ Inside()

EInside G4VCSGfaceted::Inside ( const G4ThreeVector & p) const
overridevirtual

Concrete implementations of the expected query interfaces for solids, as defined in G4VSolid.

Implements G4VSolid.

Definition at line 202 of file G4VCSGfaceted.cc.

203{
204 EInside answer=kOutside;
205 G4VCSGface **face = faces;
206 G4double best = kInfinity;
207 do // Loop checking, 13.08.2015, G.Cosmo
208 {
209 G4double distance;
210 EInside result = (*face)->Inside( p, kCarTolerance/2, &distance );
211 if (result == kSurface) { return kSurface; }
212 if (distance < best)
213 {
214 best = distance;
215 answer = result;
216 }
217 } while( ++face < faces + numFace );
218
219 return answer;
220}
EInside
Definition geomdefs.hh:67
@ kOutside
Definition geomdefs.hh:68

Referenced by DistanceToOut(), G4GenericPolycone::Inside(), G4Polycone::Inside(), and G4Polyhedra::Inside().

◆ operator=()

G4VCSGfaceted & G4VCSGfaceted::operator= ( const G4VCSGfaceted & source)

Definition at line 100 of file G4VCSGfaceted.cc.

101{
102 if (&source == this) { return *this; }
103
104 // Copy base class data
105 //
106 G4VSolid::operator=(source);
107
108 // Copy data
109 //
110 fStatistics = source.fStatistics;
111 fCubVolEpsilon = source.fCubVolEpsilon;
112 fAreaAccuracy = source.fAreaAccuracy;
113
114 DeleteStuff();
115 CopyStuff( source );
116
117 return *this;
118}
G4VSolid & operator=(const G4VSolid &rhs)
Definition G4VSolid.cc:108

Referenced by G4GenericPolycone::operator=(), G4Polycone::operator=(), and G4Polyhedra::operator=().

◆ SetAreaAccuracy()

void G4VCSGfaceted::SetAreaAccuracy ( G4double ep)

Definition at line 534 of file G4VCSGfaceted.cc.

535{
536 fSurfaceArea=0.;
537 fAreaAccuracy=ep;
538}

◆ SetAreaStatistics()

void G4VCSGfaceted::SetAreaStatistics ( G4int st)

Definition at line 524 of file G4VCSGfaceted.cc.

525{
526 fSurfaceArea=0.;
527 fStatistics=st;
528}

◆ SetCubVolEpsilon()

void G4VCSGfaceted::SetCubVolEpsilon ( G4double ep)

Definition at line 496 of file G4VCSGfaceted.cc.

497{
498 fCubicVolume=0.;
499 fCubVolEpsilon=ep;
500}

◆ SetCubVolStatistics()

void G4VCSGfaceted::SetCubVolStatistics ( G4int st)

Definition at line 486 of file G4VCSGfaceted.cc.

487{
488 fCubicVolume=0.;
489 fStatistics=st;
490}

◆ StreamInfo()

std::ostream & G4VCSGfaceted::StreamInfo ( std::ostream & os) const
overridevirtual

Streams the object contents to an output stream.

Implements G4VSolid.

Definition at line 451 of file G4VCSGfaceted.cc.

452{
453 os << "-----------------------------------------------------------\n"
454 << " *** Dump for solid - " << GetName() << " ***\n"
455 << " ===================================================\n"
456 << " Solid type: G4VCSGfaceted\n"
457 << " Parameters: \n"
458 << " number of faces: " << numFace << "\n"
459 << "-----------------------------------------------------------\n";
460
461 return os;
462}
G4String GetName() const

◆ SurfaceNormal()

G4ThreeVector G4VCSGfaceted::SurfaceNormal ( const G4ThreeVector & p) const
overridevirtual

Returns the outwards pointing unit normal of the shape for the surface closest to the point at offset 'p'.

Parameters
[in]pThe point at offset p.
Returns
The outwards pointing unit normal.

Implements G4VSolid.

Definition at line 226 of file G4VCSGfaceted.cc.

227{
228 G4ThreeVector answer;
229 G4VCSGface **face = faces;
230 G4double best = kInfinity;
231 do // Loop checking, 13.08.2015, G.Cosmo
232 {
233 G4double distance = kInfinity;
234 G4ThreeVector normal = (*face)->Normal( p, &distance );
235 if (distance < best)
236 {
237 best = distance;
238 answer = normal;
239 }
240 } while( ++face < faces + numFace );
241
242 return answer;
243}

Member Data Documentation

◆ faces

◆ fCubicVolume

◆ fpPolyhedron

G4Polyhedron* G4VCSGfaceted::fpPolyhedron = nullptr
mutableprotected

◆ fRebuildPolyhedron

G4bool G4VCSGfaceted::fRebuildPolyhedron = false
mutableprotected

Definition at line 175 of file G4VCSGfaceted.hh.

Referenced by CopyStuff(), and GetPolyhedron().

◆ fSurfaceArea

◆ numFace


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