G4Polycone.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: G4Polycone.hh 67011 2013-01-29 16:17:41Z gcosmo $
00028 //
00029 // 
00030 // --------------------------------------------------------------------
00031 // GEANT 4 class header file
00032 //
00033 //
00034 // G4Polycone
00035 //
00036 // Class description:
00037 //
00038 //   Class implementing a CSG-like type "PCON" Geant 3.21 volume,
00039 //   inherited from  class G4VCSGfaceted:
00040 //
00041 //   G4Polycone( const G4String& name, 
00042 //               G4double phiStart,     // initial phi starting angle
00043 //               G4double phiTotal,     // total phi angle
00044 //               G4int numZPlanes,     // number of z planes
00045 //               const G4double zPlane[],  // position of z planes
00046 //               const G4double rInner[],  // tangent distance to inner surface
00047 //               const G4double rOuter[])  // tangent distance to outer surface
00048 //
00049 //   G4Polycone( const G4String& name, 
00050 //               G4double phiStart,   // initial phi starting angle
00051 //               G4double phiTotal,   // total phi angle
00052 //               G4int    numRZ,      // number corners in r,z space
00053 //               const G4double r[],  // r coordinate of these corners
00054 //               const G4double z[])  // z coordinate of these corners
00055 
00056 // Author: 
00057 //   David C. Williams (davidw@scipp.ucsc.edu)
00058 // --------------------------------------------------------------------
00059 
00060 #ifndef G4Polycone_hh
00061 #define G4Polycone_hh
00062 
00063 #include "G4VCSGfaceted.hh"
00064 #include "G4PolyconeSide.hh"
00065 
00066 class G4EnclosingCylinder;
00067 class G4ReduciblePolygon;
00068 class G4VCSGface;
00069 class G4PolyconeHistorical
00070 {
00071   public:
00072     G4PolyconeHistorical();
00073     ~G4PolyconeHistorical();
00074     G4PolyconeHistorical( const G4PolyconeHistorical& source );
00075     G4PolyconeHistorical& operator=( const G4PolyconeHistorical& right );
00076 
00077     G4double Start_angle;
00078     G4double Opening_angle;
00079     G4int   Num_z_planes;
00080     G4double *Z_values;
00081     G4double *Rmin;
00082     G4double *Rmax;
00083 };
00084 
00085 class G4Polycone : public G4VCSGfaceted 
00086 {
00087 
00088  public:  // with description
00089 
00090   G4Polycone( const G4String& name, 
00091                     G4double phiStart,     // initial phi starting angle
00092                     G4double phiTotal,     // total phi angle
00093                     G4int numZPlanes,      // number of z planes
00094               const G4double zPlane[],     // position of z planes
00095               const G4double rInner[],     // tangent distance to inner surface
00096               const G4double rOuter[]  );  // tangent distance to outer surface
00097 
00098   G4Polycone( const G4String& name, 
00099                     G4double phiStart,    // initial phi starting angle
00100                     G4double phiTotal,    // total phi angle
00101                     G4int    numRZ,       // number corners in r,z space
00102               const G4double r[],         // r coordinate of these corners
00103               const G4double z[]       ); // z coordinate of these corners
00104 
00105   virtual ~G4Polycone();
00106   
00107   // Methods for solid
00108 
00109   EInside Inside( const G4ThreeVector &p ) const;
00110   G4double DistanceToIn( const G4ThreeVector &p, const G4ThreeVector &v ) const;
00111   G4double DistanceToIn( const G4ThreeVector &p ) const;
00112 
00113   G4ThreeVector GetPointOnSurface() const;
00114 
00115   void ComputeDimensions(       G4VPVParameterisation* p,
00116                           const G4int n,
00117                           const G4VPhysicalVolume* pRep );
00118 
00119   G4GeometryType GetEntityType() const;
00120 
00121   G4VSolid* Clone() const;
00122 
00123   std::ostream& StreamInfo(std::ostream& os) const;
00124 
00125   G4Polyhedron* CreatePolyhedron() const;
00126   G4NURBS*      CreateNURBS() const;
00127 
00128   G4bool Reset();
00129 
00130   // Accessors
00131 
00132   inline G4double GetStartPhi()  const;
00133   inline G4double GetEndPhi()    const;
00134   inline G4bool IsOpen()         const;
00135   inline G4bool IsGeneric()      const;
00136   inline G4int  GetNumRZCorner() const;
00137   inline G4PolyconeSideRZ GetCorner(G4int index) const;
00138   inline G4PolyconeHistorical* GetOriginalParameters() const;
00139   inline void SetOriginalParameters(G4PolyconeHistorical* pars);
00140 
00141  public:  // without description
00142 
00143   G4Polycone(__void__&);
00144     // Fake default constructor for usage restricted to direct object
00145     // persistency for clients requiring preallocation of memory for
00146     // persistifiable objects.
00147 
00148   G4Polycone( const G4Polycone &source );
00149   const G4Polycone &operator=( const G4Polycone &source );
00150     // Copy constructor and assignment operator.
00151 
00152  protected:  // without description
00153 
00154   // Generic initializer, called by all constructors
00155 
00156   inline void SetOriginalParameters();
00157 
00158   void Create( G4double phiStart,        // initial phi starting angle
00159                G4double phiTotal,        // total phi angle
00160                G4ReduciblePolygon *rz ); // r/z coordinate of these corners
00161 
00162   void CopyStuff( const G4Polycone &source );
00163 
00164   // Methods for random point generation
00165 
00166   G4ThreeVector GetPointOnCone(G4double fRmin1, G4double fRmax1,
00167                                G4double fRmin2, G4double fRmax2,
00168                                G4double zOne,   G4double zTwo,
00169                                G4double& totArea) const;
00170   
00171   G4ThreeVector GetPointOnTubs(G4double fRMin, G4double fRMax,
00172                                G4double zOne,  G4double zTwo,
00173                                G4double& totArea) const;
00174   
00175   G4ThreeVector GetPointOnCut(G4double fRMin1, G4double fRMax1,
00176                               G4double fRMin2, G4double fRMax2,
00177                               G4double zOne,   G4double zTwo,
00178                               G4double& totArea) const;
00179 
00180   G4ThreeVector GetPointOnRing(G4double fRMin, G4double fRMax,
00181                                G4double fRMin2, G4double fRMax2,
00182                                G4double zOne) const;
00183 
00184  protected:  // without description
00185 
00186   // Here are our parameters
00187 
00188   G4double startPhi;    // Starting phi value (0 < phiStart < 2pi)
00189   G4double endPhi;      // end phi value (0 < endPhi-phiStart < 2pi)
00190   G4bool   phiIsOpen;   // true if there is a phi segment
00191   G4bool   genericPcon; // true if created through the 2nd generic constructor
00192   G4int   numCorner;    // number RZ points
00193   G4PolyconeSideRZ *corners;  // corner r,z points
00194   G4PolyconeHistorical  *original_parameters;  // original input parameters
00195 
00196   // Our quick test
00197 
00198   G4EnclosingCylinder *enclosingCylinder;
00199   
00200 };
00201 
00202 #include "G4Polycone.icc"
00203 
00204 #endif

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