Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4IntersectionSolid Class Reference

#include <G4IntersectionSolid.hh>

Inheritance diagram for G4IntersectionSolid:
Collaboration diagram for G4IntersectionSolid:

Public Member Functions

 G4IntersectionSolid (const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
 
 G4IntersectionSolid (const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB, G4RotationMatrix *rotMatrix, const G4ThreeVector &transVector)
 
 G4IntersectionSolid (const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB, const G4Transform3D &transform)
 
virtual ~G4IntersectionSolid ()
 
G4GeometryType GetEntityType () const
 
G4VSolidClone () const
 
 G4IntersectionSolid (__void__ &)
 
 G4IntersectionSolid (const G4IntersectionSolid &rhs)
 
G4IntersectionSolidoperator= (const G4IntersectionSolid &rhs)
 
void Extent (G4ThreeVector &pMin, G4ThreeVector &pMax) const
 
G4bool CalculateExtent (const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
 
EInside Inside (const G4ThreeVector &p) const
 
G4ThreeVector SurfaceNormal (const G4ThreeVector &p) const
 
G4double DistanceToIn (const G4ThreeVector &p, const G4ThreeVector &v) const
 
G4double DistanceToIn (const G4ThreeVector &p) const
 
G4double DistanceToOut (const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
 
G4double DistanceToOut (const G4ThreeVector &p) const
 
void ComputeDimensions (G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
 
void DescribeYourselfTo (G4VGraphicsScene &scene) const
 
G4PolyhedronCreatePolyhedron () const
 
- Public Member Functions inherited from G4BooleanSolid
 G4BooleanSolid (const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
 
 G4BooleanSolid (const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB, G4RotationMatrix *rotMatrix, const G4ThreeVector &transVector)
 
 G4BooleanSolid (const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB, const G4Transform3D &transform)
 
virtual ~G4BooleanSolid ()
 
virtual const G4VSolidGetConstituentSolid (G4int no) const
 
virtual G4VSolidGetConstituentSolid (G4int no)
 
G4double GetCubicVolume ()
 
G4double GetSurfaceArea ()
 
virtual G4PolyhedronGetPolyhedron () const
 
std::ostream & StreamInfo (std::ostream &os) 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)
 
G4ThreeVector GetPointOnSurface () const
 
 G4BooleanSolid (__void__ &)
 
 G4BooleanSolid (const G4BooleanSolid &rhs)
 
G4BooleanSolidoperator= (const G4BooleanSolid &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
 
void DumpInfo () const
 
virtual G4VisExtent GetExtent () const
 
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
 

Additional Inherited Members

- Protected Member Functions inherited from G4BooleanSolid
void GetListOfPrimitives (std::vector< std::pair< G4VSolid *, G4Transform3D >> &, const G4Transform3D &) const
 
G4PolyhedronStackPolyhedron (HepPolyhedronProcessor &, const G4VSolid *) 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 inherited from G4BooleanSolid
G4VSolidfPtrSolidA
 
G4VSolidfPtrSolidB
 
- Protected Attributes inherited from G4VSolid
G4double kCarTolerance
 

Detailed Description

Definition at line 53 of file G4IntersectionSolid.hh.

Constructor & Destructor Documentation

G4IntersectionSolid::G4IntersectionSolid ( const G4String pName,
G4VSolid pSolidA,
G4VSolid pSolidB 
)

Definition at line 61 of file G4IntersectionSolid.cc.

64  : G4BooleanSolid(pName,pSolidA,pSolidB)
65 {
66 }
G4BooleanSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)

Here is the caller graph for this function:

G4IntersectionSolid::G4IntersectionSolid ( const G4String pName,
G4VSolid pSolidA,
G4VSolid pSolidB,
G4RotationMatrix rotMatrix,
const G4ThreeVector transVector 
)

Definition at line 71 of file G4IntersectionSolid.cc.

76  : G4BooleanSolid(pName,pSolidA,pSolidB,rotMatrix,transVector)
77 {
78 }
G4BooleanSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
G4IntersectionSolid::G4IntersectionSolid ( const G4String pName,
G4VSolid pSolidA,
G4VSolid pSolidB,
const G4Transform3D transform 
)

Definition at line 84 of file G4IntersectionSolid.cc.

88  : G4BooleanSolid(pName,pSolidA,pSolidB,transform)
89 {
90 }
G4BooleanSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
G4IntersectionSolid::~G4IntersectionSolid ( )
virtual

Definition at line 106 of file G4IntersectionSolid.cc.

107 {
108 }
G4IntersectionSolid::G4IntersectionSolid ( __void__ &  a)

Definition at line 97 of file G4IntersectionSolid.cc.

98  : G4BooleanSolid(a)
99 {
100 }
G4BooleanSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
G4IntersectionSolid::G4IntersectionSolid ( const G4IntersectionSolid rhs)

Definition at line 114 of file G4IntersectionSolid.cc.

115  : G4BooleanSolid (rhs)
116 {
117 }
G4BooleanSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)

Member Function Documentation

G4bool G4IntersectionSolid::CalculateExtent ( const EAxis  pAxis,
const G4VoxelLimits pVoxelLimit,
const G4AffineTransform pTransform,
G4double pMin,
G4double pMax 
) const
virtual

Implements G4VSolid.

Definition at line 176 of file G4IntersectionSolid.cc.

181 {
182  G4bool retA, retB, out;
183  G4double minA, minB, maxA, maxB;
184 
185  retA = fPtrSolidA
186  ->CalculateExtent( pAxis, pVoxelLimit, pTransform, minA, maxA);
187  retB = fPtrSolidB
188  ->CalculateExtent( pAxis, pVoxelLimit, pTransform, minB, maxB);
189 
190  if( retA && retB )
191  {
192  pMin = std::max( minA, minB );
193  pMax = std::min( maxA, maxB );
194  out = (pMax > pMin); // true;
195  }
196  else
197  {
198  out = false;
199  }
200 
201  return out; // It exists in this slice only if both exist in it.
202 }
G4VSolid * fPtrSolidB
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
bool G4bool
Definition: G4Types.hh:79
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
G4VSolid * fPtrSolidA
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4VSolid * G4IntersectionSolid::Clone ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 551 of file G4IntersectionSolid.cc.

552 {
553  return new G4IntersectionSolid(*this);
554 }
G4IntersectionSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)

Here is the call graph for this function:

void G4IntersectionSolid::ComputeDimensions ( G4VPVParameterisation p,
const G4int  n,
const G4VPhysicalVolume pRep 
)
virtual

Reimplemented from G4VSolid.

Definition at line 532 of file G4IntersectionSolid.cc.

535 {
536 }
G4Polyhedron * G4IntersectionSolid::CreatePolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 571 of file G4IntersectionSolid.cc.

572 {
574  // Stack components and components of components recursively
575  // See G4BooleanSolid::StackPolyhedron
576  G4Polyhedron* top = StackPolyhedron(processor, this);
577  G4Polyhedron* result = new G4Polyhedron(*top);
578  if (processor.execute(*result)) { return result; }
579  else { return 0; }
580 }
G4double G4ParticleHPJENDLHEData::G4double result
#define processor
Definition: xmlparse.cc:617
G4Polyhedron * StackPolyhedron(HepPolyhedronProcessor &, const G4VSolid *) const
bool execute(HepPolyhedron &)

Here is the call graph for this function:

void G4IntersectionSolid::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 561 of file G4IntersectionSolid.cc.

562 {
563  scene.AddSolid (*this);
564 }
virtual void AddSolid(const G4Box &)=0

Here is the call graph for this function:

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

Implements G4VSolid.

Definition at line 297 of file G4IntersectionSolid.cc.

299 {
300  G4double dist = 0.0;
301  if( Inside(p) == kInside )
302  {
303 #ifdef G4BOOLDEBUG
304  G4cout << "WARNING - Invalid call in "
305  << "G4IntersectionSolid::DistanceToIn(p,v)" << G4endl
306  << " Point p is inside !" << G4endl;
307  G4cout << " p = " << p << G4endl;
308  G4cout << " v = " << v << G4endl;
309  G4cerr << "WARNING - Invalid call in "
310  << "G4IntersectionSolid::DistanceToIn(p,v)" << G4endl
311  << " Point p is inside !" << G4endl;
312  G4cerr << " p = " << p << G4endl;
313  G4cerr << " v = " << v << G4endl;
314 #endif
315  }
316  else // if( Inside(p) == kSurface )
317  {
318  EInside wA = fPtrSolidA->Inside(p);
319  EInside wB = fPtrSolidB->Inside(p);
320 
321  G4ThreeVector pA = p, pB = p;
322  G4double dA = 0., dA1=0., dA2=0.;
323  G4double dB = 0., dB1=0., dB2=0.;
324  G4bool doA = true, doB = true;
325 
326  static const size_t max_trials=10000;
327  for (size_t trial=0; trial<max_trials; ++trial)
328  {
329  if(doA)
330  {
331  // find next valid range for A
332 
333  dA1 = 0.;
334 
335  if( wA != kInside )
336  {
337  dA1 = fPtrSolidA->DistanceToIn(pA, v);
338 
339  if( dA1 == kInfinity ) return kInfinity;
340 
341  pA += dA1*v;
342  }
343  dA2 = dA1 + fPtrSolidA->DistanceToOut(pA, v);
344  }
345  dA1 += dA;
346  dA2 += dA;
347 
348  if(doB)
349  {
350  // find next valid range for B
351 
352  dB1 = 0.;
353  if(wB != kInside)
354  {
355  dB1 = fPtrSolidB->DistanceToIn(pB, v);
356 
357  if(dB1 == kInfinity) return kInfinity;
358 
359  pB += dB1*v;
360  }
361  dB2 = dB1 + fPtrSolidB->DistanceToOut(pB, v);
362  }
363  dB1 += dB;
364  dB2 += dB;
365 
366  // check if they overlap
367 
368  if( dA1 < dB1 )
369  {
370  if( dB1 < dA2 ) return dB1;
371 
372  dA = dA2;
373  pA = p + dA*v; // continue from here
374  wA = kSurface;
375  doA = true;
376  doB = false;
377  }
378  else
379  {
380  if( dA1 < dB2 ) return dA1;
381 
382  dB = dB2;
383  pB = p + dB*v; // continue from here
384  wB = kSurface;
385  doB = true;
386  doA = false;
387  }
388  }
389  }
390 #ifdef G4BOOLDEBUG
391  G4Exception("G4IntersectionSolid::DistanceToIn(p,v)",
392  "GeomSolids0001", JustWarning,
393  "Reached maximum number of iterations! Returning zero.");
394 #endif
395  return dist ;
396 }
G4VSolid * fPtrSolidB
static const G4double kInfinity
Definition: geomdefs.hh:42
EInside Inside(const G4ThreeVector &p) const
const char * p
Definition: xmltok.h:285
G4GLOB_DLL std::ostream G4cout
virtual EInside Inside(const G4ThreeVector &p) const =0
bool G4bool
Definition: G4Types.hh:79
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
EInside
Definition: geomdefs.hh:58
G4VSolid * fPtrSolidA
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

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

Implements G4VSolid.

Definition at line 404 of file G4IntersectionSolid.cc.

405 {
406 #ifdef G4BOOLDEBUG
407  if( Inside(p) == kInside )
408  {
409  G4cout << "WARNING - Invalid call in "
410  << "G4IntersectionSolid::DistanceToIn(p)" << G4endl
411  << " Point p is inside !" << G4endl;
412  G4cout << " p = " << p << G4endl;
413  G4cerr << "WARNING - Invalid call in "
414  << "G4IntersectionSolid::DistanceToIn(p)" << G4endl
415  << " Point p is inside !" << G4endl;
416  G4cerr << " p = " << p << G4endl;
417  }
418 #endif
419  EInside sideA = fPtrSolidA->Inside(p) ;
420  EInside sideB = fPtrSolidB->Inside(p) ;
421  G4double dist=0.0 ;
422 
423  if( sideA != kInside && sideB != kOutside )
424  {
425  dist = fPtrSolidA->DistanceToIn(p) ;
426  }
427  else
428  {
429  if( sideB != kInside && sideA != kOutside )
430  {
431  dist = fPtrSolidB->DistanceToIn(p) ;
432  }
433  else
434  {
435  dist = std::min(fPtrSolidA->DistanceToIn(p),
436  fPtrSolidB->DistanceToIn(p) ) ;
437  }
438  }
439  return dist ;
440 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
G4GLOB_DLL std::ostream G4cout
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
EInside
Definition: geomdefs.hh:58
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4VSolid * fPtrSolidA
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

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

Implements G4VSolid.

Definition at line 447 of file G4IntersectionSolid.cc.

452 {
453  G4bool validNormA, validNormB;
454  G4ThreeVector nA, nB;
455 
456 #ifdef G4BOOLDEBUG
457  if( Inside(p) == kOutside )
458  {
459  G4cout << "Position:" << G4endl << G4endl;
460  G4cout << "p.x() = " << p.x()/mm << " mm" << G4endl;
461  G4cout << "p.y() = " << p.y()/mm << " mm" << G4endl;
462  G4cout << "p.z() = " << p.z()/mm << " mm" << G4endl << G4endl;
463  G4cout << "Direction:" << G4endl << G4endl;
464  G4cout << "v.x() = " << v.x() << G4endl;
465  G4cout << "v.y() = " << v.y() << G4endl;
466  G4cout << "v.z() = " << v.z() << G4endl << G4endl;
467  G4cout << "WARNING - Invalid call in "
468  << "G4IntersectionSolid::DistanceToOut(p,v)" << G4endl
469  << " Point p is outside !" << G4endl;
470  G4cout << " p = " << p << G4endl;
471  G4cout << " v = " << v << G4endl;
472  G4cerr << "WARNING - Invalid call in "
473  << "G4IntersectionSolid::DistanceToOut(p,v)" << G4endl
474  << " Point p is outside !" << G4endl;
475  G4cerr << " p = " << p << G4endl;
476  G4cerr << " v = " << v << G4endl;
477  }
478 #endif
479  G4double distA = fPtrSolidA->DistanceToOut(p,v,calcNorm,&validNormA,&nA) ;
480  G4double distB = fPtrSolidB->DistanceToOut(p,v,calcNorm,&validNormB,&nB) ;
481 
482  G4double dist = std::min(distA,distB) ;
483 
484  if( calcNorm )
485  {
486  if ( distA < distB )
487  {
488  *validNorm = validNormA;
489  *n = nA;
490  }
491  else
492  {
493  *validNorm = validNormB;
494  *n = nB;
495  }
496  }
497 
498  return dist ;
499 }
G4VSolid * fPtrSolidB
static constexpr double mm
Definition: G4SIunits.hh:115
EInside Inside(const G4ThreeVector &p) const
double x() const
double z() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
double y() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4VSolid * fPtrSolidA
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

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

Implements G4VSolid.

Definition at line 506 of file G4IntersectionSolid.cc.

507 {
508 #ifdef G4BOOLDEBUG
509  if( Inside(p) == kOutside )
510  {
511  G4cout << "WARNING - Invalid call in "
512  << "G4IntersectionSolid::DistanceToOut(p)" << G4endl
513  << " Point p is outside !" << G4endl;
514  G4cout << " p = " << p << G4endl;
515  G4cerr << "WARNING - Invalid call in "
516  << "G4IntersectionSolid::DistanceToOut(p)" << G4endl
517  << " Point p is outside !" << G4endl;
518  G4cerr << " p = " << p << G4endl;
519  }
520 #endif
521 
522  return std::min(fPtrSolidA->DistanceToOut(p),
523  fPtrSolidB->DistanceToOut(p) ) ;
524 
525 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
G4GLOB_DLL std::ostream G4cout
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4VSolid * fPtrSolidA
#define G4endl
Definition: G4ios.hh:61
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

void G4IntersectionSolid::Extent ( G4ThreeVector pMin,
G4ThreeVector pMax 
) const
virtual

Reimplemented from G4VSolid.

Definition at line 142 of file G4IntersectionSolid.cc.

143 {
144  G4ThreeVector minA,maxA, minB,maxB;
145  fPtrSolidA->Extent(minA,maxA);
146  fPtrSolidB->Extent(minB,maxB);
147 
148  pMin.set(std::max(minA.x(),minB.x()),
149  std::max(minA.y(),minB.y()),
150  std::max(minA.z(),minB.z()));
151 
152  pMax.set(std::min(maxA.x(),maxB.x()),
153  std::min(maxA.y(),maxB.y()),
154  std::min(maxA.z(),maxB.z()));
155 
156  // Check correctness of the bounding box
157  //
158  if (pMin.x() >= pMax.x() || pMin.y() >= pMax.y() || pMin.z() >= pMax.z())
159  {
160  std::ostringstream message;
161  message << "Bad bounding box (min >= max) for solid: "
162  << GetName() << " !"
163  << "\npMin = " << pMin
164  << "\npMax = " << pMax;
165  G4Exception("G4IntersectionSolid::Extent()", "GeomMgt0001",
166  JustWarning, message);
167  DumpInfo();
168  }
169 }
void set(double x, double y, double z)
G4String GetName() const
G4VSolid * fPtrSolidB
double x() const
double z() const
void DumpInfo() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
T max(const T t1, const T t2)
brief Return the largest of the two arguments
double y() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4VSolid * fPtrSolidA
virtual void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
Definition: G4VSolid.cc:626

Here is the call graph for this function:

G4GeometryType G4IntersectionSolid::GetEntityType ( ) const
virtual

Reimplemented from G4BooleanSolid.

Definition at line 542 of file G4IntersectionSolid.cc.

543 {
544  return G4String("G4IntersectionSolid");
545 }
EInside G4IntersectionSolid::Inside ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 208 of file G4IntersectionSolid.cc.

209 {
210  EInside positionA = fPtrSolidA->Inside(p) ;
211 
212  if( positionA == kOutside ) return kOutside ;
213 
214  EInside positionB = fPtrSolidB->Inside(p) ;
215 
216  if(positionA == kInside && positionB == kInside)
217  {
218  return kInside ;
219  }
220  else
221  {
222  if((positionA == kInside && positionB == kSurface) ||
223  (positionB == kInside && positionA == kSurface) ||
224  (positionA == kSurface && positionB == kSurface) )
225  {
226  return kSurface ;
227  }
228  else
229  {
230  return kOutside ;
231  }
232  }
233 }
G4VSolid * fPtrSolidB
virtual EInside Inside(const G4ThreeVector &p) const =0
EInside
Definition: geomdefs.hh:58
G4VSolid * fPtrSolidA

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 124 of file G4IntersectionSolid.cc.

125 {
126  // Check assignment to self
127  //
128  if (this == &rhs) { return *this; }
129 
130  // Copy base class data
131  //
133 
134  return *this;
135 }
G4BooleanSolid & operator=(const G4BooleanSolid &rhs)

Here is the call graph for this function:

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

Implements G4VSolid.

Definition at line 239 of file G4IntersectionSolid.cc.

240 {
242  EInside insideA, insideB;
243 
244  insideA= fPtrSolidA->Inside(p);
245  insideB= fPtrSolidB->Inside(p);
246 
247 #ifdef G4BOOLDEBUG
248  if( (insideA == kOutside) || (insideB == kOutside) )
249  {
250  G4cout << "WARNING - Invalid call in "
251  << "G4IntersectionSolid::SurfaceNormal(p)" << G4endl
252  << " Point p is outside !" << G4endl;
253  G4cout << " p = " << p << G4endl;
254  G4cerr << "WARNING - Invalid call in "
255  << "G4IntersectionSolid::SurfaceNormal(p)" << G4endl
256  << " Point p is outside !" << G4endl;
257  G4cerr << " p = " << p << G4endl;
258  }
259 #endif
260 
261  // On the surface of both is difficult ... treat it like on A now!
262  //
263  if( insideA == kSurface )
264  {
265  normal= fPtrSolidA->SurfaceNormal(p) ;
266  }
267  else if( insideB == kSurface )
268  {
269  normal= fPtrSolidB->SurfaceNormal(p) ;
270  }
271  else // We are on neither surface, so we should generate an exception
272  {
274  normal= fPtrSolidA->SurfaceNormal(p) ;
275  else
276  normal= fPtrSolidB->SurfaceNormal(p) ;
277 #ifdef G4BOOLDEBUG
278  G4cout << "WARNING - Invalid call in "
279  << "G4IntersectionSolid::SurfaceNormal(p)" << G4endl
280  << " Point p is out of surface !" << G4endl;
281  G4cout << " p = " << p << G4endl;
282  G4cerr << "WARNING - Invalid call in "
283  << "G4IntersectionSolid::SurfaceNormal(p)" << G4endl
284  << " Point p is out of surface !" << G4endl;
285  G4cerr << " p = " << p << G4endl;
286 #endif
287  }
288 
289  return normal;
290 }
G4VSolid * fPtrSolidB
static double normal(HepRandomEngine *eptr)
Definition: RandPoisson.cc:77
G4GLOB_DLL std::ostream G4cout
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0
EInside
Definition: geomdefs.hh:58
G4VSolid * fPtrSolidA
#define G4endl
Definition: G4ios.hh:61
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:


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