G4BooleanSolid.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$
00028 //
00029 //
00030 // class G4BooleanSolid
00031 //
00032 // Class description:
00033 //
00034 // Abstract base class for solids created by boolean operations
00035 // between other solids.
00036 
00037 // History:
00038 //
00039 // 10.09.98 V.Grichine, created
00040 //
00041 // --------------------------------------------------------------------
00042 #ifndef G4BOOLEANSOLID_HH
00043 #define G4BOOLEANSOLID_HH
00044 
00045 #include "G4DisplacedSolid.hh"
00046 
00047 #include "G4ThreeVector.hh"
00048 #include "G4RotationMatrix.hh"
00049 #include "G4Transform3D.hh"
00050 
00051 class HepPolyhedronProcessor;
00052 
00053 class G4BooleanSolid : public G4VSolid
00054 {
00055   public:  // with description
00056  
00057     G4BooleanSolid( const G4String& pName,
00058                           G4VSolid* pSolidA ,
00059                           G4VSolid* pSolidB   );
00060 
00061     G4BooleanSolid( const G4String& pName,
00062                           G4VSolid* pSolidA ,
00063                           G4VSolid* pSolidB,
00064                           G4RotationMatrix* rotMatrix,
00065                     const G4ThreeVector& transVector    );
00066 
00067     G4BooleanSolid( const G4String& pName,
00068                           G4VSolid* pSolidA ,
00069                           G4VSolid* pSolidB , 
00070                     const G4Transform3D& transform   );
00071 
00072     virtual ~G4BooleanSolid();
00073 
00074     virtual const G4VSolid* GetConstituentSolid(G4int no) const;
00075     virtual       G4VSolid* GetConstituentSolid(G4int no);
00076       // If Solid is made up from a Boolean operation of two solids,
00077       // return the corresponding solid (for no=0 and 1).
00078       // If the solid is not a "Boolean", return 0.
00079 
00080     inline G4double GetCubicVolume();
00081     inline G4double GetSurfaceArea();
00082 
00083     virtual G4GeometryType  GetEntityType() const;
00084     virtual G4Polyhedron* GetPolyhedron () const;
00085 
00086     std::ostream& StreamInfo(std::ostream& os) const;
00087 
00088     inline G4int GetCubVolStatistics() const;
00089     inline G4double GetCubVolEpsilon() const;
00090     inline void SetCubVolStatistics(G4int st);
00091     inline void SetCubVolEpsilon(G4double ep);
00092 
00093     inline G4int GetAreaStatistics() const;
00094     inline G4double GetAreaAccuracy() const;
00095     inline void SetAreaStatistics(G4int st);
00096     inline void SetAreaAccuracy(G4double ep);
00097 
00098     G4ThreeVector GetPointOnSurface() const;
00099 
00100   public:  // without description
00101 
00102     G4BooleanSolid(__void__&);
00103       // Fake default constructor for usage restricted to direct object
00104       // persistency for clients requiring preallocation of memory for
00105       // persistifiable objects.
00106 
00107     G4BooleanSolid(const G4BooleanSolid& rhs);
00108     G4BooleanSolid& operator=(const G4BooleanSolid& rhs);
00109       // Copy constructor and assignment operator.
00110 
00111   protected:
00112   
00113     G4Polyhedron* StackPolyhedron(HepPolyhedronProcessor&,
00114                                   const G4VSolid*) const;
00115       // Stack polyhedra for processing. Return top polyhedron.
00116 
00117     inline G4double GetAreaRatio() const;
00118       // Ratio of surface areas of SolidA to total A+B
00119 
00120   protected:
00121   
00122     G4VSolid* fPtrSolidA;
00123     G4VSolid* fPtrSolidB;
00124 
00125     mutable G4double fAreaRatio; // Calculation deferred to GetPointOnSurface()
00126 
00127   private:
00128 
00129     G4int    fStatistics;
00130     G4double fCubVolEpsilon;
00131     G4double fAreaAccuracy;
00132     G4double fCubicVolume;
00133     G4double fSurfaceArea;
00134 
00135     mutable G4Polyhedron* fpPolyhedron;
00136 
00137     G4bool  createdDisplacedSolid;
00138       // If & only if this object created it, it must delete it
00139 
00140 } ;
00141 
00142 #include "G4BooleanSolid.icc"
00143 
00144 #endif

Generated on Mon May 27 17:47:46 2013 for Geant4 by  doxygen 1.4.7