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