File indexing completed on 2025-01-18 09:59:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4VCSGFACETED_HH
0036 #define G4VCSGFACETED_HH
0037
0038 #include "G4VSolid.hh"
0039
0040 class G4VCSGface;
0041 class G4VisExtent;
0042
0043 class G4VCSGfaceted : public G4VSolid
0044 {
0045 public:
0046
0047 G4VCSGfaceted( const G4String& name );
0048 virtual ~G4VCSGfaceted();
0049
0050 G4VCSGfaceted( const G4VCSGfaceted& source );
0051 G4VCSGfaceted& operator=( const G4VCSGfaceted& source );
0052
0053 G4bool CalculateExtent( const EAxis pAxis,
0054 const G4VoxelLimits& pVoxelLimit,
0055 const G4AffineTransform& pTransform,
0056 G4double& pmin, G4double& pmax) const override;
0057
0058 EInside Inside( const G4ThreeVector& p ) const override;
0059
0060 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const override;
0061
0062 G4double DistanceToIn( const G4ThreeVector& p,
0063 const G4ThreeVector& v ) const override;
0064 G4double DistanceToIn( const G4ThreeVector& p ) const override;
0065 G4double DistanceToOut( const G4ThreeVector& p,
0066 const G4ThreeVector& v,
0067 const G4bool calcNorm = false,
0068 G4bool* validNorm = nullptr,
0069 G4ThreeVector* n = nullptr ) const override;
0070 G4double DistanceToOut( const G4ThreeVector& p ) const override;
0071
0072 G4GeometryType GetEntityType() const override;
0073
0074 std::ostream& StreamInfo(std::ostream& os) const override;
0075
0076 G4Polyhedron* CreatePolyhedron() const override = 0;
0077
0078 void DescribeYourselfTo( G4VGraphicsScene& scene ) const override;
0079
0080 G4VisExtent GetExtent() const override;
0081
0082 G4Polyhedron* GetPolyhedron () const override;
0083
0084 G4int GetCubVolStatistics() const;
0085 G4double GetCubVolEpsilon() const;
0086 void SetCubVolStatistics(G4int st);
0087 void SetCubVolEpsilon(G4double ep);
0088 G4int GetAreaStatistics() const;
0089 G4double GetAreaAccuracy() const;
0090 void SetAreaStatistics(G4int st);
0091 void SetAreaAccuracy(G4double ep);
0092
0093 G4double GetCubicVolume() override;
0094
0095
0096 G4double GetSurfaceArea() override;
0097
0098
0099
0100 G4VCSGfaceted(__void__&);
0101
0102
0103
0104
0105 protected:
0106
0107 G4int numFace = 0;
0108 G4VCSGface **faces = nullptr;
0109 G4double fCubicVolume = 0.0;
0110 G4double fSurfaceArea = 0.0;
0111 mutable G4bool fRebuildPolyhedron = false;
0112 mutable G4Polyhedron* fpPolyhedron = nullptr;
0113
0114 virtual G4double DistanceTo( const G4ThreeVector& p,
0115 const G4bool outgoing ) const;
0116
0117 G4ThreeVector GetPointOnSurfaceGeneric()const;
0118
0119
0120
0121 void CopyStuff( const G4VCSGfaceted& source );
0122 void DeleteStuff();
0123
0124 private:
0125
0126 G4int fStatistics;
0127 G4double fCubVolEpsilon;
0128 G4double fAreaAccuracy;
0129
0130 };
0131
0132 #endif