Geant4  10.02
G4UTrd.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 // GEANT 4 class header file
31 //
32 //
33 // G4UTrd
34 //
35 // Class description:
36 //
37 // Wrapper class for UTrd to make use of UTrd from USolids module.
38 
39 // History:
40 // 13.09.13 G.Cosmo, CERN/PH
41 // --------------------------------------------------------------------
42 #ifndef G4UTRD_HH
43 #define G4UTRD_HH
44 
45 #include "G4USolid.hh"
46 
47 #if defined(G4GEOM_USE_USOLIDS)
48 
49 #include "UTrd.hh"
50 #include "G4Polyhedron.hh"
51 
52 class G4UTrd : public G4USolid
53 {
54  public: // with description
55 
56  G4UTrd(const G4String& pName,
57  G4double pdx1, G4double pdx2,
58  G4double pdy1, G4double pdy2,
59  G4double pdz);
60  // Constructs a trapezoid with name, and half lengths
61 
62  ~G4UTrd();
63 
64  void ComputeDimensions( G4VPVParameterisation* p,
65  const G4int n,
66  const G4VPhysicalVolume* pRep);
67 
68  G4VSolid* Clone() const;
69 
70  inline UTrd* GetShape() const;
71 
72  inline G4double GetXHalfLength1() const;
73  inline G4double GetXHalfLength2() const;
74  inline G4double GetYHalfLength1() const;
75  inline G4double GetYHalfLength2() const;
76  inline G4double GetZHalfLength() const;
77 
78  inline void SetXHalfLength1(G4double val);
79  inline void SetXHalfLength2(G4double val);
80  inline void SetYHalfLength1(G4double val);
81  inline void SetYHalfLength2(G4double val);
82  inline void SetZHalfLength(G4double val);
83 
84  inline void SetAllParameters(G4double pdx1, G4double pdx2,
85  G4double pdy1, G4double pdy2,
86  G4double pdz);
87 
88  public: // without description
89 
90  G4UTrd(__void__&);
91  // Fake default constructor for usage restricted to direct object
92  // persistency for clients requiring preallocation of memory for
93  // persistifiable objects.
94 
95  G4UTrd(const G4UTrd& rhs);
96  G4UTrd& operator=(const G4UTrd& rhs);
97  // Copy constructor and assignment operator.
98 };
99 
100 // --------------------------------------------------------------------
101 // Inline methods
102 // --------------------------------------------------------------------
103 
104 inline UTrd* G4UTrd::GetShape() const
105 {
106  return (UTrd*) fShape;
107 }
108 
109 inline G4double G4UTrd::GetXHalfLength1() const
110 {
111  return GetShape()->GetXHalfLength1();
112 }
113 inline G4double G4UTrd::GetXHalfLength2() const
114 {
115  return GetShape()->GetXHalfLength2();
116 }
117 inline G4double G4UTrd::GetYHalfLength1() const
118 {
119  return GetShape()->GetYHalfLength1();
120 }
121 inline G4double G4UTrd::GetYHalfLength2() const
122 {
123  return GetShape()->GetYHalfLength2();
124 }
125 inline G4double G4UTrd::GetZHalfLength() const
126 {
127  return GetShape()->GetZHalfLength();
128 }
129 
130 inline void G4UTrd::SetXHalfLength1(G4double val)
131 {
132  GetShape()->SetXHalfLength1(val);
133  fRebuildPolyhedron = true;
134 }
135 inline void G4UTrd::SetXHalfLength2(G4double val)
136 {
137  GetShape()->SetXHalfLength2(val);
138  fRebuildPolyhedron = true;
139 }
140 inline void G4UTrd::SetYHalfLength1(G4double val)
141 {
142  GetShape()->SetYHalfLength1(val);
143  fRebuildPolyhedron = true;
144 }
145 inline void G4UTrd::SetYHalfLength2(G4double val)
146 {
147  GetShape()->SetYHalfLength2(val);
148  fRebuildPolyhedron = true;
149 }
150 inline void G4UTrd::SetZHalfLength(G4double val)
151 {
152  GetShape()->SetZHalfLength(val);
153  fRebuildPolyhedron = true;
154 }
155 inline void G4UTrd::SetAllParameters(G4double pdx1, G4double pdx2,
156  G4double pdy1, G4double pdy2,
157  G4double pdz)
158 {
159  GetShape()->SetAllParameters(pdx1, pdx2, pdy1, pdy2, pdz);
160  fRebuildPolyhedron = true;
161 }
162 
163 #endif // G4GEOM_USE_USOLIDS
164 
165 #endif
int G4int
Definition: G4Types.hh:78
const G4int n
double G4double
Definition: G4Types.hh:76