[831] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4BooleanSolid.hh,v 1.15 2006/10/19 15:34:49 gcosmo Exp $ |
---|
[850] | 28 | // GEANT4 tag $Name: HEAD $ |
---|
[831] | 29 | // |
---|
| 30 | // |
---|
| 31 | // class G4BooleanSolid |
---|
| 32 | // |
---|
| 33 | // Class description: |
---|
| 34 | // |
---|
| 35 | // Abstract base class for solids created by boolean operations |
---|
| 36 | // between other solids. |
---|
| 37 | |
---|
| 38 | // History: |
---|
| 39 | // |
---|
| 40 | // 10.09.98 V.Grichine, created |
---|
| 41 | // |
---|
| 42 | // -------------------------------------------------------------------- |
---|
| 43 | #ifndef G4BOOLEANSOLID_HH |
---|
| 44 | #define G4BOOLEANSOLID_HH |
---|
| 45 | |
---|
| 46 | #include "G4DisplacedSolid.hh" |
---|
| 47 | |
---|
| 48 | #include "G4ThreeVector.hh" |
---|
| 49 | #include "G4RotationMatrix.hh" |
---|
| 50 | #include "G4Transform3D.hh" |
---|
| 51 | |
---|
| 52 | class G4VSolid; |
---|
| 53 | |
---|
| 54 | class G4BooleanSolid : public G4VSolid |
---|
| 55 | { |
---|
| 56 | public: // with description |
---|
| 57 | |
---|
| 58 | G4BooleanSolid( const G4String& pName, |
---|
| 59 | G4VSolid* pSolidA , |
---|
| 60 | G4VSolid* pSolidB ); |
---|
| 61 | |
---|
| 62 | G4BooleanSolid( const G4String& pName, |
---|
| 63 | G4VSolid* pSolidA , |
---|
| 64 | G4VSolid* pSolidB, |
---|
| 65 | G4RotationMatrix* rotMatrix, |
---|
| 66 | const G4ThreeVector& transVector ); |
---|
| 67 | |
---|
| 68 | G4BooleanSolid( const G4String& pName, |
---|
| 69 | G4VSolid* pSolidA , |
---|
| 70 | G4VSolid* pSolidB , |
---|
| 71 | const G4Transform3D& transform ); |
---|
| 72 | |
---|
| 73 | virtual ~G4BooleanSolid(); |
---|
| 74 | |
---|
| 75 | virtual const G4VSolid* GetConstituentSolid(G4int no) const; |
---|
| 76 | virtual G4VSolid* GetConstituentSolid(G4int no); |
---|
| 77 | // If Solid is made up from a Boolean operation of two solids, |
---|
| 78 | // return the corresponding solid (for no=0 and 1). |
---|
| 79 | // If the solid is not a "Boolean", return 0. |
---|
| 80 | |
---|
| 81 | inline G4double GetCubicVolume(); |
---|
| 82 | inline G4double GetSurfaceArea(); |
---|
| 83 | |
---|
| 84 | virtual G4GeometryType GetEntityType() const; |
---|
| 85 | virtual G4Polyhedron* GetPolyhedron () const; |
---|
| 86 | |
---|
| 87 | std::ostream& StreamInfo(std::ostream& os) const; |
---|
| 88 | |
---|
| 89 | inline G4int GetCubVolStatistics() const; |
---|
| 90 | inline G4double GetCubVolEpsilon() const; |
---|
| 91 | inline void SetCubVolStatistics(G4int st); |
---|
| 92 | inline void SetCubVolEpsilon(G4double ep); |
---|
| 93 | |
---|
| 94 | inline G4int GetAreaStatistics() const; |
---|
| 95 | inline G4double GetAreaAccuracy() const; |
---|
| 96 | inline void SetAreaStatistics(G4int st); |
---|
| 97 | inline void SetAreaAccuracy(G4double ep); |
---|
| 98 | |
---|
| 99 | G4ThreeVector GetPointOnSurface() const; |
---|
| 100 | |
---|
| 101 | public: // without description |
---|
| 102 | |
---|
| 103 | G4BooleanSolid(__void__&); |
---|
| 104 | // Fake default constructor for usage restricted to direct object |
---|
| 105 | // persistency for clients requiring preallocation of memory for |
---|
| 106 | // persistifiable objects. |
---|
| 107 | |
---|
| 108 | protected: |
---|
| 109 | |
---|
| 110 | G4VSolid* fPtrSolidA; |
---|
| 111 | G4VSolid* fPtrSolidB; |
---|
| 112 | |
---|
| 113 | private: |
---|
| 114 | |
---|
| 115 | G4BooleanSolid(const G4BooleanSolid&); |
---|
| 116 | G4BooleanSolid& operator=(const G4BooleanSolid&); |
---|
| 117 | // Private copy constructor and assignment operator. |
---|
| 118 | |
---|
| 119 | private: |
---|
| 120 | |
---|
| 121 | G4int fStatistics; |
---|
| 122 | G4double fCubVolEpsilon; |
---|
| 123 | G4double fAreaAccuracy; |
---|
| 124 | G4double fCubicVolume; |
---|
| 125 | G4double fSurfaceArea; |
---|
| 126 | |
---|
| 127 | mutable G4Polyhedron* fpPolyhedron; |
---|
| 128 | |
---|
| 129 | G4bool createdDisplacedSolid; |
---|
| 130 | // If & only if this object created it, it must delete it |
---|
| 131 | |
---|
| 132 | } ; |
---|
| 133 | |
---|
| 134 | #include "G4BooleanSolid.icc" |
---|
| 135 | |
---|
| 136 | #endif |
---|