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

#include <G4VisExtent.hh>

Public Member Functions

 G4VisExtent (G4double xmin=0., G4double xmax=0., G4double ymin=0., G4double ymax=0., G4double zmin=0., G4double zmax=0.)
 
 G4VisExtent (const G4Point3D &centre, G4double radius)
 
 ~G4VisExtent ()
 
G4bool operator!= (const G4VisExtent &e) const
 
G4double GetXmin () const
 
G4double GetXmax () const
 
G4double GetYmin () const
 
G4double GetYmax () const
 
G4double GetZmin () const
 
G4double GetZmax () const
 
const G4Point3DGetExtentCentre () const
 
const G4Point3DGetExtentCenter () const
 
G4double GetExtentRadius () const
 
void SetXmin (G4double xmin)
 
void SetXmax (G4double xmax)
 
void SetYmin (G4double ymin)
 
void SetYmax (G4double ymax)
 
void SetZmin (G4double zmin)
 
void SetZmax (G4double zmax)
 

Static Public Attributes

static const G4VisExtent NullExtent
 

Friends

std::ostream & operator<< (std::ostream &os, const G4VisExtent &e)
 

Detailed Description

Definition at line 54 of file G4VisExtent.hh.

Constructor & Destructor Documentation

◆ G4VisExtent() [1/2]

G4VisExtent::G4VisExtent ( G4double  xmin = 0.,
G4double  xmax = 0.,
G4double  ymin = 0.,
G4double  ymax = 0.,
G4double  zmin = 0.,
G4double  zmax = 0. 
)

Definition at line 40 of file G4VisExtent.cc.

42 :
43 fXmin(xmin), fXmax(xmax), fYmin(ymin), fYmax(ymax), fZmin(zmin), fZmax(zmax),
44 fRadiusCached(false), fCentreCached(false), fRadius(0.)
45{}

◆ G4VisExtent() [2/2]

G4VisExtent::G4VisExtent ( const G4Point3D centre,
G4double  radius 
)

Definition at line 47 of file G4VisExtent.cc.

47 :
48 fRadiusCached(true), fCentreCached(true),
49 fRadius(radius), fCentre(centre)
50{
51 // Use exscribed radius ... see comments in header file.
52 G4double halfSide (radius / std::sqrt (3.));
53 fXmin = centre.x () - halfSide;
54 fXmax = centre.x () + halfSide;
55 fYmin = centre.y () - halfSide;
56 fYmax = centre.y () + halfSide;
57 fZmin = centre.z () - halfSide;
58 fZmax = centre.z () + halfSide;
59}
double G4double
Definition: G4Types.hh:64

◆ ~G4VisExtent()

G4VisExtent::~G4VisExtent ( )

Definition at line 61 of file G4VisExtent.cc.

61{}

Member Function Documentation

◆ GetExtentCenter()

const G4Point3D & G4VisExtent::GetExtentCenter ( ) const
inline

Definition at line 96 of file G4VisExtent.hh.

96 {
97 return GetExtentCentre ();
98}
const G4Point3D & GetExtentCentre() const
Definition: G4VisExtent.cc:63

◆ GetExtentCentre()

const G4Point3D & G4VisExtent::GetExtentCentre ( ) const

Definition at line 63 of file G4VisExtent.cc.

63 {
64 if (!fCentreCached) {
65 fCentre = G4Point3D (((fXmin + fXmax) / 2.),
66 ((fYmin + fYmax) / 2.),
67 ((fZmin + fZmax) / 2.));
68 fCentreCached = true;
69 }
70 return fCentre;
71}
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:35

Referenced by G4Scene::CalculateExtent(), G4VSceneHandler::CreateSectionSolid(), and GetExtentCenter().

◆ GetExtentRadius()

G4double G4VisExtent::GetExtentRadius ( ) const

Definition at line 73 of file G4VisExtent.cc.

73 {
74 if (!fRadiusCached) {
75 fRadius = std::sqrt (((fXmax - fXmin) * (fXmax - fXmin)) +
76 ((fYmax - fYmin) * (fYmax - fYmin)) +
77 ((fZmax - fZmin) * (fZmax - fZmin))) / 2.;
78 fRadiusCached = true;
79 }
80 return fRadius;
81}

Referenced by G4Scene::CalculateExtent(), G4VSceneHandler::CreateSectionSolid(), G4VisManager::RegisterEndOfEventUserVisAction(), G4VisManager::RegisterEndOfRunUserVisAction(), G4VisManager::RegisterRunDurationUserVisAction(), G4DAWNFILEViewer::SendViewParameters(), G4VisCommandSceneAddArrow::SetNewValue(), G4VisCommandSceneAddAxes::SetNewValue(), G4VisCommandSceneAddLogo::SetNewValue(), G4VisCommandSceneAddScale::SetNewValue(), and G4RayTracerViewer::SetView().

◆ GetXmax()

◆ GetXmin()

◆ GetYmax()

◆ GetYmin()

◆ GetZmax()

◆ GetZmin()

◆ operator!=()

G4bool G4VisExtent::operator!= ( const G4VisExtent e) const

Definition at line 91 of file G4VisExtent.cc.

91 {
92 return ((fXmin != e.fXmin) ||
93 (fXmax != e.fXmax) ||
94 (fYmin != e.fYmin) ||
95 (fYmax != e.fYmax) ||
96 (fZmin != e.fZmin) ||
97 (fZmax != e.fZmax));
98}

◆ SetXmax()

void G4VisExtent::SetXmax ( G4double  xmax)
inline

Definition at line 102 of file G4VisExtent.hh.

103{fXmax = xmax; fRadiusCached = false; fCentreCached = false;}

Referenced by G4VSolid::GetExtent().

◆ SetXmin()

void G4VisExtent::SetXmin ( G4double  xmin)
inline

Definition at line 100 of file G4VisExtent.hh.

101{fXmin = xmin; fRadiusCached = false; fCentreCached = false;}

Referenced by G4VSolid::GetExtent().

◆ SetYmax()

void G4VisExtent::SetYmax ( G4double  ymax)
inline

Definition at line 106 of file G4VisExtent.hh.

107{fYmax = ymax; fRadiusCached = false; fCentreCached = false;}

Referenced by G4VSolid::GetExtent().

◆ SetYmin()

void G4VisExtent::SetYmin ( G4double  ymin)
inline

Definition at line 104 of file G4VisExtent.hh.

105{fYmin = ymin; fRadiusCached = false; fCentreCached = false;}

Referenced by G4VSolid::GetExtent().

◆ SetZmax()

void G4VisExtent::SetZmax ( G4double  zmax)
inline

Definition at line 110 of file G4VisExtent.hh.

111{fZmax = zmax; fRadiusCached = false; fCentreCached = false;}

Referenced by G4VSolid::GetExtent().

◆ SetZmin()

void G4VisExtent::SetZmin ( G4double  zmin)
inline

Definition at line 108 of file G4VisExtent.hh.

109{fZmin = zmin; fRadiusCached = false; fCentreCached = false;}

Referenced by G4VSolid::GetExtent().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const G4VisExtent e 
)
friend

Definition at line 83 of file G4VisExtent.cc.

83 {
84 os << "G4VisExtent (bounding box):";
85 os << "\n X limits: " << e.fXmin << ' ' << e.fXmax;
86 os << "\n Y limits: " << e.fYmin << ' ' << e.fYmax;
87 os << "\n Z limits: " << e.fZmin << ' ' << e.fZmax;
88 return os;
89}

Member Data Documentation

◆ NullExtent

const G4VisExtent G4VisExtent::NullExtent
static

Definition at line 80 of file G4VisExtent.hh.


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