ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4Polyhedron.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4Polyhedron.hh
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
28
#ifndef G4POLYHEDRON_HH
29
#define G4POLYHEDRON_HH
30
31
// Class Description:
32
// G4Polyhedron is an intermediate class between G4 and visualization
33
// systems. It is intended to provide some service like:
34
// - polygonization of the G4 shapes with triangulization
35
// (quadrilaterization) of complex polygons;
36
// - calculation of normals for faces and vertices.
37
//
38
// Inherits from HepPolyhedron, to which reference should be made for
39
// functionality.
40
//
41
// Public constructors:
42
// G4PolyhedronBox(dx,dy,dz) - create G4Polyhedron for G4 Box;
43
// G4PolyhedronTrd1(dx1,dx2,dy,dz) - create G4Polyhedron for G4 Trd1;
44
// G4PolyhedronTrd2(dx1,dx2,dy1,dy2,dz) - create G4Polyhedron for G4 Trd2;
45
// G4PolyhedronTrap(dz,theta,phi,
46
// h1,bl1,tl1,alp1,
47
// h2,bl2,tl2,alp2) - create G4Polyhedron for G4 Trap;
48
// G4PolyhedronPara(dx,dy,dz,
49
// alpha,theta,phi) - create G4Polyhedron for G4 Para;
50
//
51
// G4PolyhedronTube(rmin,rmax,dz) - create G4Polyhedron for G4 Tube;
52
// G4PolyhedronTubs(rmin,rmax,dz,
53
// phi1,dphi) - create G4Polyhedron for G4 Tubs;
54
// G4PolyhedronCone(rmin1,rmax1,
55
// rmin2,rmax2,dz) - create G4Polyhedron for G4 Cone;
56
// G4PolyhedronCons(rmin1,rmax1,
57
// rmin2,rmax2,dz,
58
// phi1,dphi) - create G4Polyhedron for G4 Cons;
59
//
60
// G4PolyhedronPgon(phi,dphi,npdv,nz,
61
// z(*),rmin(*),rmax(*)) - create G4Polyhedron for G4 Pgon;
62
// G4PolyhedronPcon(phi,dphi,nz,
63
// z(*),rmin(*),rmax(*)) - create G4Polyhedron for G4 Pcon;
64
//
65
// G4PolyhedronSphere(rmin,rmax,
66
// phi,dphi,the,dthe) - create G4Polyhedron for Sphere;
67
// G4PolyhedronTorus(rmin,rmax,rtor,
68
// phi,dphi) - create G4Polyhedron for Torus;
69
// G4PolyhedronEllipsoid(dx,dy,dz,
70
// zcut1,zcut2) - create G4Polyhedron for Ellipsoid;
71
//
72
// Public functions inherited from HepPolyhedron (this list might be
73
// incomplete):
74
// GetNoVertices() - returns number of vertices
75
// GetNoFacets() - returns number of faces
76
// GetNextVertexIndex(index, edgeFlag) - get vertex indeces of the
77
// quadrilaterals in order; returns false when
78
// finished each face;
79
// GetVertex(index) - returns vertex by index;
80
// GetNextVertex(vertex, edgeFlag) - get vertices with edge visibility
81
// of the quadrilaterals in order;
82
// returns false when finished each face;
83
// GetNextVertex(vertex, edgeFlag, normal) - get vertices with edge
84
// visibility and normal of the quadrilaterals
85
// in order; returns false when finished each face;
86
// GetNextNormal(normal) - get normals of each face in order;
87
// returns false when finished all faces;
88
// GetNextUnitNormal(normal) - get normals of unit length of each face
89
// in order; returns false when finished all faces;
90
// GetNextEdgeIndeces(i1, i2, edgeFlag) - get indeces of the next edge;
91
// returns false for the last edge;
92
// GetNextEdge(p1, p2, edgeFlag) - get next edge;
93
// returns false for the last edge;
94
// SetNumberOfRotationSteps(G4int n) - Set number of steps for whole circle;
95
96
// History:
97
// 21st February 2000 Evgeni Chernaev, John Allison
98
// - Re-written to inherit HepPolyhedron.
99
//
100
// 11.03.05 J.Allison
101
// - Added fNumberOfRotationStepsAtTimeOfCreation and access method.
102
// (NumberOfRotationSteps is also called number of sides per circle or
103
// line segments per circle - see
104
// /vis/viewer/set/lineSegmentsPerCircle.)
105
// 20.06.05 G.Cosmo
106
// - Added G4PolyhedronEllipsoid.
107
// 09.03.06 J.Allison
108
// - Added operator<<.
109
110
#include "
globals.hh
"
111
#include "
HepPolyhedron.h
"
112
#include "
G4Visible.hh
"
113
114
class
G4Polyhedron
:
public
HepPolyhedron
,
public
G4Visible
{
115
public
:
116
G4Polyhedron
();
117
G4Polyhedron
(
const
HepPolyhedron
& from);
118
// Use compiler defaults for copy contructor and assignment. (They
119
// invoke their counterparts in HepPolyhedron and G4Visible.)
120
virtual
~G4Polyhedron
();
121
122
G4int
GetNumberOfRotationStepsAtTimeOfCreation
()
const
{
123
return
fNumberOfRotationStepsAtTimeOfCreation
;
124
}
125
private
:
126
G4int
fNumberOfRotationStepsAtTimeOfCreation
;
127
};
128
129
class
G4PolyhedronBox
:
public
G4Polyhedron
{
130
public
:
131
G4PolyhedronBox
(
G4double
dx
,
G4double
dy
,
G4double
dz
);
132
virtual
~G4PolyhedronBox
();
133
};
134
135
class
G4PolyhedronCone
:
public
G4Polyhedron
{
136
public
:
137
G4PolyhedronCone
(
G4double
Rmn1,
G4double
Rmx1,
138
G4double
Rmn2,
G4double
Rmx2,
G4double
Dz
);
139
virtual
~G4PolyhedronCone
();
140
};
141
142
class
G4PolyhedronCons
:
public
G4Polyhedron
{
143
public
:
144
G4PolyhedronCons
(
G4double
Rmn1,
G4double
Rmx1,
145
G4double
Rmn2,
G4double
Rmx2,
G4double
Dz
,
146
G4double
Phi1,
G4double
Dphi);
147
virtual
~G4PolyhedronCons
();
148
};
149
150
class
G4PolyhedronPara
:
public
G4Polyhedron
{
151
public
:
152
G4PolyhedronPara
(
G4double
Dx
,
G4double
Dy
,
G4double
Dz
,
153
G4double
Alpha
,
G4double
Theta,
G4double
Phi);
154
virtual
~G4PolyhedronPara
();
155
};
156
157
class
G4PolyhedronPcon
:
public
G4Polyhedron
{
158
public
:
159
G4PolyhedronPcon
(
G4double
phi
,
G4double
dphi,
G4int
nz,
160
const
G4double
*
z
,
161
const
G4double
*rmin,
162
const
G4double
*
rmax
);
163
virtual
~G4PolyhedronPcon
();
164
};
165
166
class
G4PolyhedronPgon
:
public
G4Polyhedron
{
167
public
:
168
G4PolyhedronPgon
(
G4double
phi
,
G4double
dphi,
G4int
npdv,
G4int
nz,
169
const
G4double
*
z
,
170
const
G4double
*rmin,
171
const
G4double
*
rmax
);
172
virtual
~G4PolyhedronPgon
();
173
};
174
175
class
G4PolyhedronSphere
:
public
G4Polyhedron
{
176
public
:
177
G4PolyhedronSphere
(
G4double
rmin,
G4double
rmax
,
178
G4double
phi
,
G4double
dphi,
179
G4double
the,
G4double
dthe);
180
virtual
~G4PolyhedronSphere
();
181
};
182
183
class
G4PolyhedronTorus
:
public
G4Polyhedron
{
184
public
:
185
G4PolyhedronTorus
(
G4double
rmin,
G4double
rmax
,
G4double
rtor,
186
G4double
phi
,
G4double
dphi);
187
virtual
~G4PolyhedronTorus
();
188
};
189
190
class
G4PolyhedronTrap
:
public
G4Polyhedron
{
191
public
:
192
G4PolyhedronTrap
(
G4double
Dz
,
G4double
Theta,
G4double
Phi,
193
G4double
Dy1,
194
G4double
Dx1,
G4double
Dx2,
G4double
Alp1,
195
G4double
Dy2,
196
G4double
Dx3,
G4double
Dx4,
G4double
Alp2);
197
virtual
~G4PolyhedronTrap
();
198
};
199
200
class
G4PolyhedronTrd1
:
public
G4Polyhedron
{
201
public
:
202
G4PolyhedronTrd1
(
G4double
Dx1,
G4double
Dx2,
203
G4double
Dy
,
G4double
Dz
);
204
virtual
~G4PolyhedronTrd1
();
205
};
206
207
class
G4PolyhedronTrd2
:
public
G4Polyhedron
{
208
public
:
209
G4PolyhedronTrd2
(
G4double
Dx1,
G4double
Dx2,
210
G4double
Dy1,
G4double
Dy2,
G4double
Dz
);
211
virtual
~G4PolyhedronTrd2
();
212
};
213
214
class
G4PolyhedronTube
:
public
G4Polyhedron
{
215
public
:
216
G4PolyhedronTube
(
G4double
Rmin,
G4double
Rmax,
G4double
Dz
);
217
virtual
~G4PolyhedronTube
();
218
};
219
220
class
G4PolyhedronTubs
:
public
G4Polyhedron
{
221
public
:
222
G4PolyhedronTubs
(
G4double
Rmin,
G4double
Rmax,
G4double
Dz
,
223
G4double
Phi1,
G4double
Dphi);
224
virtual
~G4PolyhedronTubs
();
225
};
226
227
class
G4PolyhedronParaboloid
:
public
G4Polyhedron
{
228
public
:
229
G4PolyhedronParaboloid
(
G4double
r1
,
G4double
r2
,
G4double
dz
,
230
G4double
sPhi,
G4double
dPhi);
231
virtual
~G4PolyhedronParaboloid
();
232
};
233
234
class
G4PolyhedronHype
:
public
G4Polyhedron
{
235
public
:
236
G4PolyhedronHype
(
G4double
r1
,
G4double
r2
,
G4double
tan1,
237
G4double
tan2,
G4double
halfZ);
238
virtual
~G4PolyhedronHype
();
239
};
240
241
class
G4PolyhedronEllipsoid
:
public
G4Polyhedron
{
242
public
:
243
G4PolyhedronEllipsoid
(
G4double
dx
,
G4double
dy
,
G4double
dz
,
244
G4double
zcut1,
G4double
zcut2);
245
virtual
~G4PolyhedronEllipsoid
();
246
};
247
248
class
G4PolyhedronEllipticalCone
:
public
G4Polyhedron
{
249
public
:
250
G4PolyhedronEllipticalCone
(
G4double
dx
,
G4double
dy
,
G4double
z
,
251
G4double
zcut1);
252
virtual
~G4PolyhedronEllipticalCone
();
253
};
254
255
std::ostream&
operator<<
(std::ostream& os,
const
G4Polyhedron
&);
256
257
#endif
/* G4POLYHEDRON_HH */
geant4
tree
geant4-10.6-release
source
graphics_reps
include
G4Polyhedron.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:21
using
1.8.2 with
ECCE GitHub integration