G4Ellipsoid.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: G4Ellipsoid.hh 67011 2013-01-29 16:17:41Z gcosmo $
00028 //
00029 //
00030 // --------------------------------------------------------------------
00031 // GEANT 4 class header file
00032 //
00033 // G4Ellipsoid
00034 //
00035 // Class description:
00036 //
00037 //   A G4Ellipsoid is an ellipsoidal solid, optionally cut at a given z.
00038 //
00039 //   Member Data:
00040 //
00041 //      xSemiAxis       semi-axis, x
00042 //      ySemiAxis       semi-axis, y
00043 //      zSemiAxis       semi-axis, z
00044 //      zBottomCut      lower cut plane level, z (solid lies above this plane)
00045 //      zTopCut         upper cut plane level, z (solid lies below this plane)
00046 
00047 // History:
00048 // -------
00049 // 10.11.1999  G.Horton-Smith (Caltech, USA) - First implementation
00050 // 10.02.2005  G.Guerrieri (INFN Genova, Italy) - Revision
00051 // --------------------------------------------------------------------
00052 #ifndef G4Ellipsoid_HH
00053 #define G4Ellipsoid_HH
00054 
00055 #include <CLHEP/Units/PhysicalConstants.h>
00056 
00057 #include "G4VSolid.hh"
00058 
00059 class G4Ellipsoid : public G4VSolid
00060 {
00061   public:  // with description
00062 
00063     G4Ellipsoid(const G4String& pName,
00064                       G4double  pxSemiAxis,
00065                       G4double  pySemiAxis,
00066                       G4double  pzSemiAxis,
00067                       G4double  pzBottomCut=0,
00068                       G4double  pzTopCut=0);
00069 
00070     virtual ~G4Ellipsoid();
00071 
00072     // Access functions
00073    
00074     inline G4double GetSemiAxisMax (G4int i) const;
00075     inline G4double GetZBottomCut() const;
00076     inline G4double GetZTopCut() const;
00077     inline void SetSemiAxis (G4double x, G4double y, G4double z);
00078     inline void SetZCuts (G4double newzBottomCut, G4double newzTopCut);
00079     inline G4double GetCubicVolume(); 
00080     inline G4double GetSurfaceArea(); 
00081 
00082     // Solid standard methods
00083    
00084     G4bool CalculateExtent(const EAxis pAxis,
00085                            const G4VoxelLimits& pVoxelLimit,
00086                            const G4AffineTransform& pTransform,
00087                                  G4double& pmin, G4double& pmax) const;
00088     EInside Inside(const G4ThreeVector& p) const;
00089     G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
00090     G4double DistanceToIn(const G4ThreeVector& p,
00091                           const G4ThreeVector& v) const;
00092     G4double DistanceToIn(const G4ThreeVector& p) const;
00093     G4double DistanceToOut(const G4ThreeVector& p,
00094                            const G4ThreeVector& v,
00095                            const G4bool calcNorm=G4bool(false),
00096                                  G4bool *validNorm=0,
00097                                  G4ThreeVector *n=0) const;
00098     G4double DistanceToOut(const G4ThreeVector& p) const;
00099 
00100     G4GeometryType GetEntityType() const;
00101 
00102     G4VSolid* Clone() const;
00103 
00104     std::ostream& StreamInfo(std::ostream& os) const;
00105 
00106     G4ThreeVector GetPointOnSurface() const;
00107 
00108     // Visualisation functions
00109   
00110     G4Polyhedron* GetPolyhedron () const;
00111     void DescribeYourselfTo(G4VGraphicsScene& scene) const;
00112     G4VisExtent   GetExtent() const;
00113     G4Polyhedron* CreatePolyhedron() const;
00114     G4NURBS*      CreateNURBS() const;
00115        
00116   public:  // without description
00117 
00118     G4Ellipsoid(__void__&);
00119       // Fake default constructor for usage restricted to direct object
00120       // persistency for clients requiring preallocation of memory for
00121       // persistifiable objects.
00122 
00123     G4Ellipsoid(const G4Ellipsoid& rhs);
00124     G4Ellipsoid& operator=(const G4Ellipsoid& rhs); 
00125       // Copy constructor and assignment operator.
00126 
00127   protected:  // without description
00128  
00129     G4ThreeVectorList* CreateRotatedVertices(const G4AffineTransform& pT,
00130                                                    G4int& noPV) const;
00131 
00132     mutable G4Polyhedron* fpPolyhedron;
00133 
00134   private:
00135 
00136     G4double kRadTolerance;
00137 
00138     G4double fCubicVolume;
00139     G4double fSurfaceArea;
00140     G4double xSemiAxis, ySemiAxis, zSemiAxis,
00141              semiAxisMax, zBottomCut, zTopCut;
00142 };
00143 
00144 #include "G4Ellipsoid.icc"
00145 
00146 #endif

Generated on Mon May 27 17:48:07 2013 for Geant4 by  doxygen 1.4.7