Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:30

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Class Description:
0027 // HepPolyhedron is an intermediate class between description of a shape
0028 // and visualization systems. It is intended to provide some service like:
0029 //   - polygonization of shapes with triangulization (quadrilaterization)
0030 //     of complex polygons;
0031 //   - calculation of normals for faces and vertices;
0032 //   - finding result of boolean operation on polyhedra;
0033 //
0034 // Public constructors:
0035 //
0036 //   HepPolyhedronBox (dx,dy,dz)
0037 //                                        - create polyhedron for Box;
0038 //   HepPolyhedronTrd1 (dx1,dx2,dy,dz)
0039 //                                        - create polyhedron for Trd1;
0040 //   HepPolyhedronTrd2 (dx1,dx2,dy1,dy2,dz)
0041 //                                        - create polyhedron for Trd2;
0042 //   HepPolyhedronTrap (dz,theta,phi, h1,bl1,tl1,alp1, h2,bl2,tl2,alp2)
0043 //                                        - create polyhedron for Trap;
0044 //   HepPolyhedronPara (dx,dy,dz,alpha,theta,phi)
0045 //                                        - create polyhedron for Para;
0046 //   HepPolyhedronTube (rmin,rmax,dz)
0047 //                                        - create polyhedron for Tube;
0048 //   HepPolyhedronTubs (rmin,rmax,dz,phi1,dphi)
0049 //                                        - create polyhedron for Tubs;
0050 //   HepPolyhedronCone (rmin1,rmax1,rmin2,rmax2,dz)
0051 //                                        - create polyhedron for Cone;
0052 //   HepPolyhedronCons (rmin1,rmax1,rmin2,rmax2,dz,phi1,dphi)
0053 //                                        - create polyhedron for Cons;
0054 //   HepPolyhedronPgon (phi,dphi,npdv,nz, z(*),rmin(*),rmax(*))
0055 //                                        - create polyhedron for Pgon;
0056 //   HepPolyhedronPcon (phi,dphi,nz, z(*),rmin(*),rmax(*))
0057 //                                        - create polyhedron for Pcon;
0058 //   HepPolyhedronSphere (rmin,rmax,phi,dphi,the,dthe)
0059 //                                        - create polyhedron for Sphere;
0060 //   HepPolyhedronTorus (rmin,rmax,rtor,phi,dphi)
0061 //                                        - create polyhedron for Torus;
0062 //   HepPolyhedronTet (p0[3],p1[3],p2[3],p3[3])
0063 //                                        - create polyhedron for Tet;
0064 //   HepPolyhedronEllipsoid (dx,dy,dz,zcut1,zcut2)
0065 //                                        - create polyhedron for Ellipsoid;
0066 //   HepPolyhedronEllipticalCone(dx,dy,z,zcut1)
0067 //                                        - create polyhedron for Elliptical cone;
0068 //   HepPolyhedronParaboloid (r1,r2,dz,phi,dphi)
0069 //                                        - create polyhedron for Paraboloid;
0070 //   HepPolyhedronHype (r1,r2,tan1,tan2,halfz)
0071 //                                        - create polyhedron for Hype;
0072 //   HepPolyhedronHyperbolicMirror (a,h,r)
0073 //                                        - create polyhedron for Hyperbolic mirror;
0074 //   HepPolyhedronTetMesh (vector<p>)
0075 //                                        - create polyhedron for tetrahedron mesh;
0076 //   HepPolyhedronBoxMesh (sx,sy,sz,vector<p>)
0077 //                                        - create polyhedron for box mesh;
0078 // Public functions:
0079 //
0080 //   GetNoVertices ()       - returns number of vertices;
0081 //   GetNoFacets ()         - returns number of faces;
0082 //   GetNextVertexIndex (index,edgeFlag) - get vertex indices of the
0083 //                            quadrilaterals in order;
0084 //                            returns false when finished each face;
0085 //   GetVertex (index)      - returns vertex by index;
0086 //   GetNextVertex (vertex,edgeFlag) - get vertices with edge visibility
0087 //                            of the quadrilaterals in order;
0088 //                            returns false when finished each face;
0089 //   GetNextVertex (vertex,edgeFlag,normal) - get vertices with edge
0090 //                            visibility and normal of the quadrilaterals
0091 //                            in order; returns false when finished each face;
0092 //   GetNextEdgeIndices (i1,i2,edgeFlag) - get indices of the next edge;
0093 //                            returns false for the last edge;
0094 //   GetNextEdgeIndices (i1,i2,edgeFlag,iface1,iface2) - get indices of
0095 //                            the next edge with indices of the faces
0096 //                            to which the edge belongs;
0097 //                            returns false for the last edge;
0098 //   GetNextEdge (p1,p2,edgeFlag) - get next edge;
0099 //                            returns false for the last edge;
0100 //   GetNextEdge (p1,p2,edgeFlag,iface1,iface2) - get next edge with indices
0101 //                            of the faces to which the edge belongs;
0102 //                            returns false for the last edge;
0103 //   GetFacet (index,n,nodes,edgeFlags=0,normals=0) - get face by index;
0104 //   GetNextFacet (n,nodes,edgeFlags=0,normals=0) - get next face with normals
0105 //                            at the nodes; returns false for the last face;
0106 //   GetNormal (index)      - get normal of face given by index;
0107 //   GetUnitNormal (index)  - get unit normal of face given by index;
0108 //   GetNextNormal (normal) - get normals of each face in order;
0109 //                            returns false when finished all faces;
0110 //   GetNextUnitNormal (normal) - get normals of unit length of each face
0111 //                            in order; returns false when finished all faces;
0112 //   GetSurfaceArea()       - get surface area of the polyhedron;
0113 //   GetVolume()            - get volume of the polyhedron;
0114 //   GetNumberOfRotationSteps() - get number of steps for whole circle;
0115 //   SetVertex(index, v)    - set vertex;
0116 //   SetFacet(index,iv1,iv2,iv3,iv4) - set facet;
0117 //   SetReferences()        - set references to neighbouring facets;
0118 //   JoinCoplanarFacets(tolerance) - join coplanar facets where it is possible
0119 //   InvertFacets()         - invert the order on nodes in facets;
0120 //   SetNumberOfRotationSteps (n) - set number of steps for whole circle;
0121 //   ResetNumberOfRotationSteps() - reset number of steps for whole circle
0122 //                            to default value;
0123 // History:
0124 //
0125 // 20.06.96 Evgeni Chernyaev <Evgueni.Tcherniaev@cern.ch> - initial version
0126 //
0127 // 23.07.96 John Allison
0128 // - added GetNoVertices, GetNoFacets, GetNextVertex, GetNextNormal
0129 //
0130 // 30.09.96 E.Chernyaev
0131 // - added GetNextVertexIndex, GetVertex by Yasuhide Sawada
0132 // - added GetNextUnitNormal, GetNextEdgeIndices, GetNextEdge
0133 // - improvements: angles now expected in radians
0134 //                 int -> G4int, double -> G4double
0135 // - G4ThreeVector replaced by either G4Point3D or G4Normal3D
0136 //
0137 // 15.12.96 E.Chernyaev
0138 // - private functions G4PolyhedronAlloc, G4PolyhedronPrism renamed
0139 //   to AllocateMemory and CreatePrism
0140 // - added private functions GetNumberOfRotationSteps, RotateEdge,
0141 //   RotateAroundZ, SetReferences
0142 // - rewritten G4PolyhedronCons;
0143 // - added G4PolyhedronPara, ...Trap, ...Pgon, ...Pcon, ...Sphere, ...Torus,
0144 //   so full List of implemented shapes now looks like:
0145 //   BOX, TRD1, TRD2, TRAP, TUBE, TUBS, CONE, CONS, PARA, PGON, PCON,
0146 //   SPHERE, TORUS
0147 //
0148 // 01.06.97 E.Chernyaev
0149 // - RotateAroundZ modified and SetSideFacets added to allow Rmin=Rmax
0150 //   in bodies of revolution
0151 //
0152 // 24.06.97 J.Allison
0153 // - added static private member fNumberOfRotationSteps and static public
0154 //   functions void SetNumberOfRotationSteps (G4int n) and
0155 //   void ResetNumberOfRotationSteps ().  Modified
0156 //   GetNumberOfRotationSteps() appropriately.  Made all three functions
0157 //   inline (at end of this .hh file).
0158 //   Usage:
0159 //    G4Polyhedron::SetNumberOfRotationSteps
0160 //     (fpView -> GetViewParameters ().GetNoOfSides ());
0161 //    pPolyhedron = solid.CreatePolyhedron ();
0162 //    G4Polyhedron::ResetNumberOfRotationSteps ();
0163 //
0164 // 19.03.00 E.Chernyaev
0165 // - added boolean operations (add, subtract, intersect) on polyhedra;
0166 //
0167 // 25.05.01 E.Chernyaev
0168 // - added GetSurfaceArea() and GetVolume();
0169 //
0170 // 05.11.02 E.Chernyaev
0171 // - added createTwistedTrap() and createPolyhedron();
0172 //
0173 // 06.03.05 J.Allison
0174 // - added IsErrorBooleanProcess
0175 //
0176 // 20.06.05 G.Cosmo
0177 // - added HepPolyhedronEllipsoid
0178 //
0179 // 18.07.07 T.Nikitina
0180 // - added HepPolyhedronParaboloid;
0181 //
0182 // 21.10.09 J.Allison
0183 // - removed IsErrorBooleanProcess (now error is returned through argument)
0184 //
0185 // 22.02.20 E.Chernyaev
0186 // - added HepPolyhedronTet, HepPolyhedronHyberbolicMirror
0187 //
0188 // 12.05.21 E.Chernyaev
0189 // - added TriangulatePolygon(), RotateContourAroundZ()
0190 // - added HepPolyhedronPgon, HepPolyhedronPcon given by rz-countour
0191 //
0192 // 26.03.22 E.Chernyaev
0193 // - added HepPolyhedronTetMesh
0194 //
0195 // 04.04.22 E.Chernyaev
0196 // - added JoinCoplanarFacets()
0197 //
0198 // 07.04.22 E.Chernyaev
0199 // - added HepPolyhedronBoxMesh
0200 
0201 #ifndef HEP_POLYHEDRON_HH
0202 #define HEP_POLYHEDRON_HH
0203 
0204 #include <vector>
0205 #include "G4Types.hh"
0206 #include "G4TwoVector.hh"
0207 #include "G4ThreeVector.hh"
0208 #include "G4Point3D.hh"
0209 #include "G4Normal3D.hh"
0210 #include "G4Transform3D.hh"
0211 
0212 #ifndef DEFAULT_NUMBER_OF_STEPS
0213 #define DEFAULT_NUMBER_OF_STEPS 24
0214 #endif
0215 
0216 class G4Facet {
0217   friend class HepPolyhedron;
0218   friend std::ostream& operator<<(std::ostream&, const G4Facet &facet);
0219 
0220  private:
0221   struct G4Edge { G4int v,f; };
0222   G4Edge edge[4];
0223 
0224  public:
0225   G4Facet(G4int v1=0, G4int f1=0, G4int v2=0, G4int f2=0,
0226           G4int v3=0, G4int f3=0, G4int v4=0, G4int f4=0)
0227   { edge[0].v=v1; edge[0].f=f1; edge[1].v=v2; edge[1].f=f2;
0228     edge[2].v=v3; edge[2].f=f3; edge[3].v=v4; edge[3].f=f4; }
0229 };
0230 
0231 class HepPolyhedron {
0232   friend std::ostream& operator<<(std::ostream&, const HepPolyhedron &ph);
0233 
0234  protected:
0235   static G4ThreadLocal G4int fNumberOfRotationSteps;
0236   G4int nvert, nface;
0237   G4Point3D  *pV;
0238   G4Facet    *pF;
0239 
0240   // Re-allocate memory for HepPolyhedron
0241   void AllocateMemory(G4int Nvert, G4int Nface);
0242 
0243   // Find neighbouring facet
0244   G4int FindNeighbour(G4int iFace, G4int iNode, G4int iOrder) const;
0245 
0246   // Find normal at node
0247   G4Normal3D FindNodeNormal(G4int iFace, G4int iNode) const;
0248 
0249   // Create HepPolyhedron for prism with quadrilateral base
0250   void CreatePrism();
0251 
0252   // Generate facets by revolving an edge around Z-axis
0253   void RotateEdge(G4int k1, G4int k2, G4double r1, G4double r2,
0254                   G4int v1, G4int v2, G4int vEdge,
0255                   G4bool ifWholeCircle, G4int ns, G4int &kface);
0256 
0257   // Set side facets for the case of incomplete rotation
0258   void SetSideFacets(G4int ii[4], G4int vv[4],
0259                      G4int *kk, G4double *r,
0260                      G4double dphi, G4int ns, G4int &kface);
0261 
0262   // Create HepPolyhedron for body of revolution around Z-axis
0263   void RotateAroundZ(G4int nstep, G4double phi, G4double dphi,
0264                      G4int np1, G4int np2,
0265                      const G4double *z, G4double *r,
0266                      G4int nodeVis, G4int edgeVis);
0267 
0268   // Create HepPolyhedron for body of revolution around Z-axis
0269   void RotateContourAroundZ(G4int nstep, G4double phi, G4double dphi,
0270                             const std::vector<G4TwoVector> &rz,
0271                             G4int nodeVis, G4int edgeVis);
0272 
0273   // Triangulate closed polygon (contour)
0274   G4bool TriangulatePolygon(const std::vector<G4TwoVector> &polygon,
0275                             std::vector<G4int> &result);
0276 
0277   // Helper function for TriangulatePolygon()
0278   G4bool CheckSnip(const std::vector<G4TwoVector> &contour,
0279                    G4int a, G4int b, G4int c,
0280                    G4int n, const G4int* V);
0281 
0282  public:
0283   // Default constructor
0284   HepPolyhedron() : nvert(0), nface(0), pV(nullptr), pF(nullptr) {}
0285 
0286   // Constructor with allocation of memory
0287   HepPolyhedron(G4int Nvert, G4int Nface);
0288 
0289   // Copy constructor
0290   HepPolyhedron(const HepPolyhedron & from);
0291 
0292   // Move constructor
0293   HepPolyhedron(HepPolyhedron && from);
0294 
0295   // Destructor
0296   virtual ~HepPolyhedron() { delete [] pV; delete [] pF; }
0297 
0298   // Assignment
0299   HepPolyhedron & operator=(const HepPolyhedron & from);
0300 
0301   // Move assignment
0302   HepPolyhedron & operator=(HepPolyhedron && from);
0303 
0304   // Get number of vertices
0305   G4int GetNoVertices() const { return nvert; }
0306   G4int GetNoVerteces() const { return nvert; }  // Old spelling.
0307 
0308   // Get number of facets
0309   G4int GetNoFacets() const { return nface; }
0310 
0311   // Transform the polyhedron
0312   HepPolyhedron & Transform(const G4Transform3D & t);
0313 
0314   // Get next vertex index of the quadrilateral
0315   G4bool GetNextVertexIndex(G4int & index, G4int & edgeFlag) const;
0316 
0317   // Get vertex by index
0318   G4Point3D GetVertex(G4int index) const;
0319 
0320   // Get next vertex + edge visibility of the quadrilateral
0321   G4bool GetNextVertex(G4Point3D & vertex, G4int & edgeFlag) const;
0322 
0323   // Get next vertex + edge visibility + normal of the quadrilateral
0324   G4bool GetNextVertex(G4Point3D & vertex, G4int & edgeFlag,
0325                        G4Normal3D & normal) const;
0326 
0327   // Get indices of the next edge with indices of the faces
0328   G4bool GetNextEdgeIndices(G4int & i1, G4int & i2, G4int & edgeFlag,
0329                             G4int & iface1, G4int & iface2) const;
0330   G4bool GetNextEdgeIndeces(G4int & i1, G4int & i2, G4int & edgeFlag,
0331                             G4int & iface1, G4int & iface2) const
0332   {return GetNextEdgeIndices(i1,i2,edgeFlag,iface1,iface2);}  // Old spelling
0333 
0334   // Get indices of the next edge
0335   G4bool GetNextEdgeIndices(G4int & i1, G4int & i2, G4int & edgeFlag) const;
0336   G4bool GetNextEdgeIndeces(G4int & i1, G4int & i2, G4int & edgeFlag) const
0337   {return GetNextEdgeIndices(i1,i2,edgeFlag);}  // Old spelling.
0338 
0339   // Get next edge
0340   G4bool GetNextEdge(G4Point3D &p1, G4Point3D &p2, G4int &edgeFlag) const;
0341 
0342   // Get next edge
0343   G4bool GetNextEdge(G4Point3D &p1, G4Point3D &p2, G4int &edgeFlag,
0344                      G4int &iface1, G4int &iface2) const;
0345 
0346   // Get face by index
0347   void GetFacet(G4int iFace, G4int &n, G4int *iNodes,
0348                 G4int *edgeFlags = nullptr, G4int *iFaces = nullptr) const;
0349 
0350   // Get face by index
0351   void GetFacet(G4int iFace, G4int &n, G4Point3D *nodes,
0352                 G4int *edgeFlags=nullptr, G4Normal3D *normals=nullptr) const;
0353 
0354   // Get next face with normals at the nodes
0355   G4bool GetNextFacet(G4int &n, G4Point3D *nodes, G4int *edgeFlags=nullptr,
0356                       G4Normal3D *normals=nullptr) const;
0357 
0358   // Get normal of the face given by index
0359   G4Normal3D GetNormal(G4int iFace) const;
0360 
0361   // Get unit normal of the face given by index
0362   G4Normal3D GetUnitNormal(G4int iFace) const;
0363 
0364   // Get normal of the next face
0365   G4bool GetNextNormal(G4Normal3D &normal) const;
0366 
0367   // Get normal of unit length of the next face
0368   G4bool GetNextUnitNormal(G4Normal3D &normal) const;
0369 
0370   // Boolean operations
0371   HepPolyhedron add(const HepPolyhedron &p) const;
0372   HepPolyhedron subtract(const HepPolyhedron &p) const;
0373   HepPolyhedron intersect(const HepPolyhedron &p) const;
0374 
0375   // Get area of the surface of the polyhedron
0376   G4double GetSurfaceArea() const;
0377 
0378   // Get volume of the polyhedron
0379   G4double GetVolume() const;
0380 
0381   // Get number of steps for whole circle
0382   static G4int GetNumberOfRotationSteps();
0383 
0384   // Set vertex (1 <= index <= Nvert)
0385   void SetVertex(G4int index, const G4Point3D& v);
0386 
0387   // Set facet (1 <= index <= Nface)
0388   void SetFacet(G4int index, G4int iv1, G4int iv2, G4int iv3, G4int iv4 = 0);
0389 
0390   // For each edge set reference to neighbouring facet,
0391   // call this after all vertices and facets have been set
0392   void SetReferences();
0393 
0394   // Join couples of triangular facets to quadrangular facets
0395   // where it is possible
0396   void JoinCoplanarFacets(G4double tolerance);
0397 
0398   // Invert the order on nodes in facets
0399   void InvertFacets();
0400 
0401   // Set number of steps for whole circle
0402   static void SetNumberOfRotationSteps(G4int n);
0403 
0404   // Reset number of steps for whole circle to default value
0405   static void ResetNumberOfRotationSteps();
0406 
0407   /**
0408    * Creates polyhedron for twisted trapezoid.
0409    * The trapezoid is given by two bases perpendicular to the z-axis.
0410    *
0411    * @param  Dz  half length in z
0412    * @param  xy1 1st base (at z = -Dz)
0413    * @param  xy2 2nd base (at z = +Dz)
0414    * @return status of the operation - is non-zero in case of problem
0415    */
0416   G4int createTwistedTrap(G4double Dz,
0417                         const G4double xy1[][2], const G4double xy2[][2]);
0418 
0419   /**
0420    * Creates user defined polyhedron.
0421    * This function allows to the user to define arbitrary polyhedron.
0422    * The faces of the polyhedron should be either triangles or planar
0423    * quadrilateral. Nodes of a face are defined by indexes pointing to
0424    * the elements in the xyz array. Numeration of the elements in the
0425    * array starts from 1 (like in fortran). The indexes can be positive
0426    * or negative. Negative sign means that the corresponding edge is
0427    * invisible. The normal of the face should be directed to exterior
0428    * of the polyhedron.
0429    *
0430    * @param  Nnodes number of nodes
0431    * @param  Nfaces number of faces
0432    * @param  xyz    nodes
0433    * @param  faces  faces (quadrilaterals or triangles)
0434    * @return status of the operation - is non-zero in case of problem
0435    */
0436   G4int createPolyhedron(G4int Nnodes, G4int Nfaces,
0437                          const G4double xyz[][3], const G4int faces[][4]);
0438 
0439   /**
0440    * Calculate the unweighted mean of all the vertices in the polyhedron. Not to be
0441    * confused with the polyhedron centre or centre of mass
0442    * @return G4Point3D of the unweighted mean vertex position
0443    */
0444   G4Point3D vertexUnweightedMean() const;
0445 };
0446 
0447 class HepPolyhedronTrd2 : public HepPolyhedron
0448 {
0449  public:
0450   HepPolyhedronTrd2(G4double Dx1, G4double Dx2,
0451                     G4double Dy1, G4double Dy2, G4double Dz);
0452   ~HepPolyhedronTrd2() override;
0453 };
0454 
0455 class HepPolyhedronTrd1 : public HepPolyhedronTrd2
0456 {
0457  public:
0458   HepPolyhedronTrd1(G4double Dx1, G4double Dx2,
0459                     G4double Dy, G4double Dz);
0460   ~HepPolyhedronTrd1() override;
0461 };
0462 
0463 class HepPolyhedronBox : public HepPolyhedronTrd2
0464 {
0465  public:
0466   HepPolyhedronBox(G4double Dx, G4double Dy, G4double Dz);
0467   ~HepPolyhedronBox() override;
0468 };
0469 
0470 class HepPolyhedronTrap : public HepPolyhedron
0471 {
0472  public:
0473   HepPolyhedronTrap(G4double Dz, G4double Theta, G4double Phi,
0474                     G4double Dy1,
0475                     G4double Dx1, G4double Dx2, G4double Alp1,
0476                     G4double Dy2,
0477                     G4double Dx3, G4double Dx4, G4double Alp2);
0478   ~HepPolyhedronTrap() override;
0479 };
0480 
0481 class HepPolyhedronPara : public HepPolyhedronTrap
0482 {
0483  public:
0484   HepPolyhedronPara(G4double Dx, G4double Dy, G4double Dz,
0485                     G4double Alpha, G4double Theta, G4double Phi);
0486   ~HepPolyhedronPara() override;
0487 };
0488 
0489 class HepPolyhedronParaboloid : public HepPolyhedron
0490 {
0491  public:
0492   HepPolyhedronParaboloid(G4double r1,
0493                           G4double r2,
0494                           G4double dz,
0495                           G4double Phi1,
0496                           G4double Dphi);
0497   ~HepPolyhedronParaboloid() override;
0498 };
0499 
0500 class HepPolyhedronHype : public HepPolyhedron
0501 {
0502  public:
0503   HepPolyhedronHype(G4double r1,
0504                     G4double r2,
0505                     G4double tan1,
0506                     G4double tan2,
0507                     G4double halfZ);
0508   ~HepPolyhedronHype() override;
0509 };
0510 
0511 class HepPolyhedronCons : public HepPolyhedron
0512 {
0513  public:
0514   HepPolyhedronCons(G4double Rmn1, G4double Rmx1,
0515                     G4double Rmn2, G4double Rmx2, G4double Dz,
0516                     G4double Phi1, G4double Dphi);
0517   ~HepPolyhedronCons() override;
0518 };
0519 
0520 class HepPolyhedronCone : public HepPolyhedronCons
0521 {
0522  public:
0523   HepPolyhedronCone(G4double Rmn1, G4double Rmx1,
0524                     G4double Rmn2, G4double Rmx2, G4double Dz);
0525   ~HepPolyhedronCone() override;
0526 };
0527 
0528 class HepPolyhedronTubs : public HepPolyhedronCons
0529 {
0530  public:
0531   HepPolyhedronTubs(G4double Rmin, G4double Rmax, G4double Dz,
0532                     G4double Phi1, G4double Dphi);
0533   ~HepPolyhedronTubs() override;
0534 };
0535 
0536 class HepPolyhedronTube : public HepPolyhedronCons
0537 {
0538  public:
0539   HepPolyhedronTube (G4double Rmin, G4double Rmax, G4double Dz);
0540   ~HepPolyhedronTube() override;
0541 };
0542 
0543 class HepPolyhedronPgon : public HepPolyhedron
0544 {
0545  public:
0546   HepPolyhedronPgon(G4double phi, G4double dphi, G4int npdv, G4int nz,
0547                     const G4double *z,
0548                     const G4double *rmin,
0549                     const G4double *rmax);
0550   HepPolyhedronPgon(G4double phi, G4double dphi, G4int npdv,
0551                     const std::vector<G4TwoVector> &rz);
0552   ~HepPolyhedronPgon() override;
0553 };
0554 
0555 class HepPolyhedronPcon : public HepPolyhedronPgon
0556 {
0557  public:
0558   HepPolyhedronPcon(G4double phi, G4double dphi, G4int nz,
0559                     const G4double *z,
0560                     const G4double *rmin,
0561                     const G4double *rmax);
0562   HepPolyhedronPcon(G4double phi, G4double dphi,
0563                     const std::vector<G4TwoVector> &rz);
0564   ~HepPolyhedronPcon() override;
0565 };
0566 
0567 class HepPolyhedronSphere : public HepPolyhedron
0568 {
0569  public:
0570   HepPolyhedronSphere(G4double rmin, G4double rmax,
0571                       G4double phi, G4double dphi,
0572                       G4double the, G4double dthe);
0573   ~HepPolyhedronSphere() override;
0574 };
0575 
0576 class HepPolyhedronTorus : public HepPolyhedron
0577 {
0578  public:
0579   HepPolyhedronTorus(G4double rmin, G4double rmax, G4double rtor,
0580                      G4double phi, G4double dphi);
0581   ~HepPolyhedronTorus() override;
0582 };
0583 
0584 class HepPolyhedronTet : public HepPolyhedron
0585 {
0586  public:
0587   HepPolyhedronTet(const G4double p0[3],
0588                    const G4double p1[3],
0589                    const G4double p2[3],
0590                    const G4double p3[3]);
0591   ~HepPolyhedronTet() override;
0592 };
0593 
0594 class HepPolyhedronEllipsoid : public HepPolyhedron
0595 {
0596  public:
0597   HepPolyhedronEllipsoid(G4double dx, G4double dy, G4double dz,
0598                          G4double zcut1, G4double zcut2);
0599   ~HepPolyhedronEllipsoid() override;
0600 };
0601 
0602 class HepPolyhedronEllipticalCone : public HepPolyhedron
0603 {
0604  public:
0605   HepPolyhedronEllipticalCone(G4double dx, G4double dy, G4double z,
0606                               G4double zcut1);
0607   ~HepPolyhedronEllipticalCone() override;
0608 };
0609 
0610 class HepPolyhedronHyperbolicMirror : public HepPolyhedron
0611 {
0612  public:
0613   HepPolyhedronHyperbolicMirror(G4double a, G4double h, G4double r);
0614   ~HepPolyhedronHyperbolicMirror() override;
0615 };
0616 
0617 class HepPolyhedronTetMesh : public HepPolyhedron
0618 {
0619  public:
0620   HepPolyhedronTetMesh(const std::vector<G4ThreeVector>& tetrahedra);
0621   ~HepPolyhedronTetMesh() override;
0622 };
0623 
0624 class HepPolyhedronBoxMesh : public HepPolyhedron
0625 {
0626  public:
0627   HepPolyhedronBoxMesh(G4double sizeX, G4double sizeY, G4double sizeZ,
0628                        const std::vector<G4ThreeVector>& positions);
0629   ~HepPolyhedronBoxMesh() override;
0630 };
0631 
0632 #endif /* HEP_POLYHEDRON_HH */