1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: G4VisExtent.hh,v 1.10 2006/06/29 19:06:24 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: $ |
---|
29 | // |
---|
30 | // |
---|
31 | // A.Walkden 28/11/95 |
---|
32 | |
---|
33 | // Class Description: |
---|
34 | // G4VisExtent defines a bounding box in a visualisable object's local |
---|
35 | // coordinate system which includes the object. |
---|
36 | // WARNING: it also attempts to support the concept of a bounding |
---|
37 | // sphere. (This is used extensively in the G4 Visualisation System |
---|
38 | // to calculate camera parameters, etc.) Be aware that this involves |
---|
39 | // loss of information. Given a bounding box, one can calculate the |
---|
40 | // bounding sphere; inverting this will produce a cube which *might* |
---|
41 | // *not* include the object. E.g., a long thin object of length l |
---|
42 | // will have a bounding sphere of diameter l; the corresponding cube |
---|
43 | // will have side l/std::sqrt(3) so that the bounding sphere diameter is |
---|
44 | // still l. Thus the long thin object will stick out of the cube. |
---|
45 | // So, if you once use the concept of bounding sphere you must stick |
---|
46 | // with it and abandon the concept of bounding box. |
---|
47 | // Class Description - End: |
---|
48 | |
---|
49 | #ifndef G4VISEXTENT_HH |
---|
50 | #define G4VISEXTENT_HH |
---|
51 | |
---|
52 | #include "globals.hh" |
---|
53 | #include "G4Point3D.hh" |
---|
54 | |
---|
55 | class G4VisExtent |
---|
56 | { |
---|
57 | public: // With description |
---|
58 | |
---|
59 | G4VisExtent (G4double xmin = 0., G4double xmax = 0., |
---|
60 | G4double ymin = 0., G4double ymax = 0., |
---|
61 | G4double zmin = 0., G4double zmax = 0.); |
---|
62 | G4VisExtent (const G4Point3D& centre, G4double radius); |
---|
63 | ~G4VisExtent (); |
---|
64 | G4bool operator != (const G4VisExtent& e) const; |
---|
65 | G4double GetXmin () const; |
---|
66 | G4double GetXmax () const; |
---|
67 | G4double GetYmin () const; |
---|
68 | G4double GetYmax () const; |
---|
69 | G4double GetZmin () const; |
---|
70 | G4double GetZmax () const; |
---|
71 | G4Point3D GetExtentCentre () const; |
---|
72 | G4Point3D GetExtentCenter () const; |
---|
73 | G4double GetExtentRadius () const; |
---|
74 | void SetXmin (G4double xmin); |
---|
75 | void SetXmax (G4double xmax); |
---|
76 | void SetYmin (G4double ymin); |
---|
77 | void SetYmax (G4double ymax); |
---|
78 | void SetZmin (G4double zmin); |
---|
79 | void SetZmax (G4double zmax); |
---|
80 | friend std::ostream& operator << (std::ostream& os, const G4VisExtent& e); |
---|
81 | static const G4VisExtent NullExtent; |
---|
82 | |
---|
83 | private: |
---|
84 | G4double fXmin, fXmax, fYmin, fYmax, fZmin, fZmax; |
---|
85 | }; |
---|
86 | |
---|
87 | inline G4double G4VisExtent::GetXmin () const { return fXmin; } |
---|
88 | inline G4double G4VisExtent::GetXmax () const { return fXmax; } |
---|
89 | inline G4double G4VisExtent::GetYmin () const { return fYmin; } |
---|
90 | inline G4double G4VisExtent::GetYmax () const { return fYmax; } |
---|
91 | inline G4double G4VisExtent::GetZmin () const { return fZmin; } |
---|
92 | inline G4double G4VisExtent::GetZmax () const { return fZmax; } |
---|
93 | |
---|
94 | inline G4Point3D G4VisExtent::GetExtentCenter () const { |
---|
95 | return GetExtentCentre (); |
---|
96 | } |
---|
97 | |
---|
98 | inline void G4VisExtent::SetXmin (G4double xmin) {fXmin = xmin;} |
---|
99 | inline void G4VisExtent::SetXmax (G4double xmax) {fXmax = xmax;} |
---|
100 | inline void G4VisExtent::SetYmin (G4double ymin) {fYmin = ymin;} |
---|
101 | inline void G4VisExtent::SetYmax (G4double ymax) {fYmax = ymax;} |
---|
102 | inline void G4VisExtent::SetZmin (G4double zmin) {fZmin = zmin;} |
---|
103 | inline void G4VisExtent::SetZmax (G4double zmax) {fZmax = zmax;} |
---|
104 | |
---|
105 | #endif |
---|