Geant4 9.6.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 ()
 
void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
void PostAddSolid ()
 
void AddSolid (const G4Box &solid)
 
void AddSolid (const G4Cons &solid)
 
void AddSolid (const G4Tubs &solid)
 
void AddSolid (const G4Trd &solid)
 
void AddSolid (const G4Trap &solid)
 
void AddSolid (const G4Sphere &solid)
 
void AddSolid (const G4Para &solid)
 
void AddSolid (const G4Torus &solid)
 
void AddSolid (const G4Polycone &solid)
 
void AddSolid (const G4Polyhedra &solid)
 
void AddSolid (const G4VSolid &solid)
 
void AddCompound (const G4VTrajectory &)
 
void AddCompound (const G4VHit &)
 
void AddCompound (const G4VDigi &)
 
void AddCompound (const G4THitsMap< G4double > &)
 
G4VisExtent GetBoundingSphereExtent ()
 
const G4Point3DGetCentre () const
 
G4double GetRadius () const
 
void SetCentre (const G4Point3D &centre)
 
void ResetBoundingSphere ()
 
void AccrueBoundingSphere (const G4Point3D &centre, G4double radius)
 
virtual void BeginPrimitives (const G4Transform3D &)
 
virtual void EndPrimitives ()
 
virtual void BeginPrimitives2D (const G4Transform3D &)
 
virtual void EndPrimitives2D ()
 
virtual void AddPrimitive (const G4Polyline &)
 
virtual void AddPrimitive (const G4Scale &)
 
virtual void AddPrimitive (const G4Text &)
 
virtual void AddPrimitive (const G4Circle &)
 
virtual void AddPrimitive (const G4Square &)
 
virtual void AddPrimitive (const G4Polymarker &)
 
virtual void AddPrimitive (const G4Polyhedron &)
 
virtual void AddPrimitive (const G4NURBS &)
 
- 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 G4Tubs &)=0
 
virtual void AddSolid (const G4Trd &)=0
 
virtual void AddSolid (const G4Trap &)=0
 
virtual void AddSolid (const G4Sphere &)=0
 
virtual void AddSolid (const G4Para &)=0
 
virtual void AddSolid (const G4Torus &)=0
 
virtual void AddSolid (const G4Polycone &)=0
 
virtual void AddSolid (const G4Polyhedra &)=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 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 void AddPrimitive (const G4NURBS &)=0
 

Detailed Description

Definition at line 51 of file G4BoundingSphereScene.hh.

Constructor & Destructor Documentation

◆ G4BoundingSphereScene()

G4BoundingSphereScene::G4BoundingSphereScene ( G4VModel pModel = 0)

Definition at line 39 of file G4BoundingSphereScene.cc.

39 :
40 fpModel (pModel),
41 fRadius (-1.),
42 fpObjectTransformation (0)
43{}

◆ ~G4BoundingSphereScene()

G4BoundingSphereScene::~G4BoundingSphereScene ( )
virtual

Definition at line 45 of file G4BoundingSphereScene.cc.

45{}

Member Function Documentation

◆ AccrueBoundingSphere()

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

Definition at line 78 of file G4BoundingSphereScene.cc.

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

Referenced by G4Scene::CalculateExtent().

◆ AddCompound() [1/4]

void G4BoundingSphereScene::AddCompound ( const G4THitsMap< G4double > &  )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 73 of file G4BoundingSphereScene.hh.

73{}

◆ AddCompound() [2/4]

void G4BoundingSphereScene::AddCompound ( const G4VDigi )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 72 of file G4BoundingSphereScene.hh.

72{}

◆ AddCompound() [3/4]

void G4BoundingSphereScene::AddCompound ( const G4VHit )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 71 of file G4BoundingSphereScene.hh.

71{}

◆ AddCompound() [4/4]

void G4BoundingSphereScene::AddCompound ( const G4VTrajectory )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 70 of file G4BoundingSphereScene.hh.

70{}

◆ AddPrimitive() [1/8]

virtual void G4BoundingSphereScene::AddPrimitive ( const G4Circle )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 99 of file G4BoundingSphereScene.hh.

99{}

◆ AddPrimitive() [2/8]

virtual void G4BoundingSphereScene::AddPrimitive ( const G4NURBS )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 103 of file G4BoundingSphereScene.hh.

103{}

◆ AddPrimitive() [3/8]

virtual void G4BoundingSphereScene::AddPrimitive ( const G4Polyhedron )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 102 of file G4BoundingSphereScene.hh.

102{}

◆ AddPrimitive() [4/8]

virtual void G4BoundingSphereScene::AddPrimitive ( const G4Polyline )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 96 of file G4BoundingSphereScene.hh.

96{}

◆ AddPrimitive() [5/8]

virtual void G4BoundingSphereScene::AddPrimitive ( const G4Polymarker )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 101 of file G4BoundingSphereScene.hh.

101{}

◆ AddPrimitive() [6/8]

virtual void G4BoundingSphereScene::AddPrimitive ( const G4Scale )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 97 of file G4BoundingSphereScene.hh.

97{}

◆ AddPrimitive() [7/8]

virtual void G4BoundingSphereScene::AddPrimitive ( const G4Square )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 100 of file G4BoundingSphereScene.hh.

100{}

◆ AddPrimitive() [8/8]

virtual void G4BoundingSphereScene::AddPrimitive ( const G4Text )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 98 of file G4BoundingSphereScene.hh.

98{}

◆ AddSolid() [1/11]

void G4BoundingSphereScene::AddSolid ( const G4Box solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 59 of file G4BoundingSphereScene.hh.

59{Accrue (solid);}

◆ AddSolid() [2/11]

void G4BoundingSphereScene::AddSolid ( const G4Cons solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 60 of file G4BoundingSphereScene.hh.

60{Accrue (solid);}

◆ AddSolid() [3/11]

void G4BoundingSphereScene::AddSolid ( const G4Para solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 65 of file G4BoundingSphereScene.hh.

65{Accrue (solid);}

◆ AddSolid() [4/11]

void G4BoundingSphereScene::AddSolid ( const G4Polycone solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 67 of file G4BoundingSphereScene.hh.

67{Accrue (solid);}

◆ AddSolid() [5/11]

void G4BoundingSphereScene::AddSolid ( const G4Polyhedra solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 68 of file G4BoundingSphereScene.hh.

68{Accrue (solid);}

◆ AddSolid() [6/11]

void G4BoundingSphereScene::AddSolid ( const G4Sphere solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 64 of file G4BoundingSphereScene.hh.

64{Accrue (solid);}

◆ AddSolid() [7/11]

void G4BoundingSphereScene::AddSolid ( const G4Torus solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 66 of file G4BoundingSphereScene.hh.

66{Accrue (solid);}

◆ AddSolid() [8/11]

void G4BoundingSphereScene::AddSolid ( const G4Trap solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 63 of file G4BoundingSphereScene.hh.

63{Accrue (solid);}

◆ AddSolid() [9/11]

void G4BoundingSphereScene::AddSolid ( const G4Trd solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 62 of file G4BoundingSphereScene.hh.

62{Accrue (solid);}

◆ AddSolid() [10/11]

void G4BoundingSphereScene::AddSolid ( const G4Tubs solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 61 of file G4BoundingSphereScene.hh.

61{Accrue (solid);}

◆ AddSolid() [11/11]

void G4BoundingSphereScene::AddSolid ( const G4VSolid solid)
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 69 of file G4BoundingSphereScene.hh.

69{Accrue (solid);}

◆ BeginPrimitives()

virtual void G4BoundingSphereScene::BeginPrimitives ( const G4Transform3D )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 92 of file G4BoundingSphereScene.hh.

92{}

◆ BeginPrimitives2D()

virtual void G4BoundingSphereScene::BeginPrimitives2D ( const G4Transform3D )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 94 of file G4BoundingSphereScene.hh.

94{}

◆ EndPrimitives()

virtual void G4BoundingSphereScene::EndPrimitives ( )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 93 of file G4BoundingSphereScene.hh.

93{}

◆ EndPrimitives2D()

virtual void G4BoundingSphereScene::EndPrimitives2D ( )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 95 of file G4BoundingSphereScene.hh.

95{}

◆ GetBoundingSphereExtent()

G4VisExtent G4BoundingSphereScene::GetBoundingSphereExtent ( )

Definition at line 53 of file G4BoundingSphereScene.cc.

53 {
54 return G4VisExtent (fCentre, fRadius);
55}

Referenced by G4Scene::CalculateExtent().

◆ GetCentre()

const G4Point3D & G4BoundingSphereScene::GetCentre ( ) const
inline

Definition at line 75 of file G4BoundingSphereScene.hh.

75{return fCentre;}

Referenced by G4PhysicalVolumeModel::CalculateExtent().

◆ GetRadius()

G4double G4BoundingSphereScene::GetRadius ( ) const
inline

Definition at line 76 of file G4BoundingSphereScene.hh.

76{return fRadius;}

Referenced by G4PhysicalVolumeModel::CalculateExtent().

◆ PostAddSolid()

void G4BoundingSphereScene::PostAddSolid ( )
inlinevirtual

Implements G4VGraphicsScene.

Definition at line 58 of file G4BoundingSphereScene.hh.

58{}

◆ PreAddSolid()

void G4BoundingSphereScene::PreAddSolid ( const G4Transform3D objectTransformation,
const G4VisAttributes  
)
virtual

Implements G4VGraphicsScene.

Definition at line 47 of file G4BoundingSphereScene.cc.

49 {
50 fpObjectTransformation = &objectTransformation;
51}

◆ ResetBoundingSphere()

void G4BoundingSphereScene::ResetBoundingSphere ( )

Definition at line 72 of file G4BoundingSphereScene.cc.

72 {
73 fCentre = G4Point3D ();
74 fRadius = -1.;
75 fpObjectTransformation = 0;
76}
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35

◆ SetCentre()

void G4BoundingSphereScene::SetCentre ( const G4Point3D centre)
inline

Definition at line 78 of file G4BoundingSphereScene.hh.

78{fCentre = centre;}

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