G4Polyhedron.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 
00029 #ifndef G4POLYHEDRON_HH
00030 #define G4POLYHEDRON_HH
00031 
00032 // Class Description:
00033 // G4Polyhedron is an intermediate class between G4 and visualization
00034 // systems. It is intended to provide some service like:
00035 //   - polygonization of the G4 shapes with triangulization
00036 //     (quadrilaterization) of complex polygons;
00037 //   - calculation of normals for faces and vertices.
00038 //
00039 // Inherits from HepPolyhedron, to which reference should be made for
00040 // functionality.
00041 //
00042 // Public constructors:
00043 //   G4PolyhedronBox(dx,dy,dz)            - create G4Polyhedron for G4 Box;
00044 //   G4PolyhedronTrd1(dx1,dx2,dy,dz)      - create G4Polyhedron for G4 Trd1;
00045 //   G4PolyhedronTrd2(dx1,dx2,dy1,dy2,dz) - create G4Polyhedron for G4 Trd2;
00046 //   G4PolyhedronTrap(dz,theta,phi,
00047 //                    h1,bl1,tl1,alp1,
00048 //                    h2,bl2,tl2,alp2)    - create G4Polyhedron for G4 Trap;
00049 //   G4PolyhedronPara(dx,dy,dz,
00050 //                    alpha,theta,phi)    - create G4Polyhedron for G4 Para;
00051 //
00052 //   G4PolyhedronTube(rmin,rmax,dz)       - create G4Polyhedron for G4 Tube;
00053 //   G4PolyhedronTubs(rmin,rmax,dz,
00054 //                    phi1,dphi)          - create G4Polyhedron for G4 Tubs;
00055 //   G4PolyhedronCone(rmin1,rmax1,
00056 //                    rmin2,rmax2,dz)     - create G4Polyhedron for G4 Cone;
00057 //   G4PolyhedronCons(rmin1,rmax1,
00058 //                    rmin2,rmax2,dz,
00059 //                    phi1,dphi)          - create G4Polyhedron for G4 Cons;
00060 //
00061 //   G4PolyhedronPgon(phi,dphi,npdv,nz,
00062 //                    z(*),rmin(*),rmax(*)) - create G4Polyhedron for G4 Pgon;
00063 //   G4PolyhedronPcon(phi,dphi,nz,
00064 //                    z(*),rmin(*),rmax(*)) - create G4Polyhedron for G4 Pcon;
00065 //
00066 //   G4PolyhedronSphere(rmin,rmax,
00067 //                      phi,dphi,the,dthe)  - create G4Polyhedron for Sphere;
00068 //   G4PolyhedronTorus(rmin,rmax,rtor,
00069 //                     phi,dphi)            - create G4Polyhedron for Torus;
00070 //   G4PolyhedronEllipsoid(dx,dy,dz,
00071 //                     zcut1,zcut2)         - create G4Polyhedron for Ellipsoid;
00072 //
00073 // Public functions inherited from HepPolyhedron (this list might be
00074 // incomplete):
00075 //   GetNoVertices()  - returns number of vertices
00076 //   GetNoFacets()    - returns number of faces
00077 //   GetNextVertexIndex(index, edgeFlag) - get vertex indeces of the
00078 //                      quadrilaterals in order; returns false when
00079 //                      finished each face;
00080 //   GetVertex(index) - returns vertex by index;
00081 //   GetNextVertex(vertex, edgeFlag) - get vertices with edge visibility
00082 //                      of the quadrilaterals in order;
00083 //                      returns false when finished each face;
00084 //   GetNextVertex(vertex, edgeFlag, normal) - get vertices with edge
00085 //                      visibility and normal of the quadrilaterals
00086 //                      in order; returns false when finished each face;
00087 //   GetNextNormal(normal) - get normals of each face in order;
00088 //                      returns false when finished all faces;
00089 //   GetNextUnitNormal(normal) - get normals of unit length of each face
00090 //                      in order; returns false when finished all faces;
00091 //   GetNextEdgeIndeces(i1, i2, edgeFlag) - get indeces of the next edge;
00092 //                      returns false for the last edge;
00093 //   GetNextEdge(p1, p2, edgeFlag) - get next edge;
00094 //                      returns false for the last edge;
00095 //   SetNumberOfRotationSteps(G4int n) - Set number of steps for whole circle;
00096 
00097 // History:
00098 // 21st February 2000  Evgeni Chernaev, John Allison
00099 // - Re-written to inherit HepPolyhedron.
00100 //
00101 // 11.03.05 J.Allison
00102 // - Added fNumberOfRotationStepsAtTimeOfCreation and access method.
00103 //   (NumberOfRotationSteps is also called number of sides per circle or
00104 //   line segments per circle - see
00105 //   /vis/viewer/set/lineSegmentsPerCircle.)
00106 // 20.06.05 G.Cosmo
00107 // - Added G4PolyhedronEllipsoid.
00108 // 09.03.06 J.Allison
00109 // - Added operator<<.
00110 
00111 #include "globals.hh"
00112 #include "HepPolyhedron.h"
00113 #include "G4Visible.hh"
00114 
00115 class G4Polyhedron : public HepPolyhedron, public G4Visible {
00116 public:
00117   G4Polyhedron ();
00118   G4Polyhedron (const HepPolyhedron& from);
00119   // Use compiler defaults for copy contructor and assignment.  (They
00120   // invoke their counterparts in HepPolyhedron and G4Visible.)
00121   virtual ~G4Polyhedron ();
00122 
00123   G4int GetNumberOfRotationStepsAtTimeOfCreation() const {
00124     return fNumberOfRotationStepsAtTimeOfCreation;
00125   }
00126 private:
00127   G4int fNumberOfRotationStepsAtTimeOfCreation;
00128 };
00129 
00130 class G4PolyhedronBox: public G4Polyhedron {
00131 public:
00132   G4PolyhedronBox (G4double dx, G4double dy, G4double dz);
00133   virtual ~G4PolyhedronBox ();
00134 };
00135 
00136 class G4PolyhedronCone: public G4Polyhedron {
00137 public:
00138   G4PolyhedronCone (G4double Rmn1, G4double Rmx1, 
00139                     G4double Rmn2, G4double Rmx2, G4double Dz);
00140   virtual ~G4PolyhedronCone (); 
00141 };
00142 
00143 class G4PolyhedronCons: public G4Polyhedron {
00144 public:
00145   G4PolyhedronCons (G4double Rmn1, G4double Rmx1, 
00146                     G4double Rmn2, G4double Rmx2, G4double Dz,
00147                     G4double Phi1, G4double Dphi);
00148   virtual ~G4PolyhedronCons ();
00149 };
00150 
00151 class G4PolyhedronPara: public G4Polyhedron {
00152 public:
00153   G4PolyhedronPara (G4double Dx, G4double Dy, G4double Dz,
00154                     G4double Alpha, G4double Theta, G4double Phi);
00155   virtual ~G4PolyhedronPara ();
00156 };
00157 
00158 class G4PolyhedronPcon: public G4Polyhedron {
00159 public:
00160   G4PolyhedronPcon (G4double phi, G4double dphi, G4int nz,
00161                     const G4double *z,
00162                     const G4double *rmin,
00163                     const G4double *rmax);
00164   virtual ~G4PolyhedronPcon ();
00165 };
00166 
00167 class G4PolyhedronPgon: public G4Polyhedron {
00168 public:
00169   G4PolyhedronPgon (G4double phi, G4double dphi, G4int npdv, G4int nz,
00170                     const G4double *z,
00171                     const G4double *rmin,
00172                     const G4double *rmax);
00173   virtual ~G4PolyhedronPgon ();
00174 };
00175 
00176 class G4PolyhedronSphere: public G4Polyhedron {
00177 public:
00178   G4PolyhedronSphere (G4double rmin, G4double rmax,
00179                       G4double phi, G4double dphi,
00180                       G4double the, G4double dthe);
00181   virtual ~G4PolyhedronSphere ();
00182 };
00183 
00184 class G4PolyhedronTorus: public G4Polyhedron {
00185 public:
00186   G4PolyhedronTorus (G4double rmin, G4double rmax, G4double rtor,
00187                     G4double phi, G4double dphi);
00188   virtual ~G4PolyhedronTorus ();
00189 };
00190 
00191 class G4PolyhedronTrap: public G4Polyhedron {
00192 public:
00193   G4PolyhedronTrap (G4double Dz, G4double Theta, G4double Phi,
00194                     G4double Dy1,
00195                     G4double Dx1, G4double Dx2, G4double Alp1,
00196                     G4double Dy2,
00197                     G4double Dx3, G4double Dx4, G4double Alp2);
00198   virtual ~G4PolyhedronTrap ();
00199 };
00200 
00201 class G4PolyhedronTrd1: public G4Polyhedron {
00202 public:
00203   G4PolyhedronTrd1 (G4double Dx1, G4double Dx2,
00204                     G4double Dy, G4double Dz);
00205   virtual ~G4PolyhedronTrd1 ();
00206 };
00207 
00208 class G4PolyhedronTrd2: public G4Polyhedron {
00209 public:
00210   G4PolyhedronTrd2 (G4double Dx1, G4double Dx2,
00211                     G4double Dy1, G4double Dy2, G4double Dz);
00212   virtual ~G4PolyhedronTrd2 ();
00213 };
00214 
00215 class G4PolyhedronTube: public G4Polyhedron {
00216 public:
00217   G4PolyhedronTube (G4double Rmin, G4double Rmax, G4double Dz);
00218   virtual ~G4PolyhedronTube ();
00219 };
00220 
00221 class G4PolyhedronTubs: public G4Polyhedron {
00222 public:
00223   G4PolyhedronTubs (G4double Rmin, G4double Rmax, G4double Dz, 
00224                     G4double Phi1, G4double Dphi);
00225   virtual ~G4PolyhedronTubs ();
00226 };
00227 
00228 class G4PolyhedronParaboloid: public G4Polyhedron {
00229  public:
00230   G4PolyhedronParaboloid(G4double r1, G4double r2, G4double dz,
00231                          G4double sPhi, G4double dPhi);
00232   virtual ~G4PolyhedronParaboloid ();
00233 };
00234 
00235 class G4PolyhedronHype: public G4Polyhedron {
00236  public:
00237   G4PolyhedronHype(G4double r1, G4double r2, G4double tan1,
00238                    G4double tan2, G4double halfZ);
00239   virtual ~G4PolyhedronHype ();
00240 };
00241 
00242 class G4PolyhedronEllipsoid : public G4Polyhedron {
00243  public:
00244   G4PolyhedronEllipsoid(G4double dx, G4double dy, G4double dz, 
00245                         G4double zcut1, G4double zcut2);
00246   virtual ~G4PolyhedronEllipsoid ();
00247 };
00248 
00249 class G4PolyhedronEllipticalCone : public G4Polyhedron {
00250  public:
00251   G4PolyhedronEllipticalCone(G4double dx, G4double dy, G4double z, 
00252                              G4double zcut1);
00253   virtual ~G4PolyhedronEllipticalCone ();
00254 };
00255 
00256 std::ostream& operator<<(std::ostream& os, const G4Polyhedron&);
00257 
00258 #endif /* G4POLYHEDRON_HH */

Generated on Mon May 27 17:49:24 2013 for Geant4 by  doxygen 1.4.7