Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Polyhedra.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// --------------------------------------------------------------------
31// GEANT 4 class header file
32//
33//
34// G4Polyhedra.hh
35//
36// Class description:
37//
38// Class implementing a CSG-like type "PGON" Geant 3.21 volume,
39// inherited from class G4VCSGfaceted:
40//
41// G4Polyhedra( const G4String& name,
42// G4double phiStart, - initial phi starting angle
43// G4double phiTotal, - total phi angle
44// G4int numSide, - number sides
45// G4int numZPlanes, - number of z planes
46// const G4double zPlane[], - position of z planes
47// const G4double rInner[], - tangent distance to inner surface
48// const G4double rOuter[] ) - tangent distance to outer surface
49//
50// G4Polyhedra( const G4String& name,
51// G4double phiStart, - initial phi starting angle
52// G4double phiTotal, - total phi angle
53// G4int numSide, - number sides
54// G4int numRZ, - number corners in r,z space
55// const G4double r[], - r coordinate of these corners
56// const G4double z[] ) - z coordinate of these corners
57
58// Author:
59// David C. Williams ([email protected])
60// --------------------------------------------------------------------
61
62#ifndef G4Polyhedra_hh
63#define G4Polyhedra_hh
64
65#include "G4VCSGfaceted.hh"
66#include "G4PolyhedraSide.hh"
67
71{
72 public:
73
78
86};
87
89{
90 public: // with description
91
92 G4Polyhedra( const G4String& name,
93 G4double phiStart, // initial phi starting angle
94 G4double phiTotal, // total phi angle
95 G4int numSide, // number sides
96 G4int numZPlanes, // number of z planes
97 const G4double zPlane[], // position of z planes
98 const G4double rInner[], // tangent distance to inner surface
99 const G4double rOuter[] ); // tangent distance to outer surface
100
101 G4Polyhedra( const G4String& name,
102 G4double phiStart, // initial phi starting angle
103 G4double phiTotal, // total phi angle
104 G4int numSide, // number sides
105 G4int numRZ, // number corners in r,z space
106 const G4double r[], // r coordinate of these corners
107 const G4double z[] ); // z coordinate of these corners
108
109 virtual ~G4Polyhedra();
110
111 // Methods for solid
112
113 EInside Inside( const G4ThreeVector &p ) const;
115 const G4ThreeVector &v ) const;
116 G4double DistanceToIn( const G4ThreeVector &p ) const;
117
119 const G4int n,
120 const G4VPhysicalVolume* pRep);
121
123
124 G4VSolid* Clone() const;
125
127
128 std::ostream& StreamInfo( std::ostream& os ) const;
129
131 G4NURBS* CreateNURBS() const;
132
133 G4bool Reset();
134
135 // Accessors
136
137 inline G4int GetNumSide() const;
138 inline G4double GetStartPhi() const;
139 inline G4double GetEndPhi() const;
140 inline G4bool IsOpen() const;
141 inline G4bool IsGeneric() const;
142 inline G4int GetNumRZCorner() const;
143 inline G4PolyhedraSideRZ GetCorner( const G4int index ) const;
144
146 // Returns internal scaled parameters.
148 // Sets internal parameters. Parameters 'Rmin' and 'Rmax' in input must
149 // be scaled first by a factor computed as 'cos(0.5*phiTotal/theNumSide)',
150 // if not already scaled.
151
152 public: // without description
153
154 G4Polyhedra(__void__&);
155 // Fake default constructor for usage restricted to direct object
156 // persistency for clients requiring preallocation of memory for
157 // persistifiable objects.
158
159 G4Polyhedra( const G4Polyhedra &source );
160 const G4Polyhedra &operator=( const G4Polyhedra &source );
161 // Copy constructor and assignment operator.
162
163 protected: // without description
164
166 // Sets internal parameters for the generic constructor.
167
168 void Create( G4double phiStart, // initial phi starting angle
169 G4double phiTotal, // total phi angle
170 G4int numSide, // number sides
171 G4ReduciblePolygon *rz ); // rz coordinates
172 // Generates the shape and is called by each constructor, after the
173 // conversion of the arguments
174
175 void CopyStuff( const G4Polyhedra &source );
177
178 // Methods for generation of random points on surface
179
181 G4ThreeVector p2, G4ThreeVector p3) const;
183 G4ThreeVector p2) const;
185
186 protected: // without description
187
188 G4int numSide; // Number of sides
189 G4double startPhi; // Starting phi value (0 < phiStart < 2pi)
190 G4double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
191 G4bool phiIsOpen; // true if there is a phi segment
192 G4bool genericPgon; // true if created through the 2nd generic constructor
193 G4int numCorner; // number RZ points
194 G4PolyhedraSideRZ *corners; // our corners
195 G4PolyhedraHistorical *original_parameters; // original input parameters
196
198
199};
200
201#include "G4Polyhedra.icc"
202
203#endif
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4PolyhedraHistorical & operator=(const G4PolyhedraHistorical &right)
G4ThreeVector GetPointOnSurface() const
Definition: G4Polyhedra.cc:686
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Polyhedra.cc:584
G4PolyhedraHistorical * original_parameters
Definition: G4Polyhedra.hh:195
const G4Polyhedra & operator=(const G4Polyhedra &source)
Definition: G4Polyhedra.cc:399
G4PolyhedraSideRZ * corners
Definition: G4Polyhedra.hh:194
G4int GetNumRZCorner() const
G4bool genericPgon
Definition: G4Polyhedra.hh:192
void CopyStuff(const G4Polyhedra &source)
Definition: G4Polyhedra.cc:419
G4VSolid * Clone() const
Definition: G4Polyhedra.cc:575
G4ThreeVector GetPointOnSurfaceCorners() const
void Create(G4double phiStart, G4double phiTotal, G4int numSide, G4ReduciblePolygon *rz)
Definition: G4Polyhedra.cc:191
G4bool IsOpen() const
G4GeometryType GetEntityType() const
Definition: G4Polyhedra.cc:566
G4double endPhi
Definition: G4Polyhedra.hh:190
G4double GetEndPhi() const
G4ThreeVector GetPointOnPlane(G4ThreeVector p0, G4ThreeVector p1, G4ThreeVector p2, G4ThreeVector p3) const
Definition: G4Polyhedra.cc:637
void SetOriginalParameters(G4PolyhedraHistorical *pars)
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Polyhedra.cc:555
G4bool phiIsOpen
Definition: G4Polyhedra.hh:191
G4double startPhi
Definition: G4Polyhedra.hh:189
G4int GetNumSide() const
G4int numCorner
Definition: G4Polyhedra.hh:193
virtual ~G4Polyhedra()
Definition: G4Polyhedra.cc:377
void DeleteStuff()
G4NURBS * CreateNURBS() const
G4PolyhedraHistorical * GetOriginalParameters() const
G4PolyhedraSideRZ GetCorner(const G4int index) const
G4bool Reset()
Definition: G4Polyhedra.cc:465
G4double GetStartPhi() const
void SetOriginalParameters()
G4EnclosingCylinder * enclosingCylinder
Definition: G4Polyhedra.hh:197
G4bool IsGeneric() const
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Polyhedra.cc:527
EInside Inside(const G4ThreeVector &p) const
Definition: G4Polyhedra.cc:507
G4Polyhedron * CreatePolyhedron() const
Definition: G4Polyhedra.cc:903
G4ThreeVector GetPointOnTriangle(G4ThreeVector p0, G4ThreeVector p1, G4ThreeVector p2) const
Definition: G4Polyhedra.cc:669
EInside
Definition: geomdefs.hh:58