Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4UnionSolid Class Reference

#include <G4UnionSolid.hh>

Inheritance diagram for G4UnionSolid:
G4BooleanSolid G4VSolid

Public Member Functions

 G4UnionSolid (const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
 
 G4UnionSolid (const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB, G4RotationMatrix *rotMatrix, const G4ThreeVector &transVector)
 
 G4UnionSolid (const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB, const G4Transform3D &transform)
 
virtual ~G4UnionSolid ()
 
G4GeometryType GetEntityType () const
 
G4VSolidClone () const
 
 G4UnionSolid (__void__ &)
 
 G4UnionSolid (const G4UnionSolid &rhs)
 
G4UnionSolidoperator= (const G4UnionSolid &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)
 

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
 
G4double EstimateCubicVolume (G4int nStat, G4double epsilon) const
 
G4double EstimateSurfaceArea (G4int nStat, G4double ell) const
 
- Protected Attributes inherited from G4BooleanSolid
G4VSolidfPtrSolidA
 
G4VSolidfPtrSolidB
 
G4double fAreaRatio
 
- Protected Attributes inherited from G4VSolid
G4double kCarTolerance
 

Detailed Description

Definition at line 52 of file G4UnionSolid.hh.

Constructor & Destructor Documentation

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

Definition at line 58 of file G4UnionSolid.cc.

Referenced by Clone().

61  : G4BooleanSolid(pName,pSolidA,pSolidB)
62 {
63 }
G4BooleanSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
G4UnionSolid::G4UnionSolid ( const G4String pName,
G4VSolid pSolidA,
G4VSolid pSolidB,
G4RotationMatrix rotMatrix,
const G4ThreeVector transVector 
)

Definition at line 69 of file G4UnionSolid.cc.

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

Definition at line 83 of file G4UnionSolid.cc.

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

Definition at line 105 of file G4UnionSolid.cc.

106 {
107 }
G4UnionSolid::G4UnionSolid ( __void__ &  a)

Definition at line 96 of file G4UnionSolid.cc.

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

Definition at line 113 of file G4UnionSolid.cc.

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

Member Function Documentation

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

Implements G4VSolid.

Definition at line 140 of file G4UnionSolid.cc.

References G4VSolid::CalculateExtent(), G4BooleanSolid::fPtrSolidA, G4BooleanSolid::fPtrSolidB, G4INCL::Math::max(), and G4INCL::Math::min().

145 {
146  G4bool touchesA, touchesB, out ;
147  G4double minA = kInfinity, minB = kInfinity,
148  maxA = -kInfinity, maxB = -kInfinity;
149 
150  touchesA = fPtrSolidA->CalculateExtent( pAxis, pVoxelLimit,
151  pTransform, minA, maxA);
152  touchesB= fPtrSolidB->CalculateExtent( pAxis, pVoxelLimit,
153  pTransform, minB, maxB);
154  if( touchesA || touchesB )
155  {
156  pMin = std::min( minA, minB );
157  pMax = std::max( maxA, maxB );
158  out = true ;
159  }
160  else out = false ;
161 
162  return out ; // It exists in this slice if either one does.
163 }
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
G4VSolid * G4UnionSolid::Clone ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 457 of file G4UnionSolid.cc.

References G4UnionSolid().

458 {
459  return new G4UnionSolid(*this);
460 }
G4UnionSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
Definition: G4UnionSolid.cc:58
void G4UnionSolid::ComputeDimensions ( G4VPVParameterisation p,
const G4int  n,
const G4VPhysicalVolume pRep 
)
virtual

Reimplemented from G4VSolid.

Definition at line 467 of file G4UnionSolid.cc.

470 {
471 }
G4Polyhedron * G4UnionSolid::CreatePolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 488 of file G4UnionSolid.cc.

References HepPolyhedronProcessor::execute(), processor, and G4BooleanSolid::StackPolyhedron().

489 {
491  // Stack components and components of components recursively
492  // See G4BooleanSolid::StackPolyhedron
493  G4Polyhedron* top = StackPolyhedron(processor, this);
494  G4Polyhedron* result = new G4Polyhedron(*top);
495  if (processor.execute(*result)) { return result; }
496  else { return 0; }
497 }
#define processor
Definition: xmlparse.cc:600
G4Polyhedron * StackPolyhedron(HepPolyhedronProcessor &, const G4VSolid *) const
bool execute(HepPolyhedron &)
void G4UnionSolid::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 478 of file G4UnionSolid.cc.

References G4VGraphicsScene::AddSolid().

479 {
480  scene.AddSolid (*this);
481 }
virtual void AddSolid(const G4Box &)=0
G4double G4UnionSolid::DistanceToIn ( const G4ThreeVector p,
const G4ThreeVector v 
) const
virtual

Implements G4VSolid.

Definition at line 252 of file G4UnionSolid.cc.

References G4VSolid::DistanceToIn(), G4BooleanSolid::fPtrSolidA, G4BooleanSolid::fPtrSolidB, G4cerr, G4cout, G4endl, Inside(), kInside, and G4INCL::Math::min().

254 {
255 #ifdef G4BOOLDEBUG
256  if( Inside(p) == kInside )
257  {
258  G4cout << "WARNING - Invalid call in "
259  << "G4UnionSolid::DistanceToIn(p,v)" << G4endl
260  << " Point p is inside !" << G4endl;
261  G4cout << " p = " << p << G4endl;
262  G4cout << " v = " << v << G4endl;
263  G4cerr << "WARNING - Invalid call in "
264  << "G4UnionSolid::DistanceToIn(p,v)" << G4endl
265  << " Point p is inside !" << G4endl;
266  G4cerr << " p = " << p << G4endl;
267  G4cerr << " v = " << v << G4endl;
268  }
269 #endif
270 
271  return std::min(fPtrSolidA->DistanceToIn(p,v),
272  fPtrSolidB->DistanceToIn(p,v) ) ;
273 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
G4GLOB_DLL std::ostream G4cout
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4VSolid * fPtrSolidA
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
G4double G4UnionSolid::DistanceToIn ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 281 of file G4UnionSolid.cc.

References G4VSolid::DistanceToIn(), G4BooleanSolid::fPtrSolidA, G4BooleanSolid::fPtrSolidB, G4cerr, G4cout, G4endl, Inside(), kInside, and G4INCL::Math::min().

282 {
283 #ifdef G4BOOLDEBUG
284  if( Inside(p) == kInside )
285  {
286  G4cout << "WARNING - Invalid call in "
287  << "G4UnionSolid::DistanceToIn(p)" << G4endl
288  << " Point p is inside !" << G4endl;
289  G4cout << " p = " << p << G4endl;
290  G4cerr << "WARNING - Invalid call in "
291  << "G4UnionSolid::DistanceToIn(p)" << G4endl
292  << " Point p is inside !" << G4endl;
293  G4cerr << " p = " << p << G4endl;
294  }
295 #endif
296  G4double distA = fPtrSolidA->DistanceToIn(p) ;
297  G4double distB = fPtrSolidB->DistanceToIn(p) ;
298  G4double safety = std::min(distA,distB) ;
299  if(safety < 0.0) safety = 0.0 ;
300  return safety ;
301 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
G4GLOB_DLL std::ostream G4cout
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
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
G4double G4UnionSolid::DistanceToOut ( const G4ThreeVector p,
const G4ThreeVector v,
const G4bool  calcNorm = false,
G4bool validNorm = 0,
G4ThreeVector n = 0 
) const
virtual

Implements G4VSolid.

Definition at line 308 of file G4UnionSolid.cc.

References G4VSolid::DistanceToOut(), G4BooleanSolid::fPtrSolidA, G4BooleanSolid::fPtrSolidB, G4cerr, G4cout, G4endl, Inside(), G4VSolid::Inside(), G4VSolid::kCarTolerance, kOutside, python.hepunit::mm, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

313 {
314  G4double dist = 0.0, disTmp = 0.0 ;
315  G4ThreeVector normTmp;
316  G4ThreeVector* nTmp= &normTmp;
317 
318  if( Inside(p) == kOutside )
319  {
320 #ifdef G4BOOLDEBUG
321  G4cout << "Position:" << G4endl << G4endl;
322  G4cout << "p.x() = " << p.x()/mm << " mm" << G4endl;
323  G4cout << "p.y() = " << p.y()/mm << " mm" << G4endl;
324  G4cout << "p.z() = " << p.z()/mm << " mm" << G4endl << G4endl;
325  G4cout << "Direction:" << G4endl << G4endl;
326  G4cout << "v.x() = " << v.x() << G4endl;
327  G4cout << "v.y() = " << v.y() << G4endl;
328  G4cout << "v.z() = " << v.z() << G4endl << G4endl;
329  G4cout << "WARNING - Invalid call in "
330  << "G4UnionSolid::DistanceToOut(p,v)" << G4endl
331  << " Point p is outside !" << G4endl;
332  G4cout << " p = " << p << G4endl;
333  G4cout << " v = " << v << G4endl;
334  G4cerr << "WARNING - Invalid call in "
335  << "G4UnionSolid::DistanceToOut(p,v)" << G4endl
336  << " Point p is outside !" << G4endl;
337  G4cerr << " p = " << p << G4endl;
338  G4cerr << " v = " << v << G4endl;
339 #endif
340  }
341  else
342  {
343  EInside positionA = fPtrSolidA->Inside(p) ;
344  // EInside positionB = fPtrSolidB->Inside(p) ;
345 
346  if( positionA != kOutside )
347  {
348  do
349  {
350  disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
351  validNorm,nTmp) ;
352  dist += disTmp ;
353 
354  if(fPtrSolidB->Inside(p+dist*v) != kOutside)
355  {
356  disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
357  validNorm,nTmp) ;
358  dist += disTmp ;
359  }
360  }
361  // while( Inside(p+dist*v) == kInside ) ;
362  while( fPtrSolidA->Inside(p+dist*v) != kOutside &&
363  disTmp > 0.5*kCarTolerance ) ;
364  }
365  else // if( positionB != kOutside )
366  {
367  do
368  {
369  disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
370  validNorm,nTmp) ;
371  dist += disTmp ;
372 
373  if(fPtrSolidA->Inside(p+dist*v) != kOutside)
374  {
375  disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
376  validNorm,nTmp) ;
377  dist += disTmp ;
378  }
379  }
380  // while( Inside(p+dist*v) == kInside ) ;
381  while( (fPtrSolidB->Inside(p+dist*v) != kOutside)
382  && (disTmp > 0.5*kCarTolerance) ) ;
383  }
384  }
385  if( calcNorm )
386  {
387  *validNorm = false ;
388  *n = *nTmp ;
389  }
390  return dist ;
391 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
double x() const
double z() const
G4GLOB_DLL std::ostream G4cout
virtual EInside Inside(const G4ThreeVector &p) const =0
EInside
Definition: geomdefs.hh:58
double y() const
G4VSolid * fPtrSolidA
#define G4endl
Definition: G4ios.hh:61
G4double kCarTolerance
Definition: G4VSolid.hh:305
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
G4double G4UnionSolid::DistanceToOut ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 398 of file G4UnionSolid.cc.

References G4VSolid::DistanceToOut(), G4BooleanSolid::fPtrSolidA, G4BooleanSolid::fPtrSolidB, G4cerr, G4cout, G4endl, Inside(), G4VSolid::Inside(), kInside, kOutside, kSurface, and G4INCL::Math::max().

399 {
400  G4double distout = 0.0;
401  if( Inside(p) == kOutside )
402  {
403 #ifdef G4BOOLDEBUG
404  G4cout << "WARNING - Invalid call in "
405  << "G4UnionSolid::DistanceToOut(p)" << G4endl
406  << " Point p is outside !" << G4endl;
407  G4cout << " p = " << p << G4endl;
408  G4cerr << "WARNING - Invalid call in "
409  << "G4UnionSolid::DistanceToOut(p)" << G4endl
410  << " Point p is outside !" << G4endl;
411  G4cerr << " p = " << p << G4endl;
412 #endif
413  }
414  else
415  {
416  EInside positionA = fPtrSolidA->Inside(p) ;
417  EInside positionB = fPtrSolidB->Inside(p) ;
418 
419  // Is this equivalent ??
420  // if( ! ( (positionA == kOutside)) &&
421  // (positionB == kOutside)) )
422  if((positionA == kInside && positionB == kInside ) ||
423  (positionA == kInside && positionB == kSurface ) ||
424  (positionA == kSurface && positionB == kInside ) )
425  {
426  distout= std::max(fPtrSolidA->DistanceToOut(p),
427  fPtrSolidB->DistanceToOut(p) ) ;
428  }
429  else
430  {
431  if(positionA == kOutside)
432  {
433  distout= fPtrSolidB->DistanceToOut(p) ;
434  }
435  else
436  {
437  distout= fPtrSolidA->DistanceToOut(p) ;
438  }
439  }
440  }
441  return distout;
442 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
G4GLOB_DLL std::ostream G4cout
virtual EInside Inside(const G4ThreeVector &p) const =0
T max(const T t1, const T t2)
brief Return the largest of the two arguments
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
G4GeometryType G4UnionSolid::GetEntityType ( ) const
virtual

Reimplemented from G4BooleanSolid.

Definition at line 448 of file G4UnionSolid.cc.

449 {
450  return G4String("G4UnionSolid");
451 }
EInside G4UnionSolid::Inside ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 171 of file G4UnionSolid.cc.

References G4BooleanSolid::fPtrSolidA, G4BooleanSolid::fPtrSolidB, G4GeometryTolerance::GetInstance(), G4GeometryTolerance::GetRadialTolerance(), G4VSolid::Inside(), kInside, kOutside, kSurface, and G4VSolid::SurfaceNormal().

Referenced by DistanceToIn(), DistanceToOut(), and SurfaceNormal().

172 {
173  EInside positionA = fPtrSolidA->Inside(p);
174  if (positionA == kInside) { return kInside; }
175 
176  EInside positionB = fPtrSolidB->Inside(p);
177 
178  if( positionB == kInside ||
179  ( positionA == kSurface && positionB == kSurface &&
180  ( fPtrSolidA->SurfaceNormal(p) +
181  fPtrSolidB->SurfaceNormal(p) ).mag2() <
183  {
184  return kInside;
185  }
186  else
187  {
188  if( ( positionB == kSurface ) || ( positionA == kSurface ) )
189  { return kSurface; }
190  else
191  { return kOutside; }
192  }
193 }
G4VSolid * fPtrSolidB
virtual EInside Inside(const G4ThreeVector &p) const =0
G4double GetRadialTolerance() const
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0
EInside
Definition: geomdefs.hh:58
G4VSolid * fPtrSolidA
static G4GeometryTolerance * GetInstance()
G4UnionSolid & G4UnionSolid::operator= ( const G4UnionSolid rhs)

Definition at line 122 of file G4UnionSolid.cc.

References G4BooleanSolid::operator=().

123 {
124  // Check assignment to self
125  //
126  if (this == &rhs) { return *this; }
127 
128  // Copy base class data
129  //
131 
132  return *this;
133 }
G4BooleanSolid & operator=(const G4BooleanSolid &rhs)
G4ThreeVector G4UnionSolid::SurfaceNormal ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 200 of file G4UnionSolid.cc.

References G4BooleanSolid::fPtrSolidA, G4BooleanSolid::fPtrSolidB, G4cerr, G4cout, G4endl, Inside(), G4VSolid::Inside(), kInside, kOutside, kSurface, and G4VSolid::SurfaceNormal().

201 {
202  G4ThreeVector normal;
203 
204 #ifdef G4BOOLDEBUG
205  if( Inside(p) == kOutside )
206  {
207  G4cout << "WARNING - Invalid call in "
208  << "G4UnionSolid::SurfaceNormal(p)" << G4endl
209  << " Point p is outside !" << G4endl;
210  G4cout << " p = " << p << G4endl;
211  G4cerr << "WARNING - Invalid call in "
212  << "G4UnionSolid::SurfaceNormal(p)" << G4endl
213  << " Point p is outside !" << G4endl;
214  G4cerr << " p = " << p << G4endl;
215  }
216 #endif
217 
218  if(fPtrSolidA->Inside(p) == kSurface && fPtrSolidB->Inside(p) != kInside)
219  {
220  normal= fPtrSolidA->SurfaceNormal(p) ;
221  }
222  else if(fPtrSolidB->Inside(p) == kSurface &&
223  fPtrSolidA->Inside(p) != kInside)
224  {
225  normal= fPtrSolidB->SurfaceNormal(p) ;
226  }
227  else
228  {
229  normal= fPtrSolidA->SurfaceNormal(p) ;
230 #ifdef G4BOOLDEBUG
231  if(Inside(p)==kInside)
232  {
233  G4cout << "WARNING - Invalid call in "
234  << "G4UnionSolid::SurfaceNormal(p)" << G4endl
235  << " Point p is inside !" << G4endl;
236  G4cout << " p = " << p << G4endl;
237  G4cerr << "WARNING - Invalid call in "
238  << "G4UnionSolid::SurfaceNormal(p)" << G4endl
239  << " Point p is inside !" << G4endl;
240  G4cerr << " p = " << p << G4endl;
241  }
242 #endif
243  }
244  return normal;
245 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
G4GLOB_DLL std::ostream G4cout
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0
G4VSolid * fPtrSolidA
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr

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