Geant4  10.01.p03
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 #include "USphere.hh"
47 #include "G4Polyhedron.hh"
48 
49 class G4USphere : public G4USolid
50 {
51  public: // with description
52 
53  G4USphere(const G4String& pName,
54  G4double pRmin, G4double pRmax,
55  G4double pSPhi, G4double pDPhi,
56  G4double pSTheta, G4double pDTheta);
57  // Constructs a sphere or sphere shell section
58  // with the given name and dimensions
59 
60  ~G4USphere();
61 
63  const G4int n,
64  const G4VPhysicalVolume* pRep);
65 
66  G4VSolid* Clone() const;
67 
68  inline USphere* GetShape() const;
69 
70  inline G4double GetInnerRadius () const;
71  inline G4double GetOuterRadius () const;
72  inline G4double GetStartPhiAngle () const;
73  inline G4double GetDeltaPhiAngle () const;
74  inline G4double GetStartThetaAngle() const;
75  inline G4double GetDeltaThetaAngle() const;
76 
77  inline void SetInnerRadius (G4double newRMin);
78  inline void SetOuterRadius (G4double newRmax);
79  inline void SetStartPhiAngle (G4double newSphi, G4bool trig=true);
80  inline void SetDeltaPhiAngle (G4double newDphi);
81  inline void SetStartThetaAngle(G4double newSTheta);
82  inline void SetDeltaThetaAngle(G4double newDTheta);
83 
84  public: // without description
85 
86  G4USphere(__void__&);
87  //
88  // Fake default constructor for usage restricted to direct object
89  // persistency for clients requiring preallocation of memory for
90  // persistifiable objects.
91 
92  G4USphere(const G4USphere& rhs);
93  G4USphere& operator=(const G4USphere& rhs);
94  // Copy constructor and assignment operator.
95 };
96 
97 // --------------------------------------------------------------------
98 // Inline methods
99 // --------------------------------------------------------------------
100 
102 {
103  return (USphere*) fShape;
104 }
105 
107 {
108  return GetShape()->GetInnerRadius();
109 }
111 {
112  return GetShape()->GetOuterRadius();
113 }
115 {
116  return GetShape()->GetStartPhiAngle();
117 }
119 {
120  return GetShape()->GetDeltaPhiAngle();
121 }
123 {
124  return GetShape()->GetStartThetaAngle();
125 }
127 {
128  return GetShape()->GetDeltaThetaAngle();
129 }
130 
132 {
133  GetShape()->SetInnerRadius(newRMin);
134  fRebuildPolyhedron = true;
135 }
137 {
138  GetShape()->SetOuterRadius(newRmax);
139  fRebuildPolyhedron = true;
140 }
141 inline void G4USphere::SetStartPhiAngle(G4double newSphi, G4bool trig)
142 {
143  GetShape()->SetStartPhiAngle(newSphi, trig);
144  fRebuildPolyhedron = true;
145 }
147 {
148  GetShape()->SetDeltaPhiAngle(newDphi);
149  fRebuildPolyhedron = true;
150 }
152 {
153  GetShape()->SetStartThetaAngle(newSTheta);
154  fRebuildPolyhedron = true;
155 }
157 {
158  GetShape()->SetDeltaThetaAngle(newDTheta);
159  fRebuildPolyhedron = true;
160 }
161 
162 #endif
G4double GetStartThetaAngle() const
Definition: G4USphere.hh:122
G4VSolid * Clone() const
Definition: G4USphere.cc:111
double GetInnerRadius() const
Definition: USphere.hh:212
void SetStartThetaAngle(G4double newSTheta)
Definition: G4USphere.hh:151
void SetStartPhiAngle(double newSphi, bool trig=true)
Definition: USphere.hh:415
void SetStartThetaAngle(double newSTheta)
Definition: USphere.hh:437
void SetInnerRadius(double newRMin)
Definition: USphere.hh:401
void SetDeltaThetaAngle(double newDTheta)
Definition: USphere.hh:444
double GetDeltaThetaAngle() const
Definition: USphere.hh:241
~G4USphere()
Definition: G4USphere.cc:65
double GetOuterRadius() const
Definition: USphere.hh:218
int G4int
Definition: G4Types.hh:78
USphere * GetShape() const
Definition: G4USphere.hh:101
G4double GetDeltaThetaAngle() const
Definition: G4USphere.hh:126
G4USphere(const G4String &pName, G4double pRmin, G4double pRmax, G4double pSPhi, G4double pDPhi, G4double pSTheta, G4double pDTheta)
Definition: G4USphere.cc:42
VUSolid * fShape
Definition: G4USolid.hh:182
G4double GetDeltaPhiAngle() const
Definition: G4USphere.hh:118
bool G4bool
Definition: G4Types.hh:79
G4USphere & operator=(const G4USphere &rhs)
Definition: G4USphere.cc:82
G4bool fRebuildPolyhedron
Definition: G4USolid.hh:183
const G4int n
G4double GetStartPhiAngle() const
Definition: G4USphere.hh:114
void SetDeltaPhiAngle(double newDphi)
Definition: USphere.hh:430
G4double GetOuterRadius() const
Definition: G4USphere.hh:110
double GetStartThetaAngle() const
Definition: USphere.hh:236
void SetDeltaThetaAngle(G4double newDTheta)
Definition: G4USphere.hh:156
void SetOuterRadius(double newRmax)
Definition: USphere.hh:407
void SetInnerRadius(G4double newRMin)
Definition: G4USphere.hh:131
void SetOuterRadius(G4double newRmax)
Definition: G4USphere.hh:136
G4double GetInnerRadius() const
Definition: G4USphere.hh:106
double GetStartPhiAngle() const
Definition: USphere.hh:224
void SetStartPhiAngle(G4double newSphi, G4bool trig=true)
Definition: G4USphere.hh:141
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4USphere.cc:100
void SetDeltaPhiAngle(G4double newDphi)
Definition: G4USphere.hh:146
double G4double
Definition: G4Types.hh:76
double GetDeltaPhiAngle() const
Definition: USphere.hh:230