File indexing completed on 2025-01-18 09:59:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 #ifndef G4VISEXTENT_HH
0048 #define G4VISEXTENT_HH
0049
0050 #include "globals.hh"
0051 #include "G4Point3D.hh"
0052 #include "G4Transform3D.hh"
0053
0054 class G4VisExtent
0055 {
0056 public:
0057
0058 G4VisExtent (G4double xmin = 0., G4double xmax = 0.,
0059 G4double ymin = 0., G4double ymax = 0.,
0060 G4double zmin = 0., G4double zmax = 0.);
0061 G4VisExtent (const G4Point3D& centre, G4double radius);
0062 ~G4VisExtent ();
0063 static const G4VisExtent& GetNullExtent ();
0064 G4bool operator != (const G4VisExtent& e) const;
0065 G4bool operator == (const G4VisExtent& e) const {return !operator!=(e);}
0066
0067 G4VisExtent& Transform (const G4Transform3D&);
0068
0069
0070
0071
0072
0073
0074
0075 G4double GetXmin () const;
0076 G4double GetXmax () const;
0077 G4double GetYmin () const;
0078 G4double GetYmax () const;
0079 G4double GetZmin () const;
0080 G4double GetZmax () const;
0081 const G4Point3D& GetExtentCentre () const;
0082 const G4Point3D& GetExtentCenter () const;
0083 G4double GetExtentRadius () const;
0084 void SetXmin (G4double xmin);
0085 void SetXmax (G4double xmax);
0086 void SetYmin (G4double ymin);
0087 void SetYmax (G4double ymax);
0088 void SetZmin (G4double zmin);
0089 void SetZmax (G4double zmax);
0090 friend std::ostream& operator << (std::ostream& os, const G4VisExtent& e);
0091
0092 private:
0093 G4double fXmin, fXmax, fYmin, fYmax, fZmin, fZmax;
0094 mutable G4bool fRadiusCached, fCentreCached;
0095 mutable G4double fRadius;
0096 mutable G4Point3D fCentre;
0097 };
0098
0099 inline G4double G4VisExtent::GetXmin () const { return fXmin; }
0100 inline G4double G4VisExtent::GetXmax () const { return fXmax; }
0101 inline G4double G4VisExtent::GetYmin () const { return fYmin; }
0102 inline G4double G4VisExtent::GetYmax () const { return fYmax; }
0103 inline G4double G4VisExtent::GetZmin () const { return fZmin; }
0104 inline G4double G4VisExtent::GetZmax () const { return fZmax; }
0105
0106 inline const G4Point3D& G4VisExtent::GetExtentCenter () const {
0107 return GetExtentCentre ();
0108 }
0109
0110 inline void G4VisExtent::SetXmin (G4double xmin)
0111 {fXmin = xmin; fRadiusCached = false; fCentreCached = false;}
0112 inline void G4VisExtent::SetXmax (G4double xmax)
0113 {fXmax = xmax; fRadiusCached = false; fCentreCached = false;}
0114 inline void G4VisExtent::SetYmin (G4double ymin)
0115 {fYmin = ymin; fRadiusCached = false; fCentreCached = false;}
0116 inline void G4VisExtent::SetYmax (G4double ymax)
0117 {fYmax = ymax; fRadiusCached = false; fCentreCached = false;}
0118 inline void G4VisExtent::SetZmin (G4double zmin)
0119 {fZmin = zmin; fRadiusCached = false; fCentreCached = false;}
0120 inline void G4VisExtent::SetZmax (G4double zmax)
0121 {fZmax = zmax; fRadiusCached = false; fCentreCached = false;}
0122
0123 #endif