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