Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Polyhedron.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
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// G4PolyhedronTet(p0[3],p1[3],p2[3],p3[3]) - create polyhedron for Tet;
70//
71// G4PolyhedronEllipsoid(dx,dy,dz,
72// zcut1,zcut2) - create G4Polyhedron for Ellipsoid;
73// G4PolyhedronEllipticalCone(dx,dy,z,
74// zcut1) - create polyhedron for Elliptical cone;
75// G4PolyhedronParaboloid(r1,r2,dz,
76// phi,dphi) - create polyhedron for Paraboloid;
77// G4PolyhedronHype(r1,r2,
78// tan1,tan2,halfz) - create polyhedron for Hype;
79// G4PolyhedronHyperbolicMirror(a,h,r) - create polyhedron for Hyperbolic mirror;
80//
81// Public functions inherited from HepPolyhedron (this list might be
82// incomplete):
83// GetNoVertices() - returns number of vertices
84// GetNoFacets() - returns number of faces
85// GetNextVertexIndex(index, edgeFlag) - get vertex indeces of the
86// quadrilaterals in order; returns false when
87// finished each face;
88// GetVertex(index) - returns vertex by index;
89// GetNextVertex(vertex, edgeFlag) - get vertices with edge visibility
90// of the quadrilaterals in order;
91// returns false when finished each face;
92// GetNextVertex(vertex, edgeFlag, normal) - get vertices with edge
93// visibility and normal of the quadrilaterals
94// in order; returns false when finished each face;
95// GetNextNormal(normal) - get normals of each face in order;
96// returns false when finished all faces;
97// GetNextUnitNormal(normal) - get normals of unit length of each face
98// in order; returns false when finished all faces;
99// GetNextEdgeIndeces(i1, i2, edgeFlag) - get indeces of the next edge;
100// returns false for the last edge;
101// GetNextEdge(p1, p2, edgeFlag) - get next edge;
102// returns false for the last edge;
103// SetNumberOfRotationSteps(G4int n) - Set number of steps for whole circle;
104
105// History:
106// 21st February 2000 Evgeni Chernaev, John Allison
107// - Re-written to inherit HepPolyhedron.
108//
109// 11.03.05 J.Allison
110// - Added fNumberOfRotationStepsAtTimeOfCreation and access method.
111// (NumberOfRotationSteps is also called number of sides per circle or
112// line segments per circle - see
113// /vis/viewer/set/lineSegmentsPerCircle.)
114// 20.06.05 G.Cosmo
115// - Added G4PolyhedronEllipsoid.
116// 09.03.06 J.Allison
117// - Added operator<<.
118
119#include "globals.hh"
120#include "HepPolyhedron.h"
121#include "G4Visible.hh"
122
123class G4Polyhedron : public HepPolyhedron, public G4Visible {
124public:
125 G4Polyhedron ();
126 G4Polyhedron (const HepPolyhedron& from);
127 // Use compiler defaults for copy contructor and assignment. (They
128 // invoke their counterparts in HepPolyhedron and G4Visible.)
129 virtual ~G4Polyhedron ();
130
132 return fNumberOfRotationStepsAtTimeOfCreation;
133 }
134private:
135 G4int fNumberOfRotationStepsAtTimeOfCreation;
136};
137
139public:
141 virtual ~G4PolyhedronBox ();
142};
143
145public:
147 G4double Rmn2, G4double Rmx2, G4double Dz);
148 virtual ~G4PolyhedronCone ();
149};
150
152public:
154 G4double Rmn2, G4double Rmx2, G4double Dz,
155 G4double Phi1, G4double Dphi);
156 virtual ~G4PolyhedronCons ();
157};
158
160public:
162 G4double Alpha, G4double Theta, G4double Phi);
163 virtual ~G4PolyhedronPara ();
164};
165
167public:
169 const G4double *z,
170 const G4double *rmin,
171 const G4double *rmax);
172 virtual ~G4PolyhedronPcon ();
173};
174
176public:
177 G4PolyhedronPgon (G4double phi, G4double dphi, G4int npdv, G4int nz,
178 const G4double *z,
179 const G4double *rmin,
180 const G4double *rmax);
181 virtual ~G4PolyhedronPgon ();
182};
183
185public:
187 G4double phi, G4double dphi,
188 G4double the, G4double dthe);
189 virtual ~G4PolyhedronSphere ();
190};
191
193public:
194 G4PolyhedronTet (const G4double p0[3],
195 const G4double p1[3],
196 const G4double p2[3],
197 const G4double p3[3]);
198 virtual ~G4PolyhedronTet ();
199};
200
202public:
204 G4double phi, G4double dphi);
205 virtual ~G4PolyhedronTorus ();
206};
207
209public:
211 G4double Dy1,
212 G4double Dx1, G4double Dx2, G4double Alp1,
213 G4double Dy2,
214 G4double Dx3, G4double Dx4, G4double Alp2);
215 virtual ~G4PolyhedronTrap ();
216};
217
219public:
221 G4double Dy, G4double Dz);
222 virtual ~G4PolyhedronTrd1 ();
223};
224
226public:
228 G4double Dy1, G4double Dy2, G4double Dz);
229 virtual ~G4PolyhedronTrd2 ();
230};
231
233public:
235 virtual ~G4PolyhedronTube ();
236};
237
239public:
241 G4double Phi1, G4double Dphi);
242 virtual ~G4PolyhedronTubs ();
243};
244
246 public:
248 G4double sPhi, G4double dPhi);
249 virtual ~G4PolyhedronParaboloid ();
250};
251
253 public:
255 G4double tan2, G4double halfZ);
256 virtual ~G4PolyhedronHype ();
257};
258
260 public:
262 G4double zcut1, G4double zcut2);
263 virtual ~G4PolyhedronEllipsoid ();
264};
265
267 public:
269 G4double zcut1);
271};
272
274 public:
277};
278
279std::ostream& operator<<(std::ostream& os, const G4Polyhedron&);
280
281#endif /* G4POLYHEDRON_HH */
std::ostream & operator<<(std::ostream &os, const G4Polyhedron &)
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
virtual ~G4PolyhedronBox()
Definition: G4Polyhedron.cc:46
virtual ~G4PolyhedronCone()
Definition: G4Polyhedron.cc:52
virtual ~G4PolyhedronCons()
Definition: G4Polyhedron.cc:59
virtual ~G4PolyhedronEllipsoid()
virtual ~G4PolyhedronHype()
virtual ~G4PolyhedronPara()
Definition: G4Polyhedron.cc:66
virtual ~G4PolyhedronParaboloid()
virtual ~G4PolyhedronPcon()
Definition: G4Polyhedron.cc:74
virtual ~G4PolyhedronPgon()
Definition: G4Polyhedron.cc:83
virtual ~G4PolyhedronSphere()
Definition: G4Polyhedron.cc:90
virtual ~G4PolyhedronTet()
Definition: G4Polyhedron.cc:98
virtual ~G4PolyhedronTorus()
virtual ~G4PolyhedronTrap()
virtual ~G4PolyhedronTrd1()
virtual ~G4PolyhedronTrd2()
virtual ~G4PolyhedronTube()
virtual ~G4PolyhedronTubs()
G4int GetNumberOfRotationStepsAtTimeOfCreation() const
virtual ~G4Polyhedron()
Definition: G4Polyhedron.cc:34