File indexing completed on 2025-01-18 09:57:59
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 G4BOOLEANSOLID_HH
0036 #define G4BOOLEANSOLID_HH
0037
0038 #include "G4DisplacedSolid.hh"
0039
0040 #include "G4ThreeVector.hh"
0041 #include "G4RotationMatrix.hh"
0042 #include "G4Transform3D.hh"
0043
0044 #include "G4VBooleanProcessor.hh"
0045
0046 class HepPolyhedronProcessor;
0047
0048
0049 class G4BooleanSolid : public G4VSolid
0050 {
0051 public:
0052
0053 G4BooleanSolid( const G4String& pName,
0054 G4VSolid* pSolidA ,
0055 G4VSolid* pSolidB );
0056
0057 G4BooleanSolid( const G4String& pName,
0058 G4VSolid* pSolidA ,
0059 G4VSolid* pSolidB,
0060 G4RotationMatrix* rotMatrix,
0061 const G4ThreeVector& transVector );
0062
0063 G4BooleanSolid( const G4String& pName,
0064 G4VSolid* pSolidA ,
0065 G4VSolid* pSolidB ,
0066 const G4Transform3D& transform );
0067
0068 ~G4BooleanSolid() override;
0069
0070 const G4VSolid* GetConstituentSolid(G4int no) const override;
0071 G4VSolid* GetConstituentSolid(G4int no) override;
0072
0073
0074
0075
0076 G4double GetCubicVolume() override;
0077 inline G4double GetSurfaceArea() override;
0078
0079 G4GeometryType GetEntityType() const override;
0080 G4Polyhedron* GetPolyhedron () const override;
0081
0082 std::ostream& StreamInfo(std::ostream& os) const override;
0083
0084 inline G4int GetCubVolStatistics() const;
0085 inline G4double GetCubVolEpsilon() const;
0086 inline void SetCubVolStatistics(G4int st);
0087 inline void SetCubVolEpsilon(G4double ep);
0088
0089 inline G4int GetAreaStatistics() const;
0090 inline G4double GetAreaAccuracy() const;
0091 inline void SetAreaStatistics(G4int st);
0092 inline void SetAreaAccuracy(G4double ep);
0093
0094 G4ThreeVector GetPointOnSurface() const override;
0095
0096 G4BooleanSolid(__void__&);
0097
0098
0099
0100
0101 G4BooleanSolid(const G4BooleanSolid& rhs);
0102 G4BooleanSolid& operator=(const G4BooleanSolid& rhs);
0103
0104
0105 static void SetExternalBooleanProcessor(G4VBooleanProcessor* extProcessor);
0106
0107 static G4VBooleanProcessor* GetExternalBooleanProcessor();
0108
0109
0110 protected:
0111
0112 void GetListOfPrimitives(std::vector<std::pair<G4VSolid *,G4Transform3D>>&,
0113 const G4Transform3D&) const;
0114
0115
0116 G4Polyhedron* StackPolyhedron(HepPolyhedronProcessor&,
0117 const G4VSolid*) const;
0118
0119
0120 protected:
0121
0122 G4VSolid* fPtrSolidA = nullptr;
0123 G4VSolid* fPtrSolidB = nullptr;
0124
0125 G4double fCubicVolume = -1.0;
0126
0127 G4double fSurfaceArea = -1.0;
0128
0129
0130 static G4VBooleanProcessor* fExternalBoolProcessor;
0131
0132
0133 private:
0134
0135 G4int fCubVolStatistics = 1000000;
0136 G4int fAreaStatistics = 1000000;
0137 G4double fCubVolEpsilon = 0.001;
0138 G4double fAreaAccuracy = -1;
0139
0140 mutable G4bool fRebuildPolyhedron = false;
0141 mutable G4Polyhedron* fpPolyhedron = nullptr;
0142
0143 mutable std::vector<std::pair<G4VSolid *,G4Transform3D>> fPrimitives;
0144 mutable G4double fPrimitivesSurfaceArea = 0.0;
0145
0146 G4bool createdDisplacedSolid = false;
0147
0148 };
0149
0150 #include "G4BooleanSolid.icc"
0151
0152 #endif