[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 | // |
---|
[850] | 27 | // $Id: G4VCSGfaceted.hh,v 1.17 2008/05/15 13:45:15 gcosmo Exp $ |
---|
[1337] | 28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
[831] | 29 | // |
---|
| 30 | // |
---|
| 31 | // -------------------------------------------------------------------- |
---|
| 32 | // GEANT 4 class header file |
---|
| 33 | // |
---|
| 34 | // |
---|
| 35 | // G4VCSGfaceted |
---|
| 36 | // |
---|
| 37 | // Class description: |
---|
| 38 | // |
---|
| 39 | // Virtual class defining CSG-like type shape that is built entire |
---|
| 40 | // of G4CSGface faces. |
---|
| 41 | |
---|
| 42 | // Author: |
---|
| 43 | // David C. Williams (davidw@scipp.ucsc.edu) |
---|
| 44 | // -------------------------------------------------------------------- |
---|
| 45 | |
---|
| 46 | #ifndef G4VCSGfaceted_hh |
---|
| 47 | #define G4VCSGfaceted_hh |
---|
| 48 | |
---|
| 49 | #include "G4VSolid.hh" |
---|
| 50 | |
---|
| 51 | class G4VCSGface; |
---|
| 52 | class G4VisExtent; |
---|
| 53 | |
---|
| 54 | class G4VCSGfaceted : public G4VSolid |
---|
| 55 | { |
---|
| 56 | public: // with description |
---|
| 57 | |
---|
| 58 | G4VCSGfaceted( const G4String& name ); |
---|
| 59 | virtual ~G4VCSGfaceted(); |
---|
| 60 | |
---|
| 61 | G4VCSGfaceted( const G4VCSGfaceted &source ); |
---|
| 62 | const G4VCSGfaceted &operator=( const G4VCSGfaceted &source ); |
---|
| 63 | |
---|
| 64 | virtual G4bool CalculateExtent( const EAxis pAxis, |
---|
| 65 | const G4VoxelLimits& pVoxelLimit, |
---|
| 66 | const G4AffineTransform& pTransform, |
---|
| 67 | G4double& pmin,G4double& pmax ) const; |
---|
| 68 | |
---|
| 69 | virtual EInside Inside( const G4ThreeVector& p ) const; |
---|
| 70 | |
---|
| 71 | virtual G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const; |
---|
| 72 | |
---|
| 73 | virtual G4double DistanceToIn( const G4ThreeVector& p, |
---|
| 74 | const G4ThreeVector& v ) const; |
---|
| 75 | virtual G4double DistanceToIn( const G4ThreeVector& p ) const; |
---|
| 76 | virtual G4double DistanceToOut( const G4ThreeVector& p, |
---|
| 77 | const G4ThreeVector& v, |
---|
| 78 | const G4bool calcNorm=false, |
---|
| 79 | G4bool *validNorm=0, |
---|
| 80 | G4ThreeVector *n=0 ) const; |
---|
| 81 | virtual G4double DistanceToOut( const G4ThreeVector& p ) const; |
---|
| 82 | |
---|
| 83 | virtual G4GeometryType GetEntityType() const; |
---|
| 84 | |
---|
| 85 | virtual std::ostream& StreamInfo(std::ostream& os) const; |
---|
| 86 | |
---|
| 87 | virtual G4Polyhedron* CreatePolyhedron() const = 0; |
---|
| 88 | |
---|
| 89 | virtual void DescribeYourselfTo( G4VGraphicsScene& scene ) const; |
---|
| 90 | |
---|
| 91 | virtual G4VisExtent GetExtent() const; |
---|
| 92 | |
---|
| 93 | virtual G4Polyhedron* GetPolyhedron () const; |
---|
| 94 | |
---|
| 95 | G4int GetCubVolStatistics() const; |
---|
| 96 | G4double GetCubVolEpsilon() const; |
---|
| 97 | void SetCubVolStatistics(G4int st); |
---|
| 98 | void SetCubVolEpsilon(G4double ep); |
---|
| 99 | G4int GetAreaStatistics() const; |
---|
| 100 | G4double GetAreaAccuracy() const; |
---|
| 101 | void SetAreaStatistics(G4int st); |
---|
| 102 | void SetAreaAccuracy(G4double ep); |
---|
| 103 | |
---|
| 104 | virtual G4double GetCubicVolume(); |
---|
| 105 | // Returns an estimation of the geometrical cubic volume of the |
---|
| 106 | // solid. Caches the computed value once computed the first time. |
---|
| 107 | virtual G4double GetSurfaceArea(); |
---|
| 108 | // Returns an estimation of the geometrical surface area of the |
---|
| 109 | // solid. Caches the computed value once computed the first time. |
---|
| 110 | |
---|
| 111 | public: // without description |
---|
| 112 | |
---|
| 113 | G4VCSGfaceted(__void__&); |
---|
| 114 | // Fake default constructor for usage restricted to direct object |
---|
| 115 | // persistency for clients requiring preallocation of memory for |
---|
| 116 | // persistifiable objects. |
---|
| 117 | |
---|
| 118 | protected: // without description |
---|
| 119 | |
---|
| 120 | G4int numFace; |
---|
| 121 | G4VCSGface **faces; |
---|
| 122 | G4double fCubicVolume; |
---|
| 123 | G4double fSurfaceArea; |
---|
| 124 | mutable G4Polyhedron* fpPolyhedron; |
---|
| 125 | |
---|
| 126 | virtual G4double DistanceTo( const G4ThreeVector &p, |
---|
| 127 | const G4bool outgoing ) const; |
---|
| 128 | |
---|
[850] | 129 | G4ThreeVector GetPointOnSurfaceGeneric()const; |
---|
| 130 | // Returns a random point located on the surface of the solid |
---|
| 131 | // in case of generic Polycone or generic Polyhedra. |
---|
| 132 | |
---|
[831] | 133 | void CopyStuff( const G4VCSGfaceted &source ); |
---|
| 134 | void DeleteStuff(); |
---|
| 135 | |
---|
| 136 | private: |
---|
| 137 | |
---|
| 138 | G4int fStatistics; |
---|
| 139 | G4double fCubVolEpsilon; |
---|
| 140 | G4double fAreaAccuracy; |
---|
| 141 | // Statistics, error accuracy for volume estimation. |
---|
| 142 | |
---|
| 143 | }; |
---|
| 144 | |
---|
| 145 | #endif |
---|