Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
G4VCSGfaceted Class Referenceabstract

#include <G4VCSGfaceted.hh>

Inheritance diagram for G4VCSGfaceted:
G4VSolid G4GenericPolycone G4Polycone G4Polyhedra

Public Member Functions

 G4VCSGfaceted (const G4String &name)
 
virtual ~G4VCSGfaceted ()
 
 G4VCSGfaceted (const G4VCSGfaceted &source)
 
const 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=0, G4ThreeVector *n=0) 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 ComputeDimensions (G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
 
virtual G4ThreeVector GetPointOnSurface () 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__ &)
 
 G4VSolid (const G4VSolid &rhs)
 
G4VSolidoperator= (const G4VSolid &rhs)
 

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
 
G4double EstimateCubicVolume (G4int nStat, G4double epsilon) const
 
G4double EstimateSurfaceArea (G4int nStat, G4double ell) const
 

Protected Attributes

G4int numFace
 
G4VCSGface ** faces
 
G4double fCubicVolume
 
G4double fSurfaceArea
 
G4PolyhedronfpPolyhedron
 
- Protected Attributes inherited from G4VSolid
G4double kCarTolerance
 

Detailed Description

Definition at line 53 of file G4VCSGfaceted.hh.

Constructor & Destructor Documentation

G4VCSGfaceted::G4VCSGfaceted ( const G4String name)

Definition at line 62 of file G4VCSGfaceted.cc.

63  : G4VSolid(name),
64  numFace(0), faces(0), fCubicVolume(0.), fSurfaceArea(0.), fpPolyhedron(0),
65  fStatistics(1000000), fCubVolEpsilon(0.001), fAreaAccuracy(-1.)
66 {
67 }
G4double fSurfaceArea
G4Polyhedron * fpPolyhedron
G4double fCubicVolume
G4VCSGface ** faces
G4VSolid(const G4String &name)
Definition: G4VSolid.cc:60
G4VCSGfaceted::~G4VCSGfaceted ( )
virtual

Definition at line 84 of file G4VCSGfaceted.cc.

References DeleteStuff(), and fpPolyhedron.

85 {
86  DeleteStuff();
87  delete fpPolyhedron;
88 }
G4Polyhedron * fpPolyhedron
G4VCSGfaceted::G4VCSGfaceted ( const G4VCSGfaceted source)

Definition at line 94 of file G4VCSGfaceted.cc.

References CopyStuff().

95  : G4VSolid( source )
96 {
97  fStatistics = source.fStatistics;
98  fCubVolEpsilon = source.fCubVolEpsilon;
99  fAreaAccuracy = source.fAreaAccuracy;
100 
101  CopyStuff( source );
102 }
void CopyStuff(const G4VCSGfaceted &source)
G4VSolid(const G4String &name)
Definition: G4VSolid.cc:60
G4VCSGfaceted::G4VCSGfaceted ( __void__ &  a)

Definition at line 74 of file G4VCSGfaceted.cc.

75  : G4VSolid(a),
76  numFace(0), faces(0), fCubicVolume(0.), fSurfaceArea(0.), fpPolyhedron(0),
77  fStatistics(1000000), fCubVolEpsilon(0.001), fAreaAccuracy(-1.)
78 {
79 }
G4double fSurfaceArea
G4Polyhedron * fpPolyhedron
G4double fCubicVolume
G4VCSGface ** faces
G4VSolid(const G4String &name)
Definition: G4VSolid.cc:60

Member Function Documentation

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

Implements G4VSolid.

Definition at line 176 of file G4VCSGfaceted.cc.

References G4VCSGface::CalculateExtent(), faces, G4SolidExtentList::GetExtent(), and numFace.

181 {
182  G4SolidExtentList extentList( axis, voxelLimit );
183 
184  //
185  // Loop over all faces, checking min/max extent as we go.
186  //
187  G4VCSGface **face = faces;
188  do
189  {
190  (*face)->CalculateExtent( axis, voxelLimit, transform, extentList );
191  } while( ++face < faces + numFace );
192 
193  //
194  // Return min/max value
195  //
196  return extentList.GetExtent( min, max );
197 }
G4VCSGface ** faces
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
virtual void CalculateExtent(const EAxis axis, const G4VoxelLimits &voxelLimit, const G4AffineTransform &tranform, G4SolidExtentList &extentList)=0
void G4VCSGfaceted::CopyStuff ( const G4VCSGfaceted source)
protected

Definition at line 134 of file G4VCSGfaceted.cc.

References G4VCSGface::Clone(), faces, fCubicVolume, fpPolyhedron, fSurfaceArea, and numFace.

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

135 {
136  numFace = source.numFace;
137  if (numFace == 0) { return; } // odd, but permissable?
138 
139  faces = new G4VCSGface*[numFace];
140 
141  G4VCSGface **face = faces,
142  **sourceFace = source.faces;
143  do
144  {
145  *face = (*sourceFace)->Clone();
146  } while( ++sourceFace, ++face < faces+numFace );
147  fCubicVolume = source.fCubicVolume;
148  fSurfaceArea = source.fSurfaceArea;
149  fpPolyhedron = 0;
150 }
G4double fSurfaceArea
G4Polyhedron * fpPolyhedron
virtual G4VCSGface * Clone()=0
G4double fCubicVolume
G4VCSGface ** faces
virtual G4Polyhedron* G4VCSGfaceted::CreatePolyhedron ( ) const
pure virtual

Reimplemented from G4VSolid.

Implemented in G4Polyhedra, G4Polycone, and G4GenericPolycone.

Referenced by GetPolyhedron().

void G4VCSGfaceted::DeleteStuff ( )
protected

Definition at line 158 of file G4VCSGfaceted.cc.

References faces, and numFace.

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

159 {
160  if (numFace)
161  {
162  G4VCSGface **face = faces;
163  do
164  {
165  delete *face;
166  } while( ++face < faces + numFace );
167 
168  delete [] faces;
169  }
170 }
G4VCSGface ** faces
void G4VCSGfaceted::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 403 of file G4VCSGfaceted.cc.

References G4VGraphicsScene::AddSolid().

404 {
405  scene.AddSolid( *this );
406 }
virtual void AddSolid(const G4Box &)=0
G4double G4VCSGfaceted::DistanceTo ( const G4ThreeVector p,
const G4bool  outgoing 
) const
protectedvirtual

Definition at line 385 of file G4VCSGfaceted.cc.

References G4VCSGface::Distance(), faces, G4VSolid::kCarTolerance, and numFace.

Referenced by DistanceToIn(), and DistanceToOut().

387 {
388  G4VCSGface **face = faces;
389  G4double best = kInfinity;
390  do
391  {
392  G4double distance = (*face)->Distance( p, outgoing );
393  if (distance < best) { best = distance; }
394  } while( ++face < faces + numFace );
395 
396  return (best < 0.5*kCarTolerance) ? 0 : best;
397 }
G4VCSGface ** faces
G4double kCarTolerance
Definition: G4VSolid.hh:305
double G4double
Definition: G4Types.hh:76
virtual G4double Distance(const G4ThreeVector &p, G4bool outgoing)=0
G4double G4VCSGfaceted::DistanceToIn ( const G4ThreeVector p,
const G4ThreeVector v 
) const
virtual

Implements G4VSolid.

Reimplemented in G4Polycone, G4Polyhedra, and G4GenericPolycone.

Definition at line 255 of file G4VCSGfaceted.cc.

References G4VCSGface::Distance(), faces, G4VSolid::kCarTolerance, and numFace.

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

257 {
258  G4double distance = kInfinity;
259  G4double distFromSurface = kInfinity;
260  G4VCSGface **face = faces;
261  G4VCSGface *bestFace = *face;
262  do
263  {
264  G4double faceDistance,
265  faceDistFromSurface;
266  G4ThreeVector faceNormal;
267  G4bool faceAllBehind;
268  if ((*face)->Intersect( p, v, false, kCarTolerance/2,
269  faceDistance, faceDistFromSurface,
270  faceNormal, faceAllBehind ) )
271  {
272  //
273  // Intersecting face
274  //
275  if (faceDistance < distance)
276  {
277  distance = faceDistance;
278  distFromSurface = faceDistFromSurface;
279  bestFace = *face;
280  if (distFromSurface <= 0) { return 0; }
281  }
282  }
283  } while( ++face < faces + numFace );
284 
285  if (distance < kInfinity && distFromSurface<kCarTolerance/2)
286  {
287  if (bestFace->Distance(p,false) < kCarTolerance/2) { distance = 0; }
288  }
289 
290  return distance;
291 }
bool G4bool
Definition: G4Types.hh:79
G4VCSGface ** faces
G4double kCarTolerance
Definition: G4VSolid.hh:305
double G4double
Definition: G4Types.hh:76
virtual G4double Distance(const G4ThreeVector &p, G4bool outgoing)=0
G4double G4VCSGfaceted::DistanceToIn ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Reimplemented in G4Polyhedra, G4Polycone, and G4GenericPolycone.

Definition at line 297 of file G4VCSGfaceted.cc.

References DistanceTo().

298 {
299  return DistanceTo( p, false );
300 }
virtual G4double DistanceTo(const G4ThreeVector &p, const G4bool outgoing) const
G4double G4VCSGfaceted::DistanceToOut ( const G4ThreeVector p,
const G4ThreeVector v,
const G4bool  calcNorm = false,
G4bool validNorm = 0,
G4ThreeVector n = 0 
) const
virtual

Implements G4VSolid.

Definition at line 306 of file G4VCSGfaceted.cc.

References G4VCSGface::Distance(), faces, Inside(), G4VSolid::kCarTolerance, kSurface, and numFace.

311 {
312  G4bool allBehind = true;
313  G4double distance = kInfinity;
314  G4double distFromSurface = kInfinity;
315  G4ThreeVector normal;
316 
317  G4VCSGface **face = faces;
318  G4VCSGface *bestFace = *face;
319  do
320  {
321  G4double faceDistance,
322  faceDistFromSurface;
323  G4ThreeVector faceNormal;
324  G4bool faceAllBehind;
325  if ((*face)->Intersect( p, v, true, kCarTolerance/2,
326  faceDistance, faceDistFromSurface,
327  faceNormal, faceAllBehind ) )
328  {
329  //
330  // Intersecting face
331  //
332  if ( (distance < kInfinity) || (!faceAllBehind) ) { allBehind = false; }
333  if (faceDistance < distance)
334  {
335  distance = faceDistance;
336  distFromSurface = faceDistFromSurface;
337  normal = faceNormal;
338  bestFace = *face;
339  if (distFromSurface <= 0) { break; }
340  }
341  }
342  } while( ++face < faces + numFace );
343 
344  if (distance < kInfinity)
345  {
346  if (distFromSurface <= 0)
347  {
348  distance = 0;
349  }
350  else if (distFromSurface<kCarTolerance/2)
351  {
352  if (bestFace->Distance(p,true) < kCarTolerance/2) { distance = 0; }
353  }
354 
355  if (calcNorm)
356  {
357  *validNorm = allBehind;
358  *n = normal;
359  }
360  }
361  else
362  {
363  if (Inside(p) == kSurface) { distance = 0; }
364  if (calcNorm) { *validNorm = false; }
365  }
366 
367  return distance;
368 }
bool G4bool
Definition: G4Types.hh:79
G4VCSGface ** faces
G4double kCarTolerance
Definition: G4VSolid.hh:305
double G4double
Definition: G4Types.hh:76
virtual EInside Inside(const G4ThreeVector &p) const
virtual G4double Distance(const G4ThreeVector &p, G4bool outgoing)=0
G4double G4VCSGfaceted::DistanceToOut ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 374 of file G4VCSGfaceted.cc.

References DistanceTo().

375 {
376  return DistanceTo( p, true );
377 }
virtual G4double DistanceTo(const G4ThreeVector &p, const G4bool outgoing) const
G4double G4VCSGfaceted::GetAreaAccuracy ( ) const

Definition at line 521 of file G4VCSGfaceted.cc.

522 {
523  return fAreaAccuracy;
524 }
G4int G4VCSGfaceted::GetAreaStatistics ( ) const

Definition at line 512 of file G4VCSGfaceted.cc.

513 {
514  return fStatistics;
515 }
G4double G4VCSGfaceted::GetCubicVolume ( )
virtual

Reimplemented from G4VSolid.

Definition at line 550 of file G4VCSGfaceted.cc.

References G4VSolid::EstimateCubicVolume(), and fCubicVolume.

551 {
552  if(fCubicVolume != 0.) {;}
553  else { fCubicVolume = EstimateCubicVolume(fStatistics,fCubVolEpsilon); }
554  return fCubicVolume;
555 }
G4double EstimateCubicVolume(G4int nStat, G4double epsilon) const
Definition: G4VSolid.cc:203
G4double fCubicVolume
G4double G4VCSGfaceted::GetCubVolEpsilon ( ) const

Definition at line 483 of file G4VCSGfaceted.cc.

484 {
485  return fCubVolEpsilon;
486 }
G4int G4VCSGfaceted::GetCubVolStatistics ( ) const

Definition at line 474 of file G4VCSGfaceted.cc.

475 {
476  return fStatistics;
477 }
G4GeometryType G4VCSGfaceted::GetEntityType ( ) const
virtual

Implements G4VSolid.

Reimplemented in G4Polycone, G4Polyhedra, and G4GenericPolycone.

Definition at line 448 of file G4VCSGfaceted.cc.

449 {
450  return G4String("G4CSGfaceted");
451 }
G4VisExtent G4VCSGfaceted::GetExtent ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 414 of file G4VCSGfaceted.cc.

References faces, and numFace.

415 {
416  static const G4ThreeVector xMax(1,0,0), xMin(-1,0,0),
417  yMax(0,1,0), yMin(0,-1,0),
418  zMax(0,0,1), zMin(0,0,-1);
419  static const G4ThreeVector *axes[6] =
420  { &xMin, &xMax, &yMin, &yMax, &zMin, &zMax };
421 
422  G4double answers[6] =
423  {-kInfinity, -kInfinity, -kInfinity, -kInfinity, -kInfinity, -kInfinity};
424 
425  G4VCSGface **face = faces;
426  do
427  {
428  const G4ThreeVector **axis = axes+5 ;
429  G4double *answer = answers+5;
430  do
431  {
432  G4double testFace = (*face)->Extent( **axis );
433  if (testFace > *answer) { *answer = testFace; }
434  }
435  while( --axis, --answer >= answers );
436 
437  } while( ++face < faces + numFace );
438 
439  return G4VisExtent( -answers[0], answers[1],
440  -answers[2], answers[3],
441  -answers[4], answers[5] );
442 }
G4VCSGface ** faces
double G4double
Definition: G4Types.hh:76
G4ThreeVector G4VCSGfaceted::GetPointOnSurfaceGeneric ( ) const
protected

Definition at line 589 of file G4VCSGfaceted.cc.

References faces, G4UniformRand, numFace, and G4VCSGface::SurfaceArea().

Referenced by G4GenericPolycone::GetPointOnSurface(), and G4Polyhedra::GetPointOnSurface().

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

Reimplemented from G4VSolid.

Definition at line 572 of file G4VCSGfaceted.cc.

References CreatePolyhedron(), fpPolyhedron, HepPolyhedron::GetNumberOfRotationSteps(), and G4Polyhedron::GetNumberOfRotationStepsAtTimeOfCreation().

573 {
574  if (!fpPolyhedron ||
577  {
578  delete fpPolyhedron;
580  }
581  return fpPolyhedron;
582 }
G4Polyhedron * fpPolyhedron
virtual G4Polyhedron * CreatePolyhedron() const =0
static G4int GetNumberOfRotationSteps()
G4int GetNumberOfRotationStepsAtTimeOfCreation() const
G4double G4VCSGfaceted::GetSurfaceArea ( )
virtual

Reimplemented from G4VSolid.

Definition at line 561 of file G4VCSGfaceted.cc.

References G4VSolid::EstimateSurfaceArea(), and fSurfaceArea.

562 {
563  if(fSurfaceArea != 0.) {;}
564  else { fSurfaceArea = EstimateSurfaceArea(fStatistics,fAreaAccuracy); }
565  return fSurfaceArea;
566 }
G4double fSurfaceArea
G4double EstimateSurfaceArea(G4int nStat, G4double ell) const
Definition: G4VSolid.cc:263
EInside G4VCSGfaceted::Inside ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Reimplemented in G4Polycone, G4Polyhedra, and G4GenericPolycone.

Definition at line 208 of file G4VCSGfaceted.cc.

References faces, G4VCSGface::Inside(), G4VSolid::kCarTolerance, kOutside, kSurface, and numFace.

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

209 {
210  EInside answer=kOutside;
211  G4VCSGface **face = faces;
212  G4double best = kInfinity;
213  do
214  {
215  G4double distance;
216  EInside result = (*face)->Inside( p, kCarTolerance/2, &distance );
217  if (result == kSurface) { return kSurface; }
218  if (distance < best)
219  {
220  best = distance;
221  answer = result;
222  }
223  } while( ++face < faces + numFace );
224 
225  return answer;
226 }
G4VCSGface ** faces
EInside
Definition: geomdefs.hh:58
virtual EInside Inside(const G4ThreeVector &p, G4double tolerance, G4double *bestDistance)=0
G4double kCarTolerance
Definition: G4VSolid.hh:305
double G4double
Definition: G4Types.hh:76
const G4VCSGfaceted & G4VCSGfaceted::operator= ( const G4VCSGfaceted source)

Definition at line 108 of file G4VCSGfaceted.cc.

References CopyStuff(), DeleteStuff(), and G4VSolid::operator=().

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

109 {
110  if (&source == this) { return *this; }
111 
112  // Copy base class data
113  //
114  G4VSolid::operator=(source);
115 
116  // Copy data
117  //
118  fStatistics = source.fStatistics;
119  fCubVolEpsilon = source.fCubVolEpsilon;
120  fAreaAccuracy = source.fAreaAccuracy;
121 
122  DeleteStuff();
123  CopyStuff( source );
124 
125  return *this;
126 }
void CopyStuff(const G4VCSGfaceted &source)
G4VSolid & operator=(const G4VSolid &rhs)
Definition: G4VSolid.cc:110
void G4VCSGfaceted::SetAreaAccuracy ( G4double  ep)

Definition at line 540 of file G4VCSGfaceted.cc.

References fSurfaceArea.

541 {
542  fSurfaceArea=0.;
543  fAreaAccuracy=ep;
544 }
G4double fSurfaceArea
void G4VCSGfaceted::SetAreaStatistics ( G4int  st)

Definition at line 530 of file G4VCSGfaceted.cc.

References fSurfaceArea.

531 {
532  fSurfaceArea=0.;
533  fStatistics=st;
534 }
G4double fSurfaceArea
void G4VCSGfaceted::SetCubVolEpsilon ( G4double  ep)

Definition at line 502 of file G4VCSGfaceted.cc.

References fCubicVolume.

503 {
504  fCubicVolume=0.;
505  fCubVolEpsilon=ep;
506 }
G4double fCubicVolume
void G4VCSGfaceted::SetCubVolStatistics ( G4int  st)

Definition at line 492 of file G4VCSGfaceted.cc.

References fCubicVolume.

493 {
494  fCubicVolume=0.;
495  fStatistics=st;
496 }
G4double fCubicVolume
std::ostream & G4VCSGfaceted::StreamInfo ( std::ostream &  os) const
virtual

Implements G4VSolid.

Reimplemented in G4Polyhedra, G4Polycone, and G4GenericPolycone.

Definition at line 457 of file G4VCSGfaceted.cc.

References G4VSolid::GetName(), and numFace.

458 {
459  os << "-----------------------------------------------------------\n"
460  << " *** Dump for solid - " << GetName() << " ***\n"
461  << " ===================================================\n"
462  << " Solid type: G4VCSGfaceted\n"
463  << " Parameters: \n"
464  << " number of faces: " << numFace << "\n"
465  << "-----------------------------------------------------------\n";
466 
467  return os;
468 }
G4String GetName() const
G4ThreeVector G4VCSGfaceted::SurfaceNormal ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 232 of file G4VCSGfaceted.cc.

References faces, and numFace.

233 {
234  G4ThreeVector answer;
235  G4VCSGface **face = faces;
236  G4double best = kInfinity;
237  do
238  {
239  G4double distance;
240  G4ThreeVector normal = (*face)->Normal( p, &distance );
241  if (distance < best)
242  {
243  best = distance;
244  answer = normal;
245  }
246  } while( ++face < faces + numFace );
247 
248  return answer;
249 }
G4VCSGface ** faces
double G4double
Definition: G4Types.hh:76

Field Documentation

G4VCSGface** G4VCSGfaceted::faces
protected
G4double G4VCSGfaceted::fCubicVolume
protected

Definition at line 121 of file G4VCSGfaceted.hh.

Referenced by CopyStuff(), GetCubicVolume(), SetCubVolEpsilon(), and SetCubVolStatistics().

G4Polyhedron* G4VCSGfaceted::fpPolyhedron
mutableprotected

Definition at line 123 of file G4VCSGfaceted.hh.

Referenced by CopyStuff(), GetPolyhedron(), and ~G4VCSGfaceted().

G4double G4VCSGfaceted::fSurfaceArea
protected

Definition at line 122 of file G4VCSGfaceted.hh.

Referenced by CopyStuff(), GetSurfaceArea(), SetAreaAccuracy(), and SetAreaStatistics().

G4int G4VCSGfaceted::numFace
protected

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