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