Geant4-11
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
133 }
134private:
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);
173 const std::vector<G4TwoVector> &rz);
174 virtual ~G4PolyhedronPcon ();
175};
176
178public:
179 G4PolyhedronPgon (G4double phi, G4double dphi, G4int npdv, G4int nz,
180 const G4double *z,
181 const G4double *rmin,
182 const G4double *rmax);
183 G4PolyhedronPgon (G4double phi, G4double dphi, G4int npdv,
184 const std::vector<G4TwoVector> &rz);
185
186 virtual ~G4PolyhedronPgon ();
187};
188
190public:
192 G4double phi, G4double dphi,
193 G4double the, G4double dthe);
194 virtual ~G4PolyhedronSphere ();
195};
196
198public:
199 G4PolyhedronTet (const G4double p0[3],
200 const G4double p1[3],
201 const G4double p2[3],
202 const G4double p3[3]);
203 virtual ~G4PolyhedronTet ();
204};
205
207public:
209 G4double phi, G4double dphi);
210 virtual ~G4PolyhedronTorus ();
211};
212
214public:
216 G4double Dy1,
217 G4double Dx1, G4double Dx2, G4double Alp1,
218 G4double Dy2,
219 G4double Dx3, G4double Dx4, G4double Alp2);
220 virtual ~G4PolyhedronTrap ();
221};
222
224public:
226 G4double Dy, G4double Dz);
227 virtual ~G4PolyhedronTrd1 ();
228};
229
231public:
233 G4double Dy1, G4double Dy2, G4double Dz);
234 virtual ~G4PolyhedronTrd2 ();
235};
236
238public:
240 virtual ~G4PolyhedronTube ();
241};
242
244public:
246 G4double Phi1, G4double Dphi);
247 virtual ~G4PolyhedronTubs ();
248};
249
251 public:
253 G4double sPhi, G4double dPhi);
254 virtual ~G4PolyhedronParaboloid ();
255};
256
258 public:
260 G4double tan2, G4double halfZ);
261 virtual ~G4PolyhedronHype ();
262};
263
265 public:
267 G4double zcut1, G4double zcut2);
268 virtual ~G4PolyhedronEllipsoid ();
269};
270
272 public:
274 G4double zcut1);
276};
277
279 public:
282};
283
284std::ostream& operator<<(std::ostream& os, const G4Polyhedron&);
285
286#endif /* G4POLYHEDRON_HH */
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4PolyhedronBox(G4double dx, G4double dy, G4double dz)
Definition: G4Polyhedron.cc:43
virtual ~G4PolyhedronBox()
Definition: G4Polyhedron.cc:46
G4PolyhedronCone(G4double Rmn1, G4double Rmx1, G4double Rmn2, G4double Rmx2, G4double Dz)
Definition: G4Polyhedron.cc:48
virtual ~G4PolyhedronCone()
Definition: G4Polyhedron.cc:52
virtual ~G4PolyhedronCons()
Definition: G4Polyhedron.cc:59
G4PolyhedronCons(G4double Rmn1, G4double Rmx1, G4double Rmn2, G4double Rmx2, G4double Dz, G4double Phi1, G4double Dphi)
Definition: G4Polyhedron.cc:54
virtual ~G4PolyhedronEllipsoid()
G4PolyhedronEllipsoid(G4double dx, G4double dy, G4double dz, G4double zcut1, G4double zcut2)
G4PolyhedronEllipticalCone(G4double dx, G4double dy, G4double z, G4double zcut1)
virtual ~G4PolyhedronHype()
G4PolyhedronHype(G4double r1, G4double r2, G4double tan1, G4double tan2, G4double halfZ)
G4PolyhedronHyperbolicMirror(G4double a, G4double h, G4double r)
virtual ~G4PolyhedronPara()
Definition: G4Polyhedron.cc:66
G4PolyhedronPara(G4double Dx, G4double Dy, G4double Dz, G4double Alpha, G4double Theta, G4double Phi)
Definition: G4Polyhedron.cc:61
G4PolyhedronParaboloid(G4double r1, G4double r2, G4double dz, G4double sPhi, G4double dPhi)
virtual ~G4PolyhedronParaboloid()
G4PolyhedronPcon(G4double phi, G4double dphi, G4int nz, const G4double *z, const G4double *rmin, const G4double *rmax)
Definition: G4Polyhedron.cc:68
virtual ~G4PolyhedronPcon()
Definition: G4Polyhedron.cc:78
virtual ~G4PolyhedronPgon()
Definition: G4Polyhedron.cc:91
G4PolyhedronPgon(G4double phi, G4double dphi, G4int npdv, G4int nz, const G4double *z, const G4double *rmin, const G4double *rmax)
Definition: G4Polyhedron.cc:80
G4PolyhedronSphere(G4double rmin, G4double rmax, G4double phi, G4double dphi, G4double the, G4double dthe)
Definition: G4Polyhedron.cc:93
virtual ~G4PolyhedronSphere()
Definition: G4Polyhedron.cc:98
G4PolyhedronTet(const G4double p0[3], const G4double p1[3], const G4double p2[3], const G4double p3[3])
virtual ~G4PolyhedronTet()
G4PolyhedronTorus(G4double rmin, G4double rmax, G4double rtor, G4double phi, G4double dphi)
virtual ~G4PolyhedronTorus()
G4PolyhedronTrap(G4double Dz, G4double Theta, G4double Phi, G4double Dy1, G4double Dx1, G4double Dx2, G4double Alp1, G4double Dy2, G4double Dx3, G4double Dx4, G4double Alp2)
virtual ~G4PolyhedronTrap()
G4PolyhedronTrd1(G4double Dx1, G4double Dx2, G4double Dy, G4double Dz)
virtual ~G4PolyhedronTrd1()
G4PolyhedronTrd2(G4double Dx1, G4double Dx2, G4double Dy1, G4double Dy2, G4double Dz)
virtual ~G4PolyhedronTrd2()
G4PolyhedronTube(G4double Rmin, G4double Rmax, G4double Dz)
virtual ~G4PolyhedronTube()
G4PolyhedronTubs(G4double Rmin, G4double Rmax, G4double Dz, G4double Phi1, G4double Dphi)
virtual ~G4PolyhedronTubs()
G4int fNumberOfRotationStepsAtTimeOfCreation
G4int GetNumberOfRotationStepsAtTimeOfCreation() const
virtual ~G4Polyhedron()
Definition: G4Polyhedron.cc:34
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)