Geant4_10
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  inline UTrd* GetShape() const;
65 
66  inline G4double GetXHalfLength1() const;
67  inline G4double GetXHalfLength2() const;
68  inline G4double GetYHalfLength1() const;
69  inline G4double GetYHalfLength2() const;
70  inline G4double GetZHalfLength() const;
71 
72  inline void SetXHalfLength1(G4double val);
73  inline void SetXHalfLength2(G4double val);
74  inline void SetYHalfLength1(G4double val);
75  inline void SetYHalfLength2(G4double val);
76  inline void SetZHalfLength(G4double val);
77 
78  inline void SetAllParameters(G4double pdx1, G4double pdx2,
79  G4double pdy1, G4double pdy2,
80  G4double pdz);
81 
82  public: // without description
83 
84  G4UTrd(__void__&);
85  // Fake default constructor for usage restricted to direct object
86  // persistency for clients requiring preallocation of memory for
87  // persistifiable objects.
88 
89  G4UTrd(const G4UTrd& rhs);
90  G4UTrd& operator=(const G4UTrd& rhs);
91  // Copy constructor and assignment operator.
92 };
93 
94 // --------------------------------------------------------------------
95 // Inline methods
96 // --------------------------------------------------------------------
97 
98 inline UTrd* G4UTrd::GetShape() const
99 {
100  return (UTrd*) fShape;
101 }
102 
104 {
105  return GetShape()->GetXHalfLength1();
106 }
108 {
109  return GetShape()->GetXHalfLength2();
110 }
112 {
113  return GetShape()->GetYHalfLength1();
114 }
116 {
117  return GetShape()->GetYHalfLength2();
118 }
120 {
121  return GetShape()->GetZHalfLength();
122 }
123 
125 {
126  GetShape()->SetXHalfLength1(val);
127  ResetPolyhedron();
128 }
130 {
131  GetShape()->SetXHalfLength2(val);
132  ResetPolyhedron();
133 }
135 {
136  GetShape()->SetYHalfLength1(val);
137  ResetPolyhedron();
138 }
140 {
141  GetShape()->SetYHalfLength2(val);
142  ResetPolyhedron();
143 }
145 {
146  GetShape()->SetZHalfLength(val);
147  ResetPolyhedron();
148 }
150  G4double pdy1, G4double pdy2,
151  G4double pdz)
152 {
153  GetShape()->SetAllParameters(pdx1, pdx2, pdy1, pdy2, pdz);
154  ResetPolyhedron();
155 }
156 
157 #endif
void SetXHalfLength2(G4double val)
Definition: G4UTrd.hh:129
Definition: G4UTrd.hh:48
void SetYHalfLength2(double val)
double GetZHalfLength() const
void SetYHalfLength1(double val)
~G4UTrd()
Definition: G4UTrd.cc:63
void SetXHalfLength1(double val)
const char * p
Definition: xmltok.h:285
double GetXHalfLength2() const
G4double GetXHalfLength1() const
Definition: G4UTrd.hh:103
int G4int
Definition: G4Types.hh:78
void SetXHalfLength2(double val)
void SetAllParameters(G4double pdx1, G4double pdx2, G4double pdy1, G4double pdy2, G4double pdz)
Definition: G4UTrd.hh:149
void SetZHalfLength(double val)
void SetYHalfLength2(G4double val)
Definition: G4UTrd.hh:139
Char_t n[5]
double GetYHalfLength2() const
VUSolid * fShape
Definition: G4USolid.hh:176
G4double GetYHalfLength2() const
Definition: G4UTrd.hh:115
void SetAllParameters(double pdx1, double pdx2, double pdy1, double pdy2, double pdz)
Definition: UTrd.cc:77
double GetYHalfLength1() const
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:134
G4double GetZHalfLength() const
Definition: G4UTrd.hh:119
virtual void ResetPolyhedron() const
Definition: G4USolid.cc:536
void SetZHalfLength(G4double val)
Definition: G4UTrd.hh:144
Definition: UTrd.hh:28
double GetXHalfLength1() const
UTrd * GetShape() const
Definition: G4UTrd.hh:98
double G4double
Definition: G4Types.hh:76
void SetXHalfLength1(G4double val)
Definition: G4UTrd.hh:124
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4UTrd.cc:98
G4double GetXHalfLength2() const
Definition: G4UTrd.hh:107
G4double GetYHalfLength1() const
Definition: G4UTrd.hh:111