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

#include <G4VisExtent.hh>

Collaboration diagram for G4VisExtent:

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::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::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:76

Here is the call graph for this function:

G4VisExtent::~G4VisExtent ( )

Definition at line 61 of file G4VisExtent.cc.

61 {}

Member Function Documentation

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

Here is the call graph for this function:

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

Here is the caller graph for this function:

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 }

Here is the caller graph for this function:

G4double G4VisExtent::GetXmax ( ) const
inline

Definition at line 90 of file G4VisExtent.hh.

90 { return fXmax; }

Here is the caller graph for this function:

G4double G4VisExtent::GetXmin ( ) const
inline

Definition at line 89 of file G4VisExtent.hh.

89 { return fXmin; }

Here is the caller graph for this function:

G4double G4VisExtent::GetYmax ( ) const
inline

Definition at line 92 of file G4VisExtent.hh.

92 { return fYmax; }

Here is the caller graph for this function:

G4double G4VisExtent::GetYmin ( ) const
inline

Definition at line 91 of file G4VisExtent.hh.

91 { return fYmin; }

Here is the caller graph for this function:

G4double G4VisExtent::GetZmax ( ) const
inline

Definition at line 94 of file G4VisExtent.hh.

94 { return fZmax; }

Here is the caller graph for this function:

G4double G4VisExtent::GetZmin ( ) const
inline

Definition at line 93 of file G4VisExtent.hh.

93 { return fZmin; }

Here is the caller graph for this function:

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 }
void G4VisExtent::SetXmax ( G4double  xmax)
inline

Definition at line 102 of file G4VisExtent.hh.

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

Here is the caller graph for this function:

void G4VisExtent::SetXmin ( G4double  xmin)
inline

Definition at line 100 of file G4VisExtent.hh.

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

Here is the caller graph for this function:

void G4VisExtent::SetYmax ( G4double  ymax)
inline

Definition at line 106 of file G4VisExtent.hh.

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

Here is the caller graph for this function:

void G4VisExtent::SetYmin ( G4double  ymin)
inline

Definition at line 104 of file G4VisExtent.hh.

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

Here is the caller graph for this function:

void G4VisExtent::SetZmax ( G4double  zmax)
inline

Definition at line 110 of file G4VisExtent.hh.

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

Here is the caller graph for this function:

void G4VisExtent::SetZmin ( G4double  zmin)
inline

Definition at line 108 of file G4VisExtent.hh.

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

Here is the caller graph for this function:

Friends And Related Function Documentation

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

const G4VisExtent G4VisExtent::NullExtent
static

Definition at line 80 of file G4VisExtent.hh.


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