Geant4  10.02
G4UCons.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:$
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // G4UCons
34 //
35 // Class description:
36 //
37 // Wrapper class for UCons to make use of UCons from USolids module.
38 
39 // History:
40 // 30.10.13 G.Cosmo, CERN/PH
41 // --------------------------------------------------------------------
42 
43 #ifndef G4UCONS_HH
44 #define G4UCONS_HH
45 
46 #include "G4USolid.hh"
47 
48 #if defined(G4GEOM_USE_USOLIDS)
49 
50 #include "UCons.hh"
51 #include "G4Polyhedron.hh"
52 
53 class G4UCons : public G4USolid
54 {
55  public: // with description
56 
57  G4UCons(const G4String& pName,
58  G4double pRmin1, G4double pRmax1,
59  G4double pRmin2, G4double pRmax2,
60  G4double pDz,
61  G4double pSPhi, G4double pDPhi);
62  // Constructs a cone with the given name and dimensions
63 
64  ~G4UCons();
65 
66  void ComputeDimensions( G4VPVParameterisation* p,
67  const G4int n,
68  const G4VPhysicalVolume* pRep );
69 
70  G4VSolid* Clone() const;
71 
72  inline UCons* GetShape() const;
73 
74  inline G4double GetInnerRadiusMinusZ() const;
75  inline G4double GetOuterRadiusMinusZ() const;
76  inline G4double GetInnerRadiusPlusZ() const;
77  inline G4double GetOuterRadiusPlusZ() const;
78  inline G4double GetZHalfLength() const;
79  inline G4double GetStartPhiAngle() const;
80  inline G4double GetDeltaPhiAngle() const;
81 
82  inline void SetInnerRadiusMinusZ (G4double Rmin1 );
83  inline void SetOuterRadiusMinusZ (G4double Rmax1 );
84  inline void SetInnerRadiusPlusZ (G4double Rmin2 );
85  inline void SetOuterRadiusPlusZ (G4double Rmax2 );
86  inline void SetZHalfLength (G4double newDz );
87  inline void SetStartPhiAngle (G4double newSPhi, G4bool trig=true);
88  inline void SetDeltaPhiAngle (G4double newDPhi);
89 
90  public: // without description
91 
92  G4UCons(__void__&);
93  // Fake default constructor for usage restricted to direct object
94  // persistency for clients requiring preallocation of memory for
95  // persistifiable objects.
96 
97  G4UCons(const G4UCons& rhs);
98  G4UCons& operator=(const G4UCons& rhs);
99  // Copy constructor and assignment operator.
100 };
101 
102 // --------------------------------------------------------------------
103 // Inline methods
104 // --------------------------------------------------------------------
105 
106 inline UCons* G4UCons::GetShape() const
107 {
108  return (UCons*) fShape;
109 }
110 
111 inline G4double G4UCons::GetInnerRadiusMinusZ() const
112 {
113  return GetShape()->GetInnerRadiusMinusZ();
114 }
115 inline G4double G4UCons::GetOuterRadiusMinusZ() const
116 {
117  return GetShape()->GetOuterRadiusMinusZ();
118 }
119 inline G4double G4UCons::GetInnerRadiusPlusZ() const
120 {
121  return GetShape()->GetInnerRadiusPlusZ();
122 }
123 inline G4double G4UCons::GetOuterRadiusPlusZ() const
124 {
125  return GetShape()->GetOuterRadiusPlusZ();
126 }
127 inline G4double G4UCons::GetZHalfLength() const
128 {
129  return GetShape()->GetZHalfLength();
130 }
131 inline G4double G4UCons::GetStartPhiAngle() const
132 {
133  return GetShape()->GetStartPhiAngle();
134 }
135 inline G4double G4UCons::GetDeltaPhiAngle() const
136 {
137  return GetShape()->GetDeltaPhiAngle();
138 }
139 
140 inline void G4UCons::SetInnerRadiusMinusZ(G4double Rmin1)
141 {
142  GetShape()->SetInnerRadiusMinusZ(Rmin1);
143  fRebuildPolyhedron = true;
144 }
145 inline void G4UCons::SetOuterRadiusMinusZ(G4double Rmax1)
146 {
147  GetShape()->SetOuterRadiusMinusZ(Rmax1);
148  fRebuildPolyhedron = true;
149 }
150 inline void G4UCons::SetInnerRadiusPlusZ(G4double Rmin2)
151 {
152  GetShape()->SetInnerRadiusPlusZ(Rmin2);
153  fRebuildPolyhedron = true;
154 }
155 inline void G4UCons::SetOuterRadiusPlusZ(G4double Rmax2)
156 {
157  GetShape()->SetOuterRadiusPlusZ(Rmax2);
158  fRebuildPolyhedron = true;
159 }
160 inline void G4UCons::SetZHalfLength(G4double newDz)
161 {
162  GetShape()->SetZHalfLength(newDz);
163  fRebuildPolyhedron = true;
164 }
165 inline void G4UCons::SetStartPhiAngle(G4double newSPhi, G4bool trig)
166 {
167  GetShape()->SetStartPhiAngle(newSPhi, trig);
168  fRebuildPolyhedron = true;
169 }
170 inline void G4UCons::SetDeltaPhiAngle(G4double newDPhi)
171 {
172  GetShape()->SetDeltaPhiAngle(newDPhi);
173  fRebuildPolyhedron = true;
174 }
175 
176 #endif // G4GEOM_USE_USOLIDS
177 
178 #endif
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
const G4int n
double G4double
Definition: G4Types.hh:76