G4Paraboloid.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: G4Paraboloid.hh 67011 2013-01-29 16:17:41Z gcosmo $
00028 //
00029 //
00030 // --------------------------------------------------------------------
00031 // GEANT 4 class header file
00032 //
00033 // G4Paraboloid
00034 //
00035 // Class description:
00036 //
00037 //   A G4Paraboloid represents a solid with parabolic profile with possible
00038 //   cuts along the Z axis.
00039 //
00040 //   Member Data:
00041 //
00042 //      dz              z half lenght
00043 //      r1              radius at -dz
00044 //      r2              radius at  dz
00045 //      r2  > r1
00046 //
00047 //      Equation for the solid:
00048 //        rho^2 <= k1 * z + k2;
00049 //        -dz <= z <= dz
00050 //        r1^2 = k1 * (-dz) + k2
00051 //        r2^2 = k1 * ( dz) + k2
00052 
00053 // History:
00054 // -------
00055 // 10.07.2007  L.Lindroos (CERN) - First implementation
00056 // --------------------------------------------------------------------
00057 #ifndef G4Paraboloid_HH
00058 #define G4Paraboloid_HH
00059 
00060 #include <CLHEP/Units/PhysicalConstants.h>
00061 
00062 #include "G4VSolid.hh"
00063 
00064 class G4Paraboloid : public G4VSolid
00065 {
00066   public:  // with description
00067 
00068     G4Paraboloid(const G4String& pName,
00069                       G4double  pDz,
00070                       G4double  pR1,
00071                       G4double  pR2);
00072 
00073     virtual ~G4Paraboloid();
00074 
00075     // Access functions
00076 
00077     inline G4double GetZHalfLength() const;
00078     inline G4double GetRadiusMinusZ() const;
00079     inline G4double GetRadiusPlusZ() const;
00080 
00081     inline G4double GetCubicVolume();
00082     inline G4double GetSurfaceArea();
00083     inline G4double CalculateSurfaceArea() const;
00084 
00085     // Modifiers functions
00086 
00087     inline void SetZHalfLength(G4double dz);
00088     inline void SetRadiusMinusZ(G4double R1);
00089     inline void SetRadiusPlusZ(G4double R2);
00090 
00091     // Solid standard methods
00092 
00093     //void ComputeDimensions(       G4VPVParamerisation p,
00094     //                        const G4Int               n,
00095     //                        const G4VPhysicalVolume*  pRep );
00096     G4bool CalculateExtent(const EAxis pAxis,
00097                            const G4VoxelLimits& pVoxelLimit,
00098                            const G4AffineTransform& pTransform,
00099                                  G4double& pmin, G4double& pmax) const;
00100     EInside Inside(const G4ThreeVector& p) const;
00101     G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
00102     G4double DistanceToIn(const G4ThreeVector& p,
00103                           const G4ThreeVector& v) const;
00104     G4double DistanceToIn(const G4ThreeVector& p) const;
00105     G4double DistanceToOut(const G4ThreeVector& p,
00106                            const G4ThreeVector& v,
00107                            const G4bool calcNorm=G4bool(false),
00108                                  G4bool *validNorm=0,
00109                                  G4ThreeVector *n=0) const;
00110     G4double DistanceToOut(const G4ThreeVector& p) const;
00111 
00112     G4GeometryType GetEntityType() const;
00113 
00114     G4VSolid* Clone() const;
00115 
00116     std::ostream& StreamInfo(std::ostream& os) const;
00117 
00118     G4ThreeVector GetPointOnSurface() const;
00119 
00120     // Visualisation functions
00121 
00122     void DescribeYourselfTo(G4VGraphicsScene& scene) const;
00123     G4Polyhedron* CreatePolyhedron() const;
00124     G4Polyhedron* GetPolyhedron () const;
00125     G4NURBS*      CreateNURBS() const;
00126 
00127   public:  // without description
00128 
00129     G4Paraboloid(__void__&);
00130       // Fake default constructor for usage restricted to direct object
00131       // persistency for clients requiring preallocation of memory for
00132       // persistifiable objects.
00133 
00134     G4Paraboloid(const G4Paraboloid& rhs);
00135     G4Paraboloid& operator=(const G4Paraboloid& rhs); 
00136       // Copy constructor and assignment operator.
00137 
00138   protected:  // without description
00139  
00140     mutable G4Polyhedron* fpPolyhedron;
00141 
00142   private:
00143 
00144     G4ThreeVectorList*
00145       CreateRotatedVertices(const G4AffineTransform& pTransform,
00146                                          G4int& noPolygonVertices) const;
00147     // Making this mutable to allow GetPointOnSurface to have access to
00148     // area function.
00149     mutable G4double fSurfaceArea;
00150     G4double fCubicVolume;
00151 
00152     G4double dz, r1, r2;
00153     G4double k1, k2; 
00154     // Defined to make some calculations easier to follow
00155 };
00156 
00157 #include "G4Paraboloid.icc"
00158 
00159 #endif

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