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

#include <G4BoundingSphereScene.hh>

Inheritance diagram for G4BoundingSphereScene:
Collaboration 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 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 const G4VisExtentGetExtent () const
 

Additional Inherited Members

- Protected Attributes inherited from G4PseudoScene
const G4Transform3DfpCurrentObjectTransformation
 

Detailed Description

Definition at line 41 of file G4BoundingSphereScene.hh.

Constructor & Destructor Documentation

G4BoundingSphereScene::G4BoundingSphereScene ( G4VModel pModel = 0)

Definition at line 39 of file G4BoundingSphereScene.cc.

40 :fpModel(pModel)
41 ,fRadius(-1.)
42 {}
G4BoundingSphereScene::~G4BoundingSphereScene ( )
virtual

Definition at line 44 of file G4BoundingSphereScene.cc.

44 {}

Member Function Documentation

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

Definition at line 72 of file G4BoundingSphereScene.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4VisExtent G4BoundingSphereScene::GetBoundingSphereExtent ( )

Definition at line 46 of file G4BoundingSphereScene.cc.

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

Here is the caller graph for this function:

const G4Point3D& G4BoundingSphereScene::GetCentre ( ) const
inline

Definition at line 51 of file G4BoundingSphereScene.hh.

51 {return fCentre;}

Here is the caller graph for this function:

G4double G4BoundingSphereScene::GetRadius ( ) const
inline

Definition at line 53 of file G4BoundingSphereScene.hh.

53 {return fRadius;}

Here is the caller graph for this function:

void G4BoundingSphereScene::ResetBoundingSphere ( )

Definition at line 65 of file G4BoundingSphereScene.cc.

65  {
66  fCentre = G4Point3D ();
67  fRadius = -1.;
69 }
const G4Transform3D * fpCurrentObjectTransformation
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35
void G4BoundingSphereScene::SetCentre ( const G4Point3D centre)
inline

Definition at line 55 of file G4BoundingSphereScene.hh.

55 {fCentre = centre;}

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