Geant4  10.00.p01
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 #include "UTrd.hh"
47 
48 class G4UTrd : public G4USolid
49 {
50  public: // with description
51 
52  G4UTrd(const G4String& pName,
53  G4double pdx1, G4double pdx2,
54  G4double pdy1, G4double pdy2,
55  G4double pdz);
56  // Constructs a trapezoid with name, and half lengths
57 
58  ~G4UTrd();
59 
61  const G4int n,
62  const G4VPhysicalVolume* pRep);
63 
64  G4VSolid* Clone() const;
65 
66  inline UTrd* GetShape() const;
67 
68  inline G4double GetXHalfLength1() const;
69  inline G4double GetXHalfLength2() const;
70  inline G4double GetYHalfLength1() const;
71  inline G4double GetYHalfLength2() const;
72  inline G4double GetZHalfLength() const;
73 
74  inline void SetXHalfLength1(G4double val);
75  inline void SetXHalfLength2(G4double val);
76  inline void SetYHalfLength1(G4double val);
77  inline void SetYHalfLength2(G4double val);
78  inline void SetZHalfLength(G4double val);
79 
80  inline void SetAllParameters(G4double pdx1, G4double pdx2,
81  G4double pdy1, G4double pdy2,
82  G4double pdz);
83 
84  public: // without description
85 
86  G4UTrd(__void__&);
87  // Fake default constructor for usage restricted to direct object
88  // persistency for clients requiring preallocation of memory for
89  // persistifiable objects.
90 
91  G4UTrd(const G4UTrd& rhs);
92  G4UTrd& operator=(const G4UTrd& rhs);
93  // Copy constructor and assignment operator.
94 };
95 
96 // --------------------------------------------------------------------
97 // Inline methods
98 // --------------------------------------------------------------------
99 
100 inline UTrd* G4UTrd::GetShape() const
101 {
102  return (UTrd*) fShape;
103 }
104 
106 {
107  return GetShape()->GetXHalfLength1();
108 }
110 {
111  return GetShape()->GetXHalfLength2();
112 }
114 {
115  return GetShape()->GetYHalfLength1();
116 }
118 {
119  return GetShape()->GetYHalfLength2();
120 }
122 {
123  return GetShape()->GetZHalfLength();
124 }
125 
127 {
128  GetShape()->SetXHalfLength1(val);
129  fPolyhedron = 0;
130 }
132 {
133  GetShape()->SetXHalfLength2(val);
134  fPolyhedron = 0;
135 }
137 {
138  GetShape()->SetYHalfLength1(val);
139  fPolyhedron = 0;
140 }
142 {
143  GetShape()->SetYHalfLength2(val);
144  fPolyhedron = 0;
145 }
147 {
148  GetShape()->SetZHalfLength(val);
149  fPolyhedron = 0;
150 }
152  G4double pdy1, G4double pdy2,
153  G4double pdz)
154 {
155  GetShape()->SetAllParameters(pdx1, pdx2, pdy1, pdy2, pdz);
156  fPolyhedron = 0;
157 }
158 
159 #endif
void SetXHalfLength2(G4double val)
Definition: G4UTrd.hh:131
Definition: G4UTrd.hh:48
void SetYHalfLength2(double val)
double GetZHalfLength() const
void SetYHalfLength1(double val)
~G4UTrd()
Definition: G4UTrd.cc:63
void SetXHalfLength1(double val)
double GetXHalfLength2() const
G4double GetXHalfLength1() const
Definition: G4UTrd.hh:105
int G4int
Definition: G4Types.hh:78
G4VSolid * Clone() const
Definition: G4UTrd.cc:109
void SetXHalfLength2(double val)
void SetAllParameters(G4double pdx1, G4double pdx2, G4double pdy1, G4double pdy2, G4double pdz)
Definition: G4UTrd.hh:151
void SetZHalfLength(double val)
void SetYHalfLength2(G4double val)
Definition: G4UTrd.hh:141
double GetYHalfLength2() const
VUSolid * fShape
Definition: G4USolid.hh:182
G4double GetYHalfLength2() const
Definition: G4UTrd.hh:117
void SetAllParameters(double pdx1, double pdx2, double pdy1, double pdy2, double pdz)
Definition: UTrd.cc:77
double GetYHalfLength1() const
const G4int n
G4UTrd & operator=(const G4UTrd &rhs)
Definition: G4UTrd.cc:80
G4UTrd(const G4String &pName, G4double pdx1, G4double pdx2, G4double pdy1, G4double pdy2, G4double pdz)
Definition: G4UTrd.cc:41
void SetYHalfLength1(G4double val)
Definition: G4UTrd.hh:136
G4Polyhedron * fPolyhedron
Definition: G4USolid.hh:183
G4double GetZHalfLength() const
Definition: G4UTrd.hh:121
void SetZHalfLength(G4double val)
Definition: G4UTrd.hh:146
Definition: UTrd.hh:28
double GetXHalfLength1() const
UTrd * GetShape() const
Definition: G4UTrd.hh:100
double G4double
Definition: G4Types.hh:76
void SetXHalfLength1(G4double val)
Definition: G4UTrd.hh:126
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4UTrd.cc:98
G4double GetXHalfLength2() const
Definition: G4UTrd.hh:109
G4double GetYHalfLength1() const
Definition: G4UTrd.hh:113