Geant4  10.02.p03
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)
 
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
G4PolyhedronStackPolyhedron (HepPolyhedronProcessor &, const G4VSolid *) const
 
G4double GetAreaRatio () 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
 
G4double fAreaRatio
 
- Protected Attributes inherited from G4VSolid
G4double kCarTolerance
 

Detailed Description

Definition at line 53 of file G4IntersectionSolid.hh.

Constructor & Destructor Documentation

◆ G4IntersectionSolid() [1/5]

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() [2/5]

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() [3/5]

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::~G4IntersectionSolid ( )
virtual

Definition at line 106 of file G4IntersectionSolid.cc.

107 {
108 }

◆ G4IntersectionSolid() [4/5]

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() [5/5]

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

◆ CalculateExtent()

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

Implements G4VSolid.

Definition at line 142 of file G4IntersectionSolid.cc.

147 {
148  G4bool retA, retB, out;
149  G4double minA, minB, maxA, maxB;
150 
151  retA = fPtrSolidA
152  ->CalculateExtent( pAxis, pVoxelLimit, pTransform, minA, maxA);
153  retB = fPtrSolidB
154  ->CalculateExtent( pAxis, pVoxelLimit, pTransform, minB, maxB);
155 
156  if( retA && retB )
157  {
158  pMin = std::max( minA, minB );
159  pMax = std::min( maxA, maxB );
160  out = (pMax > pMin); // true;
161  }
162  else out = false;
163 
164  return out; // It exists in this slice only if both exist in it.
165 }
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
G4VSolid * fPtrSolidA
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ Clone()

G4VSolid * G4IntersectionSolid::Clone ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 520 of file G4IntersectionSolid.cc.

521 {
522  return new G4IntersectionSolid(*this);
523 }
G4IntersectionSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
Here is the call graph for this function:

◆ ComputeDimensions()

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

Reimplemented from G4VSolid.

Definition at line 501 of file G4IntersectionSolid.cc.

504 {
505 }

◆ CreatePolyhedron()

G4Polyhedron * G4IntersectionSolid::CreatePolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 540 of file G4IntersectionSolid.cc.

541 {
543  // Stack components and components of components recursively
544  // See G4BooleanSolid::StackPolyhedron
545  G4Polyhedron* top = StackPolyhedron(processor, this);
546  G4Polyhedron* result = new G4Polyhedron(*top);
547  if (processor.execute(*result)) { return result; }
548  else { return 0; }
549 }
#define processor
Definition: xmlparse.cc:617
G4Polyhedron * StackPolyhedron(HepPolyhedronProcessor &, const G4VSolid *) const
bool execute(HepPolyhedron &)
Here is the call graph for this function:

◆ DescribeYourselfTo()

void G4IntersectionSolid::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 530 of file G4IntersectionSolid.cc.

531 {
532  scene.AddSolid (*this);
533 }
virtual void AddSolid(const G4Box &)=0
Here is the call graph for this function:

◆ DistanceToIn() [1/2]

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

Implements G4VSolid.

Definition at line 266 of file G4IntersectionSolid.cc.

268 {
269  G4double dist = 0.0;
270  if( Inside(p) == kInside )
271  {
272 #ifdef G4BOOLDEBUG
273  G4cout << "WARNING - Invalid call in "
274  << "G4IntersectionSolid::DistanceToIn(p,v)" << G4endl
275  << " Point p is inside !" << G4endl;
276  G4cout << " p = " << p << G4endl;
277  G4cout << " v = " << v << G4endl;
278  G4cerr << "WARNING - Invalid call in "
279  << "G4IntersectionSolid::DistanceToIn(p,v)" << G4endl
280  << " Point p is inside !" << G4endl;
281  G4cerr << " p = " << p << G4endl;
282  G4cerr << " v = " << v << G4endl;
283 #endif
284  }
285  else // if( Inside(p) == kSurface )
286  {
287  EInside wA = fPtrSolidA->Inside(p);
288  EInside wB = fPtrSolidB->Inside(p);
289 
290  G4ThreeVector pA = p, pB = p;
291  G4double dA = 0., dA1=0., dA2=0.;
292  G4double dB = 0., dB1=0., dB2=0.;
293  G4bool doA = true, doB = true;
294 
295  static const size_t max_trials=10000;
296  for (size_t trial=0; trial<max_trials; ++trial)
297  {
298  if(doA)
299  {
300  // find next valid range for A
301 
302  dA1 = 0.;
303 
304  if( wA != kInside )
305  {
306  dA1 = fPtrSolidA->DistanceToIn(pA, v);
307 
308  if( dA1 == kInfinity ) return kInfinity;
309 
310  pA += dA1*v;
311  }
312  dA2 = dA1 + fPtrSolidA->DistanceToOut(pA, v);
313  }
314  dA1 += dA;
315  dA2 += dA;
316 
317  if(doB)
318  {
319  // find next valid range for B
320 
321  dB1 = 0.;
322  if(wB != kInside)
323  {
324  dB1 = fPtrSolidB->DistanceToIn(pB, v);
325 
326  if(dB1 == kInfinity) return kInfinity;
327 
328  pB += dB1*v;
329  }
330  dB2 = dB1 + fPtrSolidB->DistanceToOut(pB, v);
331  }
332  dB1 += dB;
333  dB2 += dB;
334 
335  // check if they overlap
336 
337  if( dA1 < dB1 )
338  {
339  if( dB1 < dA2 ) return dB1;
340 
341  dA = dA2;
342  pA = p + dA*v; // continue from here
343  wA = kSurface;
344  doA = true;
345  doB = false;
346  }
347  else
348  {
349  if( dA1 < dB2 ) return dA1;
350 
351  dB = dB2;
352  pB = p + dB*v; // continue from here
353  wB = kSurface;
354  doB = true;
355  doA = false;
356  }
357  }
358  }
359 #ifdef G4BOOLDEBUG
360  G4Exception("G4IntersectionSolid::DistanceToIn(p,v)",
361  "GeomSolids0001", JustWarning,
362  "Reached maximum number of iterations! Returning zero.");
363 #endif
364  return dist ;
365 }
G4VSolid * fPtrSolidB
static const G4double kInfinity
Definition: geomdefs.hh:42
EInside Inside(const G4ThreeVector &p) const
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:

◆ DistanceToIn() [2/2]

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

Implements G4VSolid.

Definition at line 373 of file G4IntersectionSolid.cc.

374 {
375 #ifdef G4BOOLDEBUG
376  if( Inside(p) == kInside )
377  {
378  G4cout << "WARNING - Invalid call in "
379  << "G4IntersectionSolid::DistanceToIn(p)" << G4endl
380  << " Point p is inside !" << G4endl;
381  G4cout << " p = " << p << G4endl;
382  G4cerr << "WARNING - Invalid call in "
383  << "G4IntersectionSolid::DistanceToIn(p)" << G4endl
384  << " Point p is inside !" << G4endl;
385  G4cerr << " p = " << p << G4endl;
386  }
387 #endif
388  EInside sideA = fPtrSolidA->Inside(p) ;
389  EInside sideB = fPtrSolidB->Inside(p) ;
390  G4double dist=0.0 ;
391 
392  if( sideA != kInside && sideB != kOutside )
393  {
394  dist = fPtrSolidA->DistanceToIn(p) ;
395  }
396  else
397  {
398  if( sideB != kInside && sideA != kOutside )
399  {
400  dist = fPtrSolidB->DistanceToIn(p) ;
401  }
402  else
403  {
404  dist = std::min(fPtrSolidA->DistanceToIn(p),
405  fPtrSolidB->DistanceToIn(p) ) ;
406  }
407  }
408  return dist ;
409 }
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
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:

◆ DistanceToOut() [1/2]

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 416 of file G4IntersectionSolid.cc.

421 {
422  G4bool validNormA, validNormB;
423  G4ThreeVector nA, nB;
424 
425 #ifdef G4BOOLDEBUG
426  if( Inside(p) == kOutside )
427  {
428  G4cout << "Position:" << G4endl << G4endl;
429  G4cout << "p.x() = " << p.x()/mm << " mm" << G4endl;
430  G4cout << "p.y() = " << p.y()/mm << " mm" << G4endl;
431  G4cout << "p.z() = " << p.z()/mm << " mm" << G4endl << G4endl;
432  G4cout << "Direction:" << G4endl << G4endl;
433  G4cout << "v.x() = " << v.x() << G4endl;
434  G4cout << "v.y() = " << v.y() << G4endl;
435  G4cout << "v.z() = " << v.z() << G4endl << G4endl;
436  G4cout << "WARNING - Invalid call in "
437  << "G4IntersectionSolid::DistanceToOut(p,v)" << G4endl
438  << " Point p is outside !" << G4endl;
439  G4cout << " p = " << p << G4endl;
440  G4cout << " v = " << v << G4endl;
441  G4cerr << "WARNING - Invalid call in "
442  << "G4IntersectionSolid::DistanceToOut(p,v)" << G4endl
443  << " Point p is outside !" << G4endl;
444  G4cerr << " p = " << p << G4endl;
445  G4cerr << " v = " << v << G4endl;
446  }
447 #endif
448  G4double distA = fPtrSolidA->DistanceToOut(p,v,calcNorm,&validNormA,&nA) ;
449  G4double distB = fPtrSolidB->DistanceToOut(p,v,calcNorm,&validNormB,&nB) ;
450 
451  G4double dist = std::min(distA,distB) ;
452 
453  if( calcNorm )
454  {
455  if ( distA < distB )
456  {
457  *validNorm = validNormA;
458  *n = nA;
459  }
460  else
461  {
462  *validNorm = validNormB;
463  *n = nB;
464  }
465  }
466 
467  return dist ;
468 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
double x() const
double y() const
double z() const
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
static const double mm
Definition: G4SIunits.hh:114
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:

◆ DistanceToOut() [2/2]

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

Implements G4VSolid.

Definition at line 475 of file G4IntersectionSolid.cc.

476 {
477 #ifdef G4BOOLDEBUG
478  if( Inside(p) == kOutside )
479  {
480  G4cout << "WARNING - Invalid call in "
481  << "G4IntersectionSolid::DistanceToOut(p)" << G4endl
482  << " Point p is outside !" << G4endl;
483  G4cout << " p = " << p << G4endl;
484  G4cerr << "WARNING - Invalid call in "
485  << "G4IntersectionSolid::DistanceToOut(p)" << G4endl
486  << " Point p is outside !" << G4endl;
487  G4cerr << " p = " << p << G4endl;
488  }
489 #endif
490 
491  return std::min(fPtrSolidA->DistanceToOut(p),
492  fPtrSolidB->DistanceToOut(p) ) ;
493 
494 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
G4GLOB_DLL std::ostream G4cout
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:

◆ GetEntityType()

G4GeometryType G4IntersectionSolid::GetEntityType ( ) const
virtual

Reimplemented from G4BooleanSolid.

Definition at line 511 of file G4IntersectionSolid.cc.

512 {
513  return G4String("G4IntersectionSolid");
514 }

◆ Inside()

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

Implements G4VSolid.

Definition at line 171 of file G4IntersectionSolid.cc.

172 {
173  EInside positionA = fPtrSolidA->Inside(p) ;
174 
175  if( positionA == kOutside ) return kOutside ;
176 
177  EInside positionB = fPtrSolidB->Inside(p) ;
178 
179  if(positionA == kInside && positionB == kInside)
180  {
181  return kInside ;
182  }
183  else
184  {
185  if((positionA == kInside && positionB == kSurface) ||
186  (positionB == kInside && positionA == kSurface) ||
187  (positionA == kSurface && positionB == kSurface) )
188  {
189  return kSurface ;
190  }
191  else
192  {
193  return kOutside ;
194  }
195  }
196 }
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:

◆ operator=()

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:

◆ SurfaceNormal()

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

Implements G4VSolid.

Definition at line 202 of file G4IntersectionSolid.cc.

203 {
205  EInside insideA, insideB;
206 
207  insideA= fPtrSolidA->Inside(p);
208  insideB= fPtrSolidB->Inside(p);
209 
210 #ifdef G4BOOLDEBUG
211  if( (insideA == kOutside) || (insideB == kOutside) )
212  {
213  G4cout << "WARNING - Invalid call in "
214  << "G4IntersectionSolid::SurfaceNormal(p)" << G4endl
215  << " Point p is outside !" << G4endl;
216  G4cout << " p = " << p << G4endl;
217  G4cerr << "WARNING - Invalid call in "
218  << "G4IntersectionSolid::SurfaceNormal(p)" << G4endl
219  << " Point p is outside !" << G4endl;
220  G4cerr << " p = " << p << G4endl;
221  }
222 #endif
223 
224  // OLD: if(fPtrSolidA->DistanceToOut(p) <= fPtrSolidB->DistanceToOut(p) )
225 
226  // On the surface of both is difficult ... treat it like on A now!
227  //
228  // if( (insideA == kSurface) && (insideB == kSurface) )
229  // normal= fPtrSolidA->SurfaceNormal(p) ;
230  // else
231  if( insideA == kSurface )
232  {
233  normal= fPtrSolidA->SurfaceNormal(p) ;
234  }
235  else if( insideB == kSurface )
236  {
237  normal= fPtrSolidB->SurfaceNormal(p) ;
238  }
239  // We are on neither surface, so we should generate an exception
240  else
241  {
243  normal= fPtrSolidA->SurfaceNormal(p) ;
244  else
245  normal= fPtrSolidB->SurfaceNormal(p) ;
246 #ifdef G4BOOLDEBUG
247  G4cout << "WARNING - Invalid call in "
248  << "G4IntersectionSolid::SurfaceNormal(p)" << G4endl
249  << " Point p is out of surface !" << G4endl;
250  G4cout << " p = " << p << G4endl;
251  G4cerr << "WARNING - Invalid call in "
252  << "G4IntersectionSolid::SurfaceNormal(p)" << G4endl
253  << " Point p is out of surface !" << G4endl;
254  G4cerr << " p = " << p << G4endl;
255 #endif
256  }
257 
258  return normal;
259 }
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: