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