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

#include <G4UnionSolid.hh>

Inheritance diagram for G4UnionSolid:
Collaboration diagram for G4UnionSolid:

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)
 
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 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.

61  : G4BooleanSolid(pName,pSolidA,pSolidB)
62 {
63 }
G4BooleanSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)

Here is the caller graph for this function:

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 172 of file G4UnionSolid.cc.

177 {
178  G4bool touchesA, touchesB, out ;
179  G4double minA = kInfinity, minB = kInfinity,
180  maxA = -kInfinity, maxB = -kInfinity;
181 
182  touchesA = fPtrSolidA->CalculateExtent( pAxis, pVoxelLimit,
183  pTransform, minA, maxA);
184  touchesB = fPtrSolidB->CalculateExtent( pAxis, pVoxelLimit,
185  pTransform, minB, maxB);
186  if( touchesA || touchesB )
187  {
188  pMin = std::min( minA, minB );
189  pMax = std::max( maxA, maxB );
190  out = true ;
191  }
192  else
193  {
194  out = false ;
195  }
196 
197  return out ; // It exists in this slice if either one does.
198 }
G4VSolid * fPtrSolidB
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
static const G4double kInfinity
Definition: geomdefs.hh:42
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 * G4UnionSolid::Clone ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 491 of file G4UnionSolid.cc.

492 {
493  return new G4UnionSolid(*this);
494 }
G4UnionSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
Definition: G4UnionSolid.cc:58

Here is the call graph for this function:

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

Reimplemented from G4VSolid.

Definition at line 501 of file G4UnionSolid.cc.

504 {
505 }
G4Polyhedron * G4UnionSolid::CreatePolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 522 of file G4UnionSolid.cc.

523 {
525  // Stack components and components of components recursively
526  // See G4BooleanSolid::StackPolyhedron
527  G4Polyhedron* top = StackPolyhedron(processor, this);
528  G4Polyhedron* result = new G4Polyhedron(*top);
529  if (processor.execute(*result)) { return result; }
530  else { return 0; }
531 }
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 G4UnionSolid::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 512 of file G4UnionSolid.cc.

513 {
514  scene.AddSolid (*this);
515 }
virtual void AddSolid(const G4Box &)=0

Here is the call graph for this function:

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

Implements G4VSolid.

Definition at line 288 of file G4UnionSolid.cc.

290 {
291 #ifdef G4BOOLDEBUG
292  if( Inside(p) == kInside )
293  {
294  G4cout << "WARNING - Invalid call in "
295  << "G4UnionSolid::DistanceToIn(p,v)" << G4endl
296  << " Point p is inside !" << G4endl;
297  G4cout << " p = " << p << G4endl;
298  G4cout << " v = " << v << G4endl;
299  G4cerr << "WARNING - Invalid call in "
300  << "G4UnionSolid::DistanceToIn(p,v)" << G4endl
301  << " Point p is inside !" << G4endl;
302  G4cerr << " p = " << p << G4endl;
303  G4cerr << " v = " << v << G4endl;
304  }
305 #endif
306 
307  return std::min(fPtrSolidA->DistanceToIn(p,v),
308  fPtrSolidB->DistanceToIn(p,v) ) ;
309 }
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

Here is the call graph for this function:

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

Implements G4VSolid.

Definition at line 317 of file G4UnionSolid.cc.

318 {
319 #ifdef G4BOOLDEBUG
320  if( Inside(p) == kInside )
321  {
322  G4cout << "WARNING - Invalid call in "
323  << "G4UnionSolid::DistanceToIn(p)" << G4endl
324  << " Point p is inside !" << G4endl;
325  G4cout << " p = " << p << G4endl;
326  G4cerr << "WARNING - Invalid call in "
327  << "G4UnionSolid::DistanceToIn(p)" << G4endl
328  << " Point p is inside !" << G4endl;
329  G4cerr << " p = " << p << G4endl;
330  }
331 #endif
332  G4double distA = fPtrSolidA->DistanceToIn(p) ;
333  G4double distB = fPtrSolidB->DistanceToIn(p) ;
334  G4double safety = std::min(distA,distB) ;
335  if(safety < 0.0) safety = 0.0 ;
336  return safety ;
337 }
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

Here is the call graph for this function:

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 344 of file G4UnionSolid.cc.

349 {
350  G4double dist = 0.0, disTmp = 0.0 ;
351  G4ThreeVector normTmp;
352  G4ThreeVector* nTmp= &normTmp;
353 
354  if( Inside(p) == kOutside )
355  {
356 #ifdef G4BOOLDEBUG
357  G4cout << "Position:" << G4endl << G4endl;
358  G4cout << "p.x() = " << p.x()/mm << " mm" << G4endl;
359  G4cout << "p.y() = " << p.y()/mm << " mm" << G4endl;
360  G4cout << "p.z() = " << p.z()/mm << " mm" << G4endl << G4endl;
361  G4cout << "Direction:" << G4endl << G4endl;
362  G4cout << "v.x() = " << v.x() << G4endl;
363  G4cout << "v.y() = " << v.y() << G4endl;
364  G4cout << "v.z() = " << v.z() << G4endl << G4endl;
365  G4cout << "WARNING - Invalid call in "
366  << "G4UnionSolid::DistanceToOut(p,v)" << G4endl
367  << " Point p is outside !" << G4endl;
368  G4cout << " p = " << p << G4endl;
369  G4cout << " v = " << v << G4endl;
370  G4cerr << "WARNING - Invalid call in "
371  << "G4UnionSolid::DistanceToOut(p,v)" << G4endl
372  << " Point p is outside !" << G4endl;
373  G4cerr << " p = " << p << G4endl;
374  G4cerr << " v = " << v << G4endl;
375 #endif
376  }
377  else
378  {
379  EInside positionA = fPtrSolidA->Inside(p) ;
380  // EInside positionB = fPtrSolidB->Inside(p) ;
381 
382  if( positionA != kOutside )
383  {
384  do // Loop checking, 13.08.2015, G.Cosmo
385  {
386  disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
387  validNorm,nTmp);
388  dist += disTmp ;
389 
390  if(fPtrSolidB->Inside(p+dist*v) != kOutside)
391  {
392  disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
393  validNorm,nTmp);
394  dist += disTmp ;
395  }
396  }
397  while( (fPtrSolidA->Inside(p+dist*v) != kOutside)
398  && (disTmp > 0.5*kCarTolerance) );
399  }
400  else // if( positionB != kOutside )
401  {
402  do // Loop checking, 13.08.2015, G.Cosmo
403  {
404  disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
405  validNorm,nTmp);
406  dist += disTmp ;
407 
408  if(fPtrSolidA->Inside(p+dist*v) != kOutside)
409  {
410  disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
411  validNorm,nTmp);
412  dist += disTmp ;
413  }
414  }
415  while( (fPtrSolidB->Inside(p+dist*v) != kOutside)
416  && (disTmp > 0.5*kCarTolerance) );
417  }
418  }
419  if( calcNorm )
420  {
421  *validNorm = false ;
422  *n = *nTmp ;
423  }
424  return dist ;
425 }
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
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:307
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 G4UnionSolid::DistanceToOut ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 432 of file G4UnionSolid.cc.

433 {
434  G4double distout = 0.0;
435  if( Inside(p) == kOutside )
436  {
437 #ifdef G4BOOLDEBUG
438  G4cout << "WARNING - Invalid call in "
439  << "G4UnionSolid::DistanceToOut(p)" << G4endl
440  << " Point p is outside !" << G4endl;
441  G4cout << " p = " << p << G4endl;
442  G4cerr << "WARNING - Invalid call in "
443  << "G4UnionSolid::DistanceToOut(p)" << G4endl
444  << " Point p is outside !" << G4endl;
445  G4cerr << " p = " << p << G4endl;
446 #endif
447  }
448  else
449  {
450  EInside positionA = fPtrSolidA->Inside(p) ;
451  EInside positionB = fPtrSolidB->Inside(p) ;
452 
453  // Is this equivalent ??
454  // if( ! ( (positionA == kOutside)) &&
455  // (positionB == kOutside)) )
456  if((positionA == kInside && positionB == kInside ) ||
457  (positionA == kInside && positionB == kSurface ) ||
458  (positionA == kSurface && positionB == kInside ) )
459  {
460  distout= std::max(fPtrSolidA->DistanceToOut(p),
461  fPtrSolidB->DistanceToOut(p) ) ;
462  }
463  else
464  {
465  if(positionA == kOutside)
466  {
467  distout= fPtrSolidB->DistanceToOut(p) ;
468  }
469  else
470  {
471  distout= fPtrSolidA->DistanceToOut(p) ;
472  }
473  }
474  }
475  return distout;
476 }
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

Here is the call graph for this function:

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

Reimplemented from G4VSolid.

Definition at line 139 of file G4UnionSolid.cc.

140 {
141  G4ThreeVector minA,maxA, minB,maxB;
142  fPtrSolidA->Extent(minA,maxA);
143  fPtrSolidB->Extent(minB,maxB);
144 
145  pMin.set(std::min(minA.x(),minB.x()),
146  std::min(minA.y(),minB.y()),
147  std::min(minA.z(),minB.z()));
148 
149  pMax.set(std::max(maxA.x(),maxB.x()),
150  std::max(maxA.y(),maxB.y()),
151  std::max(maxA.z(),maxB.z()));
152 
153  // Check correctness of the bounding box
154  //
155  if (pMin.x() >= pMax.x() || pMin.y() >= pMax.y() || pMin.z() >= pMax.z())
156  {
157  std::ostringstream message;
158  message << "Bad bounding box (min >= max) for solid: "
159  << GetName() << " !"
160  << "\npMin = " << pMin
161  << "\npMax = " << pMax;
162  G4Exception("G4UnionSolid::Extent()", "GeomMgt0001", JustWarning, message);
163  DumpInfo();
164  }
165 }
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 G4UnionSolid::GetEntityType ( ) const
virtual

Reimplemented from G4BooleanSolid.

Definition at line 482 of file G4UnionSolid.cc.

483 {
484  return G4String("G4UnionSolid");
485 }
EInside G4UnionSolid::Inside ( const G4ThreeVector p) const
virtual

Implements G4VSolid.

Definition at line 206 of file G4UnionSolid.cc.

207 {
208  EInside positionA = fPtrSolidA->Inside(p);
209  if (positionA == kInside) { return kInside; }
210 
211  static const G4double rtol
213  EInside positionB = fPtrSolidB->Inside(p);
214 
215  if( positionB == kInside ||
216  ( positionA == kSurface && positionB == kSurface &&
217  ( fPtrSolidA->SurfaceNormal(p) +
218  fPtrSolidB->SurfaceNormal(p) ).mag2() < rtol ) )
219  {
220  return kInside;
221  }
222  else
223  {
224  if( ( positionB == kSurface ) || ( positionA == kSurface ) )
225  { return kSurface; }
226  else
227  { return kOutside; }
228  }
229 }
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
double G4double
Definition: G4Types.hh:76
static G4GeometryTolerance * GetInstance()

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 122 of file G4UnionSolid.cc.

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)

Here is the call graph for this function:

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

Implements G4VSolid.

Definition at line 236 of file G4UnionSolid.cc.

237 {
239 
240 #ifdef G4BOOLDEBUG
241  if( Inside(p) == kOutside )
242  {
243  G4cout << "WARNING - Invalid call in "
244  << "G4UnionSolid::SurfaceNormal(p)" << G4endl
245  << " Point p is outside !" << G4endl;
246  G4cout << " p = " << p << G4endl;
247  G4cerr << "WARNING - Invalid call in "
248  << "G4UnionSolid::SurfaceNormal(p)" << G4endl
249  << " Point p is outside !" << G4endl;
250  G4cerr << " p = " << p << G4endl;
251  }
252 #endif
253 
254  if(fPtrSolidA->Inside(p) == kSurface && fPtrSolidB->Inside(p) != kInside)
255  {
256  normal= fPtrSolidA->SurfaceNormal(p) ;
257  }
258  else if(fPtrSolidB->Inside(p) == kSurface &&
259  fPtrSolidA->Inside(p) != kInside)
260  {
261  normal= fPtrSolidB->SurfaceNormal(p) ;
262  }
263  else
264  {
265  normal= fPtrSolidA->SurfaceNormal(p) ;
266 #ifdef G4BOOLDEBUG
267  if(Inside(p)==kInside)
268  {
269  G4cout << "WARNING - Invalid call in "
270  << "G4UnionSolid::SurfaceNormal(p)" << G4endl
271  << " Point p is inside !" << G4endl;
272  G4cout << " p = " << p << G4endl;
273  G4cerr << "WARNING - Invalid call in "
274  << "G4UnionSolid::SurfaceNormal(p)" << G4endl
275  << " Point p is inside !" << G4endl;
276  G4cerr << " p = " << p << G4endl;
277  }
278 #endif
279  }
280  return normal;
281 }
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
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
G4VSolid * fPtrSolidA
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:


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