Geant4  10.02.p01
G4USphere.hh
Go to the documentation of this file.
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: G4Sphere.hh 72929 2013-08-14 08:27:27Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // G4USphere
34 //
35 // Class description:
36 //
37 // Wrapper class for USphere to make use of USphere from USolids module.
38 
39 // History:
40 // 13.09.13 G.Cosmo, CERN/PH
41 // --------------------------------------------------------------------
42 #ifndef G4USPHERE_HH
43 #define G4USPHERE_HH
44 
45 #include "G4USolid.hh"
46 
47 #if defined(G4GEOM_USE_USOLIDS)
48 
49 #include "USphere.hh"
50 #include "G4Polyhedron.hh"
51 
52 class G4USphere : public G4USolid
53 {
54  public: // with description
55 
56  G4USphere(const G4String& pName,
57  G4double pRmin, G4double pRmax,
58  G4double pSPhi, G4double pDPhi,
59  G4double pSTheta, G4double pDTheta);
60  // Constructs a sphere or sphere shell section
61  // with the given name and dimensions
62 
63  ~G4USphere();
64 
65  void ComputeDimensions( G4VPVParameterisation* p,
66  const G4int n,
67  const G4VPhysicalVolume* pRep);
68 
69  G4VSolid* Clone() const;
70 
71  inline USphere* GetShape() const;
72 
73  inline G4double GetInnerRadius () const;
74  inline G4double GetOuterRadius () const;
75  inline G4double GetStartPhiAngle () const;
76  inline G4double GetDeltaPhiAngle () const;
77  inline G4double GetStartThetaAngle() const;
78  inline G4double GetDeltaThetaAngle() const;
79 
80  inline void SetInnerRadius (G4double newRMin);
81  inline void SetOuterRadius (G4double newRmax);
82  inline void SetStartPhiAngle (G4double newSphi, G4bool trig=true);
83  inline void SetDeltaPhiAngle (G4double newDphi);
84  inline void SetStartThetaAngle(G4double newSTheta);
85  inline void SetDeltaThetaAngle(G4double newDTheta);
86 
87  public: // without description
88 
89  G4USphere(__void__&);
90  //
91  // Fake default constructor for usage restricted to direct object
92  // persistency for clients requiring preallocation of memory for
93  // persistifiable objects.
94 
95  G4USphere(const G4USphere& rhs);
96  G4USphere& operator=(const G4USphere& rhs);
97  // Copy constructor and assignment operator.
98 };
99 
100 // --------------------------------------------------------------------
101 // Inline methods
102 // --------------------------------------------------------------------
103 
104 inline USphere* G4USphere::GetShape() const
105 {
106  return (USphere*) fShape;
107 }
108 
109 inline G4double G4USphere::GetInnerRadius() const
110 {
111  return GetShape()->GetInnerRadius();
112 }
113 inline G4double G4USphere::GetOuterRadius() const
114 {
115  return GetShape()->GetOuterRadius();
116 }
117 inline G4double G4USphere::GetStartPhiAngle() const
118 {
119  return GetShape()->GetStartPhiAngle();
120 }
121 inline G4double G4USphere::GetDeltaPhiAngle() const
122 {
123  return GetShape()->GetDeltaPhiAngle();
124 }
125 inline G4double G4USphere::GetStartThetaAngle() const
126 {
127  return GetShape()->GetStartThetaAngle();
128 }
129 inline G4double G4USphere::GetDeltaThetaAngle() const
130 {
131  return GetShape()->GetDeltaThetaAngle();
132 }
133 
134 inline void G4USphere::SetInnerRadius(G4double newRMin)
135 {
136  GetShape()->SetInnerRadius(newRMin);
137  fRebuildPolyhedron = true;
138 }
139 inline void G4USphere::SetOuterRadius(G4double newRmax)
140 {
141  GetShape()->SetOuterRadius(newRmax);
142  fRebuildPolyhedron = true;
143 }
144 inline void G4USphere::SetStartPhiAngle(G4double newSphi, G4bool trig)
145 {
146  GetShape()->SetStartPhiAngle(newSphi, trig);
147  fRebuildPolyhedron = true;
148 }
149 inline void G4USphere::SetDeltaPhiAngle(G4double newDphi)
150 {
151  GetShape()->SetDeltaPhiAngle(newDphi);
152  fRebuildPolyhedron = true;
153 }
154 inline void G4USphere::SetStartThetaAngle(G4double newSTheta)
155 {
156  GetShape()->SetStartThetaAngle(newSTheta);
157  fRebuildPolyhedron = true;
158 }
159 inline void G4USphere::SetDeltaThetaAngle(G4double newDTheta)
160 {
161  GetShape()->SetDeltaThetaAngle(newDTheta);
162  fRebuildPolyhedron = true;
163 }
164 
165 #endif // G4GEOM_USE_USOLIDS
166 
167 #endif
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
const G4int n
double G4double
Definition: G4Types.hh:76