G4VCSGfaceted.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: G4VCSGfaceted.hh 67011 2013-01-29 16:17:41Z gcosmo $
00028 //
00029 // 
00030 // --------------------------------------------------------------------
00031 // GEANT 4 class header file
00032 //
00033 //
00034 // G4VCSGfaceted
00035 //
00036 // Class description:
00037 //
00038 //   Virtual class defining CSG-like type shape that is built entire
00039 //   of G4CSGface faces.
00040 
00041 // Author:
00042 //   David C. Williams (davidw@scipp.ucsc.edu)
00043 // --------------------------------------------------------------------
00044 
00045 #ifndef G4VCSGfaceted_hh
00046 #define G4VCSGfaceted_hh
00047 
00048 #include "G4VSolid.hh"
00049 
00050 class G4VCSGface;
00051 class G4VisExtent;
00052 
00053 class G4VCSGfaceted : public G4VSolid 
00054 {
00055   public:  // with description
00056 
00057     G4VCSGfaceted( const G4String& name );
00058     virtual ~G4VCSGfaceted();
00059   
00060     G4VCSGfaceted( const G4VCSGfaceted &source );
00061     const G4VCSGfaceted &operator=( const G4VCSGfaceted &source );
00062   
00063     virtual G4bool CalculateExtent( const EAxis pAxis,
00064                                     const G4VoxelLimits& pVoxelLimit,
00065                                     const G4AffineTransform& pTransform,
00066                                           G4double& pmin,G4double& pmax ) const;
00067   
00068     virtual EInside Inside( const G4ThreeVector& p ) const;
00069 
00070     virtual G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const;
00071 
00072     virtual G4double DistanceToIn( const G4ThreeVector& p,
00073                                    const G4ThreeVector& v ) const;
00074     virtual G4double DistanceToIn( const G4ThreeVector& p ) const;
00075     virtual G4double DistanceToOut( const G4ThreeVector& p,
00076                                     const G4ThreeVector& v,
00077                                     const G4bool calcNorm=false,
00078                                           G4bool *validNorm=0,
00079                                           G4ThreeVector *n=0 ) const;
00080     virtual G4double DistanceToOut( const G4ThreeVector& p ) const;
00081 
00082     virtual G4GeometryType GetEntityType() const;
00083 
00084     virtual std::ostream& StreamInfo(std::ostream& os) const;
00085 
00086     virtual G4Polyhedron* CreatePolyhedron() const = 0;
00087 
00088     virtual void DescribeYourselfTo( G4VGraphicsScene& scene ) const;
00089 
00090     virtual G4VisExtent GetExtent() const;
00091 
00092     virtual G4Polyhedron* GetPolyhedron () const;
00093 
00094     G4int GetCubVolStatistics() const;
00095     G4double GetCubVolEpsilon() const;
00096     void SetCubVolStatistics(G4int st);
00097     void SetCubVolEpsilon(G4double ep);
00098     G4int GetAreaStatistics() const;
00099     G4double GetAreaAccuracy() const;
00100     void SetAreaStatistics(G4int st);
00101     void SetAreaAccuracy(G4double ep);
00102 
00103     virtual G4double GetCubicVolume();
00104       // Returns an estimation of the geometrical cubic volume of the
00105       // solid. Caches the computed value once computed the first time.
00106     virtual G4double GetSurfaceArea();
00107       // Returns an estimation of the geometrical surface area of the
00108       // solid. Caches the computed value once computed the first time.
00109 
00110   public:  // without description
00111 
00112     G4VCSGfaceted(__void__&);
00113       // Fake default constructor for usage restricted to direct object
00114       // persistency for clients requiring preallocation of memory for
00115       // persistifiable objects.
00116 
00117   protected:  // without description
00118 
00119     G4int    numFace;
00120     G4VCSGface **faces;
00121     G4double fCubicVolume;
00122     G4double fSurfaceArea;
00123     mutable G4Polyhedron* fpPolyhedron;
00124 
00125     virtual G4double DistanceTo( const G4ThreeVector &p,
00126                                  const G4bool outgoing ) const;
00127 
00128     G4ThreeVector GetPointOnSurfaceGeneric()const;
00129       // Returns a random point located on the surface of the solid 
00130       // in case of generic Polycone or generic Polyhedra.
00131 
00132     void CopyStuff( const G4VCSGfaceted &source );
00133     void DeleteStuff();
00134 
00135   private:
00136 
00137     G4int    fStatistics;
00138     G4double fCubVolEpsilon;
00139     G4double fAreaAccuracy;
00140       // Statistics, error accuracy for volume estimation.
00141 
00142 };
00143 
00144 #endif

Generated on Mon May 27 17:50:10 2013 for Geant4 by  doxygen 1.4.7