Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SubtractionSolid Class Reference

#include <G4SubtractionSolid.hh>

+ Inheritance diagram for G4SubtractionSolid:

Public Member Functions

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

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 53 of file G4SubtractionSolid.hh.

Constructor & Destructor Documentation

◆ G4SubtractionSolid() [1/5]

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

Definition at line 62 of file G4SubtractionSolid.cc.

65 : G4BooleanSolid(pName,pSolidA,pSolidB)
66{
67}

◆ G4SubtractionSolid() [2/5]

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

Definition at line 73 of file G4SubtractionSolid.cc.

78 : G4BooleanSolid(pName,pSolidA,pSolidB,rotMatrix,transVector)
79{
80}

◆ G4SubtractionSolid() [3/5]

G4SubtractionSolid::G4SubtractionSolid ( const G4String pName,
G4VSolid pSolidA,
G4VSolid pSolidB,
const G4Transform3D transform 
)

Definition at line 86 of file G4SubtractionSolid.cc.

90 : G4BooleanSolid(pName,pSolidA,pSolidB,transform)
91{
92}

◆ ~G4SubtractionSolid()

G4SubtractionSolid::~G4SubtractionSolid ( )
virtual

Definition at line 108 of file G4SubtractionSolid.cc.

109{
110}

◆ G4SubtractionSolid() [4/5]

G4SubtractionSolid::G4SubtractionSolid ( __void__ &  a)

Definition at line 99 of file G4SubtractionSolid.cc.

100 : G4BooleanSolid(a)
101{
102}

◆ G4SubtractionSolid() [5/5]

G4SubtractionSolid::G4SubtractionSolid ( const G4SubtractionSolid rhs)

Definition at line 116 of file G4SubtractionSolid.cc.

117 : G4BooleanSolid (rhs)
118{
119}

Member Function Documentation

◆ CalculateExtent()

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

Implements G4VSolid.

Definition at line 144 of file G4SubtractionSolid.cc.

149{
150 // Since we cannot be sure how much the second solid subtracts
151 // from the first, we must use the first solid's extent!
152
153 return fPtrSolidA->CalculateExtent( pAxis, pVoxelLimit,
154 pTransform, pMin, pMax );
155}
G4VSolid * fPtrSolidA
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0

◆ Clone()

G4VSolid * G4SubtractionSolid::Clone ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 520 of file G4SubtractionSolid.cc.

521{
522 return new G4SubtractionSolid(*this);
523}

◆ ComputeDimensions()

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

Reimplemented from G4VSolid.

Definition at line 530 of file G4SubtractionSolid.cc.

533{
534}

◆ CreateNURBS()

G4NURBS * G4SubtractionSolid::CreateNURBS ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 567 of file G4SubtractionSolid.cc.

568{
569 // Take into account boolean operation - see CreatePolyhedron.
570 // return new G4NURBSbox (1.0, 1.0, 1.0);
571 return 0;
572}

◆ CreatePolyhedron()

G4Polyhedron * G4SubtractionSolid::CreatePolyhedron ( ) const
virtual

Reimplemented from G4VSolid.

Definition at line 551 of file G4SubtractionSolid.cc.

552{
554 // Stack components and components of components recursively
555 // See G4BooleanSolid::StackPolyhedron
557 G4Polyhedron* result = new G4Polyhedron(*top);
558 if (processor.execute(*result)) { return result; }
559 else { return 0; }
560}
G4Polyhedron * StackPolyhedron(HepPolyhedronProcessor &, const G4VSolid *) const
#define processor
Definition: xmlparse.cc:600

◆ DescribeYourselfTo()

void G4SubtractionSolid::DescribeYourselfTo ( G4VGraphicsScene scene) const
virtual

Implements G4VSolid.

Definition at line 541 of file G4SubtractionSolid.cc.

542{
543 scene.AddSolid (*this);
544}
virtual void AddSolid(const G4Box &)=0

◆ DistanceToIn() [1/2]

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

Implements G4VSolid.

Definition at line 392 of file G4SubtractionSolid.cc.

393{
394 G4double dist=0.0;
395
396#ifdef G4BOOLDEBUG
397 if( Inside(p) == kInside )
398 {
399 G4cout << "WARNING - Invalid call in "
400 << "G4SubtractionSolid::DistanceToIn(p)" << G4endl
401 << " Point p is inside !" << G4endl;
402 G4cout << " p = " << p << G4endl;
403 G4cerr << "WARNING - Invalid call in "
404 << "G4SubtractionSolid::DistanceToIn(p)" << G4endl
405 << " Point p is inside !" << G4endl;
406 G4cerr << " p = " << p << G4endl;
407 }
408#endif
409
410 if( ( fPtrSolidA->Inside(p) != kOutside) && // case 1
411 ( fPtrSolidB->Inside(p) != kOutside) )
412 {
413 dist= fPtrSolidB->DistanceToOut(p) ;
414 }
415 else
416 {
417 dist= fPtrSolidA->DistanceToIn(p) ;
418 }
419
420 return dist;
421}
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
G4VSolid * fPtrSolidB
EInside Inside(const G4ThreeVector &p) const
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
@ kInside
Definition: geomdefs.hh:58
@ kOutside
Definition: geomdefs.hh:58

◆ DistanceToIn() [2/2]

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

Implements G4VSolid.

Definition at line 256 of file G4SubtractionSolid.cc.

258{
259 G4double dist = 0.0,disTmp = 0.0 ;
260
261#ifdef G4BOOLDEBUG
262 if( Inside(p) == kInside )
263 {
264 G4cout << "WARNING - Invalid call in "
265 << "G4SubtractionSolid::DistanceToIn(p,v)" << G4endl
266 << " Point p is inside !" << G4endl;
267 G4cout << " p = " << p << G4endl;
268 G4cout << " v = " << v << G4endl;
269 G4cerr << "WARNING - Invalid call in "
270 << "G4SubtractionSolid::DistanceToIn(p,v)" << G4endl
271 << " Point p is inside !" << G4endl;
272 G4cerr << " p = " << p << G4endl;
273 G4cerr << " v = " << v << G4endl;
274 }
275#endif
276
277 // if( // ( fPtrSolidA->Inside(p) != kOutside) && // case1:p in both A&B
278 if ( fPtrSolidB->Inside(p) != kOutside ) // start: out of B
279 {
280 dist = fPtrSolidB->DistanceToOut(p,v) ; // ,calcNorm,validNorm,n) ;
281
282 if( fPtrSolidA->Inside(p+dist*v) != kInside )
283 {
284 G4int count1=0;
285 do
286 {
287 disTmp = fPtrSolidA->DistanceToIn(p+dist*v,v) ;
288
289 if(disTmp == kInfinity)
290 {
291 return kInfinity ;
292 }
293 dist += disTmp ;
294
295 if( Inside(p+dist*v) == kOutside )
296 {
297 disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v) ;
298 dist += disTmp ;
299 count1++;
300 if( count1 > 1000 ) // Infinite loop detected
301 {
302 G4String nameB = fPtrSolidB->GetName();
303 if(fPtrSolidB->GetEntityType()=="G4DisplacedSolid")
304 {
305 nameB = (dynamic_cast<G4DisplacedSolid*>(fPtrSolidB))
306 ->GetConstituentMovedSolid()->GetName();
307 }
308 std::ostringstream message;
309 message << "Illegal condition caused by solids: "
310 << fPtrSolidA->GetName() << " and " << nameB << G4endl;
311 message.precision(16);
312 message << "Looping detected in point " << p+dist*v
313 << ", from original point " << p
314 << " and direction " << v << G4endl
315 << "Computed candidate distance: " << dist << "*mm.";
316 message.precision(6);
317 DumpInfo();
318 G4Exception("G4SubtractionSolid::DistanceToIn(p,v)",
319 "GeomSolids1001", JustWarning, message,
320 "Returning candidate distance.");
321 return dist;
322 }
323 }
324 }
325 while( Inside(p+dist*v) == kOutside ) ;
326 }
327 }
328 else // p outside A, start in A
329 {
330 dist = fPtrSolidA->DistanceToIn(p,v) ;
331
332 if( dist == kInfinity ) // past A, hence past A\B
333 {
334 return kInfinity ;
335 }
336 else
337 {
338 G4int count2=0;
339 while( Inside(p+dist*v) == kOutside ) // pushing loop
340 {
341 disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v) ;
342 dist += disTmp ;
343
344 if( Inside(p+dist*v) == kOutside )
345 {
346 disTmp = fPtrSolidA->DistanceToIn(p+dist*v,v) ;
347
348 if(disTmp == kInfinity) // past A, hence past A\B
349 {
350 return kInfinity ;
351 }
352 dist += disTmp ;
353 count2++;
354 if( count2 > 1000 ) // Infinite loop detected
355 {
356 G4String nameB = fPtrSolidB->GetName();
357 if(fPtrSolidB->GetEntityType()=="G4DisplacedSolid")
358 {
359 nameB = (dynamic_cast<G4DisplacedSolid*>(fPtrSolidB))
360 ->GetConstituentMovedSolid()->GetName();
361 }
362 std::ostringstream message;
363 message << "Illegal condition caused by solids: "
364 << fPtrSolidA->GetName() << " and " << nameB << G4endl;
365 message.precision(16);
366 message << "Looping detected in point " << p+dist*v
367 << ", from original point " << p
368 << " and direction " << v << G4endl
369 << "Computed candidate distance: " << dist << "*mm.";
370 message.precision(6);
371 DumpInfo();
372 G4Exception("G4SubtractionSolid::DistanceToIn(p,v)",
373 "GeomSolids1001", JustWarning, message);
374 return dist;
375
376 }
377 }
378 }
379 }
380 }
381
382 return dist ;
383}
@ JustWarning
int G4int
Definition: G4Types.hh:66
G4String GetName() const
void DumpInfo() const
virtual G4GeometryType GetEntityType() const =0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ DistanceToOut() [1/2]

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

Implements G4VSolid.

Definition at line 482 of file G4SubtractionSolid.cc.

483{
484 G4double dist=0.0;
485
486 if( Inside(p) == kOutside )
487 {
488#ifdef G4BOOLDEBUG
489 G4cout << "WARNING - Invalid call in "
490 << "G4SubtractionSolid::DistanceToOut(p)" << G4endl
491 << " Point p is outside" << G4endl;
492 G4cout << " p = " << p << G4endl;
493 G4cerr << "WARNING - Invalid call in "
494 << "G4SubtractionSolid::DistanceToOut(p)" << G4endl
495 << " Point p is outside" << G4endl;
496 G4cerr << " p = " << p << G4endl;
497#endif
498 }
499 else
500 {
501 dist= std::min(fPtrSolidA->DistanceToOut(p),
502 fPtrSolidB->DistanceToIn(p) ) ;
503 }
504 return dist;
505}

◆ DistanceToOut() [2/2]

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

Implements G4VSolid.

Definition at line 428 of file G4SubtractionSolid.cc.

433{
434#ifdef G4BOOLDEBUG
435 if( Inside(p) == kOutside )
436 {
437 G4cout << "Position:" << G4endl << G4endl;
438 G4cout << "p.x() = " << p.x()/mm << " mm" << G4endl;
439 G4cout << "p.y() = " << p.y()/mm << " mm" << G4endl;
440 G4cout << "p.z() = " << p.z()/mm << " mm" << G4endl << G4endl;
441 G4cout << "Direction:" << G4endl << G4endl;
442 G4cout << "v.x() = " << v.x() << G4endl;
443 G4cout << "v.y() = " << v.y() << G4endl;
444 G4cout << "v.z() = " << v.z() << G4endl << G4endl;
445 G4cout << "WARNING - Invalid call in "
446 << "G4SubtractionSolid::DistanceToOut(p,v)" << G4endl
447 << " Point p is outside !" << G4endl;
448 G4cout << " p = " << p << G4endl;
449 G4cout << " v = " << v << G4endl;
450 G4cerr << "WARNING - Invalid call in "
451 << "G4SubtractionSolid::DistanceToOut(p,v)" << G4endl
452 << " Point p is outside !" << G4endl;
453 G4cerr << " p = " << p << G4endl;
454 G4cerr << " v = " << v << G4endl;
455 }
456#endif
457
458 G4double distout;
459 G4double distA = fPtrSolidA->DistanceToOut(p,v,calcNorm,validNorm,n) ;
460 G4double distB = fPtrSolidB->DistanceToIn(p,v) ;
461 if(distB < distA)
462 {
463 if(calcNorm)
464 {
465 *n = -(fPtrSolidB->SurfaceNormal(p+distB*v)) ;
466 *validNorm = false ;
467 }
468 distout= distB ;
469 }
470 else
471 {
472 distout= distA ;
473 }
474 return distout;
475}
double z() const
double x() const
double y() const
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0

◆ GetEntityType()

G4GeometryType G4SubtractionSolid::GetEntityType ( ) const
virtual

Reimplemented from G4BooleanSolid.

Definition at line 511 of file G4SubtractionSolid.cc.

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

◆ Inside()

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

Implements G4VSolid.

Definition at line 161 of file G4SubtractionSolid.cc.

162{
163 EInside positionA = fPtrSolidA->Inside(p);
164 if (positionA == kOutside) return kOutside;
165
166 EInside positionB = fPtrSolidB->Inside(p);
167
168 if(positionA == kInside && positionB == kOutside)
169 {
170 return kInside ;
171 }
172 else
173 {
174 if(( positionA == kInside && positionB == kSurface) ||
175 ( positionB == kOutside && positionA == kSurface) ||
176 ( positionA == kSurface && positionB == kSurface &&
178 fPtrSolidB->SurfaceNormal(p) ).mag2() >
180 {
181 return kSurface;
182 }
183 else
184 {
185 return kOutside;
186 }
187 }
188}
G4double GetRadialTolerance() const
static G4GeometryTolerance * GetInstance()
EInside
Definition: geomdefs.hh:58
@ kSurface
Definition: geomdefs.hh:58

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

◆ operator=()

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

Definition at line 126 of file G4SubtractionSolid.cc.

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

◆ SurfaceNormal()

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

Implements G4VSolid.

Definition at line 195 of file G4SubtractionSolid.cc.

196{
197 G4ThreeVector normal;
198 if( Inside(p) == kOutside )
199 {
200#ifdef G4BOOLDEBUG
201 G4cout << "WARNING - Invalid call [1] in "
202 << "G4SubtractionSolid::SurfaceNormal(p)" << G4endl
203 << " Point p is inside !" << G4endl;
204 G4cout << " p = " << p << G4endl;
205 G4cerr << "WARNING - Invalid call [1] in "
206 << "G4SubtractionSolid::SurfaceNormal(p)" << G4endl
207 << " Point p is inside !" << G4endl;
208 G4cerr << " p = " << p << G4endl;
209#endif
210 }
211 else
212 {
213 if( fPtrSolidA->Inside(p) == kSurface &&
214 fPtrSolidB->Inside(p) != kInside )
215 {
216 normal = fPtrSolidA->SurfaceNormal(p) ;
217 }
218 else if( fPtrSolidA->Inside(p) == kInside &&
219 fPtrSolidB->Inside(p) != kOutside )
220 {
221 normal = -fPtrSolidB->SurfaceNormal(p) ;
222 }
223 else
224 {
226 {
227 normal = fPtrSolidA->SurfaceNormal(p) ;
228 }
229 else
230 {
231 normal = -fPtrSolidB->SurfaceNormal(p) ;
232 }
233#ifdef G4BOOLDEBUG
234 if(Inside(p) == kInside)
235 {
236 G4cout << "WARNING - Invalid call [2] in "
237 << "G4SubtractionSolid::SurfaceNormal(p)" << G4endl
238 << " Point p is inside !" << G4endl;
239 G4cout << " p = " << p << G4endl;
240 G4cerr << "WARNING - Invalid call [2] in "
241 << "G4SubtractionSolid::SurfaceNormal(p)" << G4endl
242 << " Point p is inside !" << G4endl;
243 G4cerr << " p = " << p << G4endl;
244 }
245#endif
246 }
247 }
248 return normal;
249}

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