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