Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4UTrd.cc
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 // Implementation for G4UTrd wrapper class
31 // --------------------------------------------------------------------
32 
33 #include "G4Trd.hh"
34 #include "G4UTrd.hh"
35 #include "G4VPVParameterisation.hh"
36 
37 /////////////////////////////////////////////////////////////////////////
38 //
39 // Constructor - check & set half widths
40 //
41 G4UTrd::G4UTrd(const G4String& pName,
42  G4double pdx1, G4double pdx2,
43  G4double pdy1, G4double pdy2,
44  G4double pdz)
45  : G4USolid(pName, new UTrd(pName, pdx1, pdx2, pdy1, pdy2, pdz))
46 {
47 }
48 
49 ///////////////////////////////////////////////////////////////////////
50 //
51 // Fake default constructor - sets only member data and allocates memory
52 // for usage restricted to object persistency.
53 //
54 G4UTrd::G4UTrd( __void__& a )
55  : G4USolid(a)
56 {
57 }
58 
59 //////////////////////////////////////////////////////////////////////////
60 //
61 // Destructor
62 //
64 {
65 }
66 
67 //////////////////////////////////////////////////////////////////////////
68 //
69 // Copy constructor
70 //
72  : G4USolid(rhs)
73 {
74 }
75 
76 //////////////////////////////////////////////////////////////////////////
77 //
78 // Assignment operator
79 //
81 {
82  // Check assignment to self
83  //
84  if (this == &rhs) { return *this; }
85 
86  // Copy base class data
87  //
89 
90  return *this;
91 }
92 
93 /////////////////////////////////////////////////////////////////////////
94 //
95 // Dispatch to parameterisation for replication mechanism dimension
96 // computation & modification.
97 //
99  const G4int n,
100  const G4VPhysicalVolume* pRep)
101 {
102  p->ComputeDimensions(*(G4Trd*)this,n,pRep);
103 }
104 
105 //////////////////////////////////////////////////////////////////////////
106 //
107 // Make a clone of the object
108 
110 {
111  return new G4UTrd(*this);
112 }
Definition: G4UTrd.hh:48
~G4UTrd()
Definition: G4UTrd.cc:63
const char * p
Definition: xmltok.h:285
Definition: G4Trd.hh:71
int G4int
Definition: G4Types.hh:78
G4VSolid * Clone() const
Definition: G4UTrd.cc:109
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
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
Definition: UTrd.hh:28
G4USolid & operator=(const G4USolid &rhs)
Definition: G4USolid.cc:370
double G4double
Definition: G4Types.hh:76
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4UTrd.cc:98