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

#include <G4VCSGfaceted.hh>

+ Inheritance diagram for G4VCSGfaceted:

Public Member Functions

 G4VCSGfaceted (const G4String &name)
 
virtual ~G4VCSGfaceted ()
 
 G4VCSGfaceted (const G4VCSGfaceted &source)
 
G4VCSGfacetedoperator= (const G4VCSGfaceted &source)
 
virtual G4bool CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
 
virtual EInside Inside (const G4ThreeVector &p) const
 
virtual G4ThreeVector SurfaceNormal (const G4ThreeVector &p) const
 
virtual G4double DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const
 
virtual G4double DistanceToIn (const G4ThreeVector &p) const
 
virtual G4double DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const
 
virtual G4double DistanceToOut (const G4ThreeVector &p) const
 
virtual G4GeometryType GetEntityType () const
 
virtual std::ostream & StreamInfo (std::ostream &os) const
 
virtual G4PolyhedronCreatePolyhedron () const =0
 
virtual void DescribeYourselfTo (G4VGraphicsScene &scene) const
 
virtual G4VisExtent GetExtent () const
 
virtual G4PolyhedronGetPolyhedron () 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)
 
virtual G4double GetCubicVolume ()
 
virtual G4double GetSurfaceArea ()
 
 G4VCSGfaceted (__void__ &)
 
- 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

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

Definition at line 43 of file G4VCSGfaceted.hh.

Constructor & Destructor Documentation

◆ G4VCSGfaceted() [1/3]

G4VCSGfaceted::G4VCSGfaceted ( const G4String name)

Definition at line 55 of file G4VCSGfaceted.cc.

56 : G4VSolid(name),
57 fStatistics(1000000), fCubVolEpsilon(0.001), fAreaAccuracy(-1.)
58{
59}

◆ ~G4VCSGfaceted()

G4VCSGfaceted::~G4VCSGfaceted ( )
virtual

Definition at line 75 of file G4VCSGfaceted.cc.

76{
78 delete fpPolyhedron; fpPolyhedron = nullptr;
79}
G4Polyhedron * fpPolyhedron

◆ G4VCSGfaceted() [2/3]

G4VCSGfaceted::G4VCSGfaceted ( const G4VCSGfaceted source)

Definition at line 85 of file G4VCSGfaceted.cc.

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

◆ G4VCSGfaceted() [3/3]

G4VCSGfaceted::G4VCSGfaceted ( __void__ &  a)

Definition at line 66 of file G4VCSGfaceted.cc.

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

Member Function Documentation

◆ CalculateExtent()

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

Implements G4VSolid.

Reimplemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Definition at line 169 of file G4VCSGfaceted.cc.

174{
175 G4SolidExtentList extentList( axis, voxelLimit );
176
177 //
178 // Loop over all faces, checking min/max extent as we go.
179 //
180 G4VCSGface **face = faces;
181 do // Loop checking, 13.08.2015, G.Cosmo
182 {
183 (*face)->CalculateExtent( axis, voxelLimit, transform, extentList );
184 } while( ++face < faces + numFace );
185
186 //
187 // Return min/max value
188 //
189 return extentList.GetExtent( min, max );
190}
virtual void CalculateExtent(const EAxis axis, const G4VoxelLimits &voxelLimit, const G4AffineTransform &tranform, G4SolidExtentList &extentList)=0
G4VCSGface ** faces

◆ CopyStuff()

void G4VCSGfaceted::CopyStuff ( const G4VCSGfaceted source)
protected

Definition at line 125 of file G4VCSGfaceted.cc.

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

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

◆ CreatePolyhedron()

virtual G4Polyhedron * G4VCSGfaceted::CreatePolyhedron ( ) const
pure virtual

Reimplemented from G4VSolid.

Implemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Referenced by GetPolyhedron().

◆ DeleteStuff()

void G4VCSGfaceted::DeleteStuff ( )
protected

Definition at line 150 of file G4VCSGfaceted.cc.

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

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

◆ DescribeYourselfTo()

void G4VCSGfaceted::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 396 of file G4VCSGfaceted.cc.

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

◆ DistanceTo()

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

Definition at line 378 of file G4VCSGfaceted.cc.

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

Referenced by DistanceToIn(), and DistanceToOut().

◆ DistanceToIn() [1/2]

G4double G4VCSGfaceted::DistanceToIn ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Reimplemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Definition at line 290 of file G4VCSGfaceted.cc.

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

◆ DistanceToIn() [2/2]

G4double G4VCSGfaceted::DistanceToIn ( const G4ThreeVector p,
const G4ThreeVector v 
) const
virtual

Implements G4VSolid.

Reimplemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Definition at line 248 of file G4VCSGfaceted.cc.

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

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

◆ DistanceToOut() [1/2]

G4double G4VCSGfaceted::DistanceToOut ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 367 of file G4VCSGfaceted.cc.

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

◆ DistanceToOut() [2/2]

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

Implements G4VSolid.

Definition at line 299 of file G4VCSGfaceted.cc.

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

◆ GetAreaAccuracy()

G4double G4VCSGfaceted::GetAreaAccuracy ( ) const

Definition at line 514 of file G4VCSGfaceted.cc.

515{
516 return fAreaAccuracy;
517}

◆ GetAreaStatistics()

G4int G4VCSGfaceted::GetAreaStatistics ( ) const

Definition at line 505 of file G4VCSGfaceted.cc.

506{
507 return fStatistics;
508}

◆ GetCubicVolume()

G4double G4VCSGfaceted::GetCubicVolume ( )
virtual

Reimplemented from G4VSolid.

Reimplemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Definition at line 543 of file G4VCSGfaceted.cc.

544{
545 if(fCubicVolume != 0.) {;}
546 else { fCubicVolume = EstimateCubicVolume(fStatistics,fCubVolEpsilon); }
547 return fCubicVolume;
548}
G4double EstimateCubicVolume(G4int nStat, G4double epsilon) const
Definition: G4VSolid.cc:191

◆ GetCubVolEpsilon()

G4double G4VCSGfaceted::GetCubVolEpsilon ( ) const

Definition at line 476 of file G4VCSGfaceted.cc.

477{
478 return fCubVolEpsilon;
479}

◆ GetCubVolStatistics()

G4int G4VCSGfaceted::GetCubVolStatistics ( ) const

Definition at line 467 of file G4VCSGfaceted.cc.

468{
469 return fStatistics;
470}

◆ GetEntityType()

G4GeometryType G4VCSGfaceted::GetEntityType ( ) const
virtual

Implements G4VSolid.

Reimplemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Definition at line 441 of file G4VCSGfaceted.cc.

442{
443 return G4String("G4CSGfaceted");
444}

◆ GetExtent()

G4VisExtent G4VCSGfaceted::GetExtent ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 407 of file G4VCSGfaceted.cc.

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

◆ GetPointOnSurfaceGeneric()

G4ThreeVector G4VCSGfaceted::GetPointOnSurfaceGeneric ( ) const
protected

Definition at line 586 of file G4VCSGfaceted.cc.

587{
588 // Preparing variables
589 //
590 G4ThreeVector answer=G4ThreeVector(0.,0.,0.);
591 G4VCSGface **face = faces;
592 G4double area = 0.;
593 G4int i;
594 std::vector<G4double> areas;
595
596 // First step: calculate surface areas
597 //
598 do // Loop checking, 13.08.2015, G.Cosmo
599 {
600 G4double result = (*face)->SurfaceArea( );
601 areas.push_back(result);
602 area=area+result;
603 } while( ++face < faces + numFace );
604
605 // Second Step: choose randomly one surface
606 //
607 G4VCSGface **face1 = faces;
608 G4double chose = area*G4UniformRand();
609 G4double Achose1, Achose2;
610 Achose1=0.; Achose2=0.;
611 i=0;
612
613 do
614 {
615 Achose2+=areas[i];
616 if(chose>=Achose1 && chose<Achose2)
617 {
618 G4ThreeVector point;
619 point= (*face1)->GetPointOnFace();
620 return point;
621 }
622 ++i;
623 Achose1=Achose2;
624 } while( ++face1 < faces + numFace );
625
626 return answer;
627}
CLHEP::Hep3Vector G4ThreeVector
int G4int
Definition: G4Types.hh:85
#define G4UniformRand()
Definition: Randomize.hh:52
virtual G4double SurfaceArea()=0

◆ GetPolyhedron()

G4Polyhedron * G4VCSGfaceted::GetPolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 565 of file G4VCSGfaceted.cc.

566{
567 if (fpPolyhedron == nullptr ||
571 {
572 G4AutoLock l(&polyhedronMutex);
573 delete fpPolyhedron;
575 fRebuildPolyhedron = false;
576 l.unlock();
577 }
578 return fpPolyhedron;
579}
G4int GetNumberOfRotationStepsAtTimeOfCreation() const
virtual G4Polyhedron * CreatePolyhedron() const =0
static G4int GetNumberOfRotationSteps()

◆ GetSurfaceArea()

G4double G4VCSGfaceted::GetSurfaceArea ( )
virtual

Reimplemented from G4VSolid.

Reimplemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Definition at line 554 of file G4VCSGfaceted.cc.

555{
556 if(fSurfaceArea != 0.) {;}
557 else { fSurfaceArea = EstimateSurfaceArea(fStatistics,fAreaAccuracy); }
558 return fSurfaceArea;
559}
G4double EstimateSurfaceArea(G4int nStat, G4double ell) const
Definition: G4VSolid.cc:253

◆ Inside()

EInside G4VCSGfaceted::Inside ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Reimplemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Definition at line 201 of file G4VCSGfaceted.cc.

202{
203 EInside answer=kOutside;
204 G4VCSGface **face = faces;
205 G4double best = kInfinity;
206 do // Loop checking, 13.08.2015, G.Cosmo
207 {
208 G4double distance;
209 EInside result = (*face)->Inside( p, kCarTolerance/2, &distance );
210 if (result == kSurface) { return kSurface; }
211 if (distance < best)
212 {
213 best = distance;
214 answer = result;
215 }
216 } while( ++face < faces + numFace );
217
218 return answer;
219}
virtual EInside Inside(const G4ThreeVector &p, G4double tolerance, G4double *bestDistance)=0
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 99 of file G4VCSGfaceted.cc.

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

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

◆ SetAreaAccuracy()

void G4VCSGfaceted::SetAreaAccuracy ( G4double  ep)

Definition at line 533 of file G4VCSGfaceted.cc.

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

◆ SetAreaStatistics()

void G4VCSGfaceted::SetAreaStatistics ( G4int  st)

Definition at line 523 of file G4VCSGfaceted.cc.

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

◆ SetCubVolEpsilon()

void G4VCSGfaceted::SetCubVolEpsilon ( G4double  ep)

Definition at line 495 of file G4VCSGfaceted.cc.

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

◆ SetCubVolStatistics()

void G4VCSGfaceted::SetCubVolStatistics ( G4int  st)

Definition at line 485 of file G4VCSGfaceted.cc.

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

◆ StreamInfo()

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

Implements G4VSolid.

Reimplemented in G4GenericPolycone, G4Polycone, and G4Polyhedra.

Definition at line 450 of file G4VCSGfaceted.cc.

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

◆ SurfaceNormal()

G4ThreeVector G4VCSGfaceted::SurfaceNormal ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 225 of file G4VCSGfaceted.cc.

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

Member Data Documentation

◆ faces

◆ fCubicVolume

◆ fpPolyhedron

◆ fRebuildPolyhedron

G4bool G4VCSGfaceted::fRebuildPolyhedron = false
mutableprotected

◆ fSurfaceArea

◆ numFace


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