ECCE @ EIC Software
 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 
124  }
125 private:
127 };
128 
130 public:
132  virtual ~G4PolyhedronBox ();
133 };
134 
136 public:
137  G4PolyhedronCone (G4double Rmn1, G4double Rmx1,
138  G4double Rmn2, G4double Rmx2, G4double Dz);
139  virtual ~G4PolyhedronCone ();
140 };
141 
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 
151 public:
153  G4double Alpha, G4double Theta, G4double Phi);
154  virtual ~G4PolyhedronPara ();
155 };
156 
158 public:
160  const G4double *z,
161  const G4double *rmin,
162  const G4double *rmax);
163  virtual ~G4PolyhedronPcon ();
164 };
165 
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 
176 public:
178  G4double phi, G4double dphi,
179  G4double the, G4double dthe);
180  virtual ~G4PolyhedronSphere ();
181 };
182 
184 public:
186  G4double phi, G4double dphi);
187  virtual ~G4PolyhedronTorus ();
188 };
189 
191 public:
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 
201 public:
204  virtual ~G4PolyhedronTrd1 ();
205 };
206 
208 public:
210  G4double Dy1, G4double Dy2, G4double Dz);
211  virtual ~G4PolyhedronTrd2 ();
212 };
213 
215 public:
217  virtual ~G4PolyhedronTube ();
218 };
219 
221 public:
223  G4double Phi1, G4double Dphi);
224  virtual ~G4PolyhedronTubs ();
225 };
226 
228  public:
230  G4double sPhi, G4double dPhi);
231  virtual ~G4PolyhedronParaboloid ();
232 };
233 
235  public:
237  G4double tan2, G4double halfZ);
238  virtual ~G4PolyhedronHype ();
239 };
240 
242  public:
244  G4double zcut1, G4double zcut2);
245  virtual ~G4PolyhedronEllipsoid ();
246 };
247 
249  public:
251  G4double zcut1);
252  virtual ~G4PolyhedronEllipticalCone ();
253 };
254 
255 std::ostream& operator<<(std::ostream& os, const G4Polyhedron&);
256 
257 #endif /* G4POLYHEDRON_HH */