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