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

#include <G4BoundingSphereScene.hh>

+ Inheritance diagram for G4BoundingSphereScene:

Public Member Functions

 G4BoundingSphereScene (G4VModel *pModel=0)
 
virtual ~G4BoundingSphereScene ()
 
G4VisExtent GetBoundingSphereExtent ()
 
const G4Point3DGetCentre () const
 
G4double GetRadius () const
 
void SetCentre (const G4Point3D &centre)
 
void ResetBoundingSphere ()
 
void AccrueBoundingSphere (const G4Point3D &centre, G4double radius)
 
- Public Member Functions inherited from G4PseudoScene
 G4PseudoScene ()
 
virtual ~G4PseudoScene ()
 
void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
void PostAddSolid ()
 
void AddSolid (const G4Box &solid)
 
void AddSolid (const G4Cons &solid)
 
void AddSolid (const G4Orb &solid)
 
void AddSolid (const G4Para &solid)
 
void AddSolid (const G4Sphere &solid)
 
void AddSolid (const G4Torus &solid)
 
void AddSolid (const G4Trap &solid)
 
void AddSolid (const G4Trd &solid)
 
void AddSolid (const G4Tubs &solid)
 
void AddSolid (const G4Ellipsoid &solid)
 
void AddSolid (const G4Polycone &solid)
 
void AddSolid (const G4Polyhedra &solid)
 
void AddSolid (const G4TessellatedSolid &solid)
 
void AddSolid (const G4VSolid &solid)
 
void AddCompound (const G4VTrajectory &)
 
void AddCompound (const G4VHit &)
 
void AddCompound (const G4VDigi &)
 
void AddCompound (const G4THitsMap< G4double > &)
 
void AddCompound (const G4THitsMap< G4StatDouble > &)
 
void BeginPrimitives (const G4Transform3D &)
 
void EndPrimitives ()
 
void BeginPrimitives2D (const G4Transform3D &)
 
void EndPrimitives2D ()
 
void AddPrimitive (const G4Polyline &)
 
void AddPrimitive (const G4Scale &)
 
void AddPrimitive (const G4Text &)
 
void AddPrimitive (const G4Circle &)
 
void AddPrimitive (const G4Square &)
 
void AddPrimitive (const G4Polymarker &)
 
void AddPrimitive (const G4Polyhedron &)
 
- Public Member Functions inherited from G4VGraphicsScene
 G4VGraphicsScene ()
 
virtual ~G4VGraphicsScene ()
 
virtual void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &visAttribs)=0
 
virtual void PostAddSolid ()=0
 
virtual void AddSolid (const G4Box &)=0
 
virtual void AddSolid (const G4Cons &)=0
 
virtual void AddSolid (const G4Orb &)=0
 
virtual void AddSolid (const G4Para &)=0
 
virtual void AddSolid (const G4Sphere &)=0
 
virtual void AddSolid (const G4Torus &)=0
 
virtual void AddSolid (const G4Trap &)=0
 
virtual void AddSolid (const G4Trd &)=0
 
virtual void AddSolid (const G4Tubs &)=0
 
virtual void AddSolid (const G4Ellipsoid &)=0
 
virtual void AddSolid (const G4Polycone &)=0
 
virtual void AddSolid (const G4Polyhedra &)=0
 
virtual void AddSolid (const G4TessellatedSolid &)=0
 
virtual void AddSolid (const G4VSolid &)=0
 
virtual void AddCompound (const G4VTrajectory &)=0
 
virtual void AddCompound (const G4VHit &)=0
 
virtual void AddCompound (const G4VDigi &)=0
 
virtual void AddCompound (const G4THitsMap< G4double > &)=0
 
virtual void AddCompound (const G4THitsMap< G4StatDouble > &)=0
 
virtual void BeginPrimitives (const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void EndPrimitives ()=0
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void EndPrimitives2D ()=0
 
virtual void AddPrimitive (const G4Polyline &)=0
 
virtual void AddPrimitive (const G4Scale &)=0
 
virtual void AddPrimitive (const G4Text &)=0
 
virtual void AddPrimitive (const G4Circle &)=0
 
virtual void AddPrimitive (const G4Square &)=0
 
virtual void AddPrimitive (const G4Polymarker &)=0
 
virtual void AddPrimitive (const G4Polyhedron &)=0
 
virtual const G4VisExtentGetExtent () const
 

Additional Inherited Members

virtual void ProcessVolume (const G4VSolid &)=0
 
- Protected Attributes inherited from G4PseudoScene
const G4Transform3DfpCurrentObjectTransformation
 

Detailed Description

Definition at line 40 of file G4BoundingSphereScene.hh.

Constructor & Destructor Documentation

◆ G4BoundingSphereScene()

G4BoundingSphereScene::G4BoundingSphereScene ( G4VModel pModel = 0)

Definition at line 38 of file G4BoundingSphereScene.cc.

39:fpModel(pModel)
40,fRadius(-1.)
41{}

◆ ~G4BoundingSphereScene()

G4BoundingSphereScene::~G4BoundingSphereScene ( )
virtual

Definition at line 43 of file G4BoundingSphereScene.cc.

43{}

Member Function Documentation

◆ AccrueBoundingSphere()

void G4BoundingSphereScene::AccrueBoundingSphere ( const G4Point3D centre,
G4double  radius 
)

Definition at line 70 of file G4BoundingSphereScene.cc.

72 {
73
74 if (fRadius < 0 ) { // First time.
75 fCentre = newCentre;
76 fRadius = newRadius;
77 }
78 else {
79 G4Vector3D join = newCentre - fCentre;
80 if (join == G4Vector3D (0., 0., 0.)) { // Centres coincide.
81 if (fRadius < newRadius) fRadius = newRadius;
82 }
83 else if (join.mag () + newRadius <= fRadius) { // Inside accrued sphere.
84 // Do nothing.
85 }
86 else {
87 G4Vector3D unitJoin = join.unit ();
88 G4Point3D oldExtremity1 = fCentre - fRadius * unitJoin;
89 G4Point3D newExtremity1 = newCentre - newRadius * unitJoin;
90 G4Point3D oldExtremity2 = fCentre + fRadius * unitJoin;
91 G4Point3D newExtremity2 = newCentre + newRadius * unitJoin;
92 G4Point3D extremity1;
93 if (oldExtremity1 * unitJoin < newExtremity1 * unitJoin) {
94 extremity1 = oldExtremity1;
95 }
96 else {
97 extremity1 = newExtremity1;
98 }
99 G4Point3D extremity2;
100 if (oldExtremity2 * unitJoin > newExtremity2 * unitJoin) {
101 extremity2 = oldExtremity2;
102 }
103 else {
104 extremity2 = newExtremity2;
105 }
106 fCentre = 0.5 * (extremity2 + extremity1);
107 fRadius = 0.5 * (extremity2 - extremity1).mag ();
108 }
109 }
110}
BasicVector3D< T > unit() const

◆ GetBoundingSphereExtent()

G4VisExtent G4BoundingSphereScene::GetBoundingSphereExtent ( )

Definition at line 45 of file G4BoundingSphereScene.cc.

45 {
46 return G4VisExtent (fCentre, fRadius);
47}

◆ GetCentre()

const G4Point3D & G4BoundingSphereScene::GetCentre ( ) const
inline

Definition at line 50 of file G4BoundingSphereScene.hh.

50{return fCentre;}

◆ GetRadius()

G4double G4BoundingSphereScene::GetRadius ( ) const
inline

Definition at line 52 of file G4BoundingSphereScene.hh.

52{return fRadius;}

◆ ResetBoundingSphere()

void G4BoundingSphereScene::ResetBoundingSphere ( )

Definition at line 64 of file G4BoundingSphereScene.cc.

64 {
65 fCentre = G4Point3D ();
66 fRadius = -1.;
68}
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:34
const G4Transform3D * fpCurrentObjectTransformation

◆ SetCentre()

void G4BoundingSphereScene::SetCentre ( const G4Point3D centre)
inline

Definition at line 54 of file G4BoundingSphereScene.hh.

54{fCentre = centre;}

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