G4Orb.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: G4Orb.hh 69788 2013-05-15 12:06:57Z gcosmo $
00028 //
00029 //
00030 // --------------------------------------------------------------------
00031 // GEANT 4 class header file
00032 //
00033 // G4Orb
00034 //
00035 // Class description:
00036 //
00037 //   A G4Orb is a simple case of G4Sphere. It has only:
00038 //   fRmax  outer radius
00039 
00040 //  History:
00041 // 20.08.03 V.Grichine - created
00042 // --------------------------------------------------------------------
00043 
00044 #ifndef G4Orb_HH
00045 #define G4Orb_HH
00046 
00047 #include <CLHEP/Units/PhysicalConstants.h>
00048 
00049 #include "G4CSGSolid.hh"
00050 
00051 class G4Orb : public G4CSGSolid
00052 {
00053   public:  // with description
00054 
00055     G4Orb(const G4String& pName, G4double pRmax);
00056        
00057     virtual ~G4Orb() ;
00058     
00059     // Accessors
00060        
00061     inline G4double GetRadius() const;
00062 
00063     // Modifiers
00064 
00065     inline void SetRadius(G4double newRmax);
00066 
00067     // Methods for solid
00068 
00069     inline G4double GetCubicVolume();
00070     inline G4double GetSurfaceArea();
00071 
00072     void ComputeDimensions(      G4VPVParameterisation* p,
00073                            const G4int n,
00074                            const G4VPhysicalVolume* pRep);
00075 
00076     G4bool CalculateExtent(const EAxis pAxis,
00077                            const G4VoxelLimits& pVoxelLimit,
00078                            const G4AffineTransform& pTransform,
00079                                  G4double& pmin, G4double& pmax) const;
00080          
00081     EInside Inside(const G4ThreeVector& p) const;
00082 
00083     G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
00084 
00085     G4double DistanceToIn(const G4ThreeVector& p,
00086                           const G4ThreeVector& v) const;
00087     
00088     G4double DistanceToIn(const G4ThreeVector& p) const;
00089     
00090     G4double DistanceToOut(const G4ThreeVector& p,
00091                            const G4ThreeVector& v,
00092                            const G4bool calcNorm=G4bool(false),
00093                                  G4bool *validNorm=0,
00094                                  G4ThreeVector *n=0) const;
00095          
00096     G4double DistanceToOut(const G4ThreeVector& p) const;
00097 
00098     G4GeometryType GetEntityType() const;
00099  
00100     G4ThreeVector GetPointOnSurface() const;
00101 
00102     G4VSolid* Clone() const;
00103 
00104     std::ostream& StreamInfo(std::ostream& os) const;
00105 
00106     // Visualisation functions
00107   
00108     void          DescribeYourselfTo(G4VGraphicsScene& scene) const;
00109     G4Polyhedron* CreatePolyhedron() const;
00110     G4NURBS*      CreateNURBS() const;
00111 
00112   public:  // without description
00113 
00114     G4Orb(__void__&);
00115       // Fake default constructor for usage restricted to direct object
00116       // persistency for clients requiring preallocation of memory for
00117       // persistifiable objects.
00118 
00119     G4Orb(const G4Orb& rhs);
00120     G4Orb& operator=(const G4Orb& rhs); 
00121       // Copy constructor and assignment operator.
00122 
00123   protected:
00124   
00125     // Used by distanceToOut
00126   
00127     enum ESide {kNull,kRMax};
00128   
00129     // used by normal
00130   
00131     enum ENorm {kNRMax};
00132 
00133   private:
00134 
00135     G4double fRmax;
00136     G4double fRmaxTolerance;
00137 };
00138 
00139 #include "G4Orb.icc"
00140 
00141 #endif

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