Geant4  10.02
G4UPolycone.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 // Implementation of G4UPolycone wrapper class
30 // --------------------------------------------------------------------
31 
32 #include "G4Polycone.hh"
33 #include "G4UPolycone.hh"
34 
35 #if defined(G4GEOM_USE_USOLIDS)
36 
37 #include "G4VPVParameterisation.hh"
38 
40 //
41 // Constructor (GEANT3 style parameters)
42 //
43 G4UPolycone::G4UPolycone( const G4String& name,
44  G4double phiStart,
45  G4double phiTotal,
46  G4int numZPlanes,
47  const G4double zPlane[],
48  const G4double rInner[],
49  const G4double rOuter[] )
50  : G4USolid(name, new UPolycone(name, phiStart, phiTotal,
51  numZPlanes, zPlane, rInner, rOuter))
52 {
53 }
54 
55 
57 //
58 // Constructor (generic parameters)
59 //
60 G4UPolycone::G4UPolycone(const G4String& name,
61  G4double phiStart,
62  G4double phiTotal,
63  G4int numRZ,
64  const G4double r[],
65  const G4double z[] )
66  : G4USolid(name, new UPolycone(name, phiStart, phiTotal, numRZ, r, z))
67 {
68 }
69 
70 
72 //
73 // Fake default constructor - sets only member data and allocates memory
74 // for usage restricted to object persistency.
75 //
76 G4UPolycone::G4UPolycone( __void__& a )
77  : G4USolid(a)
78 {
79 }
80 
81 
83 //
84 // Destructor
85 //
86 G4UPolycone::~G4UPolycone()
87 {
88 }
89 
90 
92 //
93 // Copy constructor
94 //
95 G4UPolycone::G4UPolycone( const G4UPolycone &source )
96  : G4USolid( source )
97 {
98 }
99 
100 
102 //
103 // Assignment operator
104 //
105 G4UPolycone &G4UPolycone::operator=( const G4UPolycone &source )
106 {
107  if (this == &source) return *this;
108 
109  G4USolid::operator=( source );
110 
111  return *this;
112 }
113 
114 
116 //
117 // Dispatch to parameterisation for replication mechanism dimension
118 // computation & modification.
119 //
120 void G4UPolycone::ComputeDimensions(G4VPVParameterisation* p,
121  const G4int n,
122  const G4VPhysicalVolume* pRep)
123 {
124  p->ComputeDimensions(*(G4Polycone*)this,n,pRep);
125 }
126 
127 
129 //
130 // Make a clone of the object
131 
132 G4VSolid* G4UPolycone::Clone() const
133 {
134  return new G4UPolycone(*this);
135 }
136 
137 
139 //
140 // CreatePolyhedron
141 //
142 G4Polyhedron* G4UPolycone::CreatePolyhedron() const
143 {
144  G4PolyconeHistorical* original_parameters = GetOriginalParameters();
146  polyhedron = new G4PolyhedronPcon( original_parameters->Start_angle,
147  original_parameters->Opening_angle,
148  original_parameters->Num_z_planes,
149  original_parameters->Z_values,
150  original_parameters->Rmin,
151  original_parameters->Rmax );
152 
153  delete original_parameters; // delete local copy
154 
155  return polyhedron;
156 }
157 
158 #endif // G4GEOM_USE_USOLIDS
G4double z
Definition: TRTMaterials.hh:39
G4String name
Definition: TRTMaterials.hh:40
G4double a
Definition: TRTMaterials.hh:39
int G4int
Definition: G4Types.hh:78
const G4int n
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
double G4double
Definition: G4Types.hh:76