00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef G4VISEXTENT_HH
00049 #define G4VISEXTENT_HH
00050
00051 #include "globals.hh"
00052 #include "G4Point3D.hh"
00053
00054 class G4VisExtent
00055 {
00056 public:
00057
00058 G4VisExtent (G4double xmin = 0., G4double xmax = 0.,
00059 G4double ymin = 0., G4double ymax = 0.,
00060 G4double zmin = 0., G4double zmax = 0.);
00061 G4VisExtent (const G4Point3D& centre, G4double radius);
00062 ~G4VisExtent ();
00063 G4bool operator != (const G4VisExtent& e) const;
00064 G4double GetXmin () const;
00065 G4double GetXmax () const;
00066 G4double GetYmin () const;
00067 G4double GetYmax () const;
00068 G4double GetZmin () const;
00069 G4double GetZmax () const;
00070 const G4Point3D& GetExtentCentre () const;
00071 const G4Point3D& GetExtentCenter () const;
00072 G4double GetExtentRadius () const;
00073 void SetXmin (G4double xmin);
00074 void SetXmax (G4double xmax);
00075 void SetYmin (G4double ymin);
00076 void SetYmax (G4double ymax);
00077 void SetZmin (G4double zmin);
00078 void SetZmax (G4double zmax);
00079 friend std::ostream& operator << (std::ostream& os, const G4VisExtent& e);
00080 static const G4VisExtent NullExtent;
00081
00082 private:
00083 G4double fXmin, fXmax, fYmin, fYmax, fZmin, fZmax;
00084 mutable G4bool fRadiusCached, fCentreCached;
00085 mutable G4double fRadius;
00086 mutable G4Point3D fCentre;
00087 };
00088
00089 inline G4double G4VisExtent::GetXmin () const { return fXmin; }
00090 inline G4double G4VisExtent::GetXmax () const { return fXmax; }
00091 inline G4double G4VisExtent::GetYmin () const { return fYmin; }
00092 inline G4double G4VisExtent::GetYmax () const { return fYmax; }
00093 inline G4double G4VisExtent::GetZmin () const { return fZmin; }
00094 inline G4double G4VisExtent::GetZmax () const { return fZmax; }
00095
00096 inline const G4Point3D& G4VisExtent::GetExtentCenter () const {
00097 return GetExtentCentre ();
00098 }
00099
00100 inline void G4VisExtent::SetXmin (G4double xmin)
00101 {fXmin = xmin; fRadiusCached = false; fCentreCached = false;}
00102 inline void G4VisExtent::SetXmax (G4double xmax)
00103 {fXmax = xmax; fRadiusCached = false; fCentreCached = false;}
00104 inline void G4VisExtent::SetYmin (G4double ymin)
00105 {fYmin = ymin; fRadiusCached = false; fCentreCached = false;}
00106 inline void G4VisExtent::SetYmax (G4double ymax)
00107 {fYmax = ymax; fRadiusCached = false; fCentreCached = false;}
00108 inline void G4VisExtent::SetZmin (G4double zmin)
00109 {fZmin = zmin; fRadiusCached = false; fCentreCached = false;}
00110 inline void G4VisExtent::SetZmax (G4double zmax)
00111 {fZmax = zmax; fRadiusCached = false; fCentreCached = false;}
00112
00113 #endif