Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4BooleanSolid.hh
Go to the documentation of this file.
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// G4BooleanSolid
27//
28// Class description:
29//
30// Abstract base class for solids created by boolean operations
31// between other solids.
32
33// 10.09.98 V.Grichine - created
34// --------------------------------------------------------------------
35#ifndef G4BOOLEANSOLID_HH
36#define G4BOOLEANSOLID_HH
37
38#include "G4DisplacedSolid.hh"
39
40#include "G4ThreeVector.hh"
41#include "G4RotationMatrix.hh"
42#include "G4Transform3D.hh"
43
45
47
48
50{
51 public:
52
53 G4BooleanSolid( const G4String& pName,
54 G4VSolid* pSolidA ,
55 G4VSolid* pSolidB );
56
57 G4BooleanSolid( const G4String& pName,
58 G4VSolid* pSolidA ,
59 G4VSolid* pSolidB,
60 G4RotationMatrix* rotMatrix,
61 const G4ThreeVector& transVector );
62
63 G4BooleanSolid( const G4String& pName,
64 G4VSolid* pSolidA ,
65 G4VSolid* pSolidB ,
66 const G4Transform3D& transform );
67
68 ~G4BooleanSolid() override;
69
70 const G4VSolid* GetConstituentSolid(G4int no) const override;
72 // If Solid is made up from a Boolean operation of two solids,
73 // return the corresponding solid (for no=0 and 1).
74 // If the solid is not a "Boolean", return 0.
75
76 G4double GetCubicVolume() override;
77 inline G4double GetSurfaceArea() override;
78
79 G4GeometryType GetEntityType() const override;
80 G4Polyhedron* GetPolyhedron () const override;
81
82 std::ostream& StreamInfo(std::ostream& os) const override;
83
84 inline G4int GetCubVolStatistics() const;
85 inline G4double GetCubVolEpsilon() const;
86 inline void SetCubVolStatistics(G4int st);
87 inline void SetCubVolEpsilon(G4double ep);
88
89 inline G4int GetAreaStatistics() const;
90 inline G4double GetAreaAccuracy() const;
91 inline void SetAreaStatistics(G4int st);
92 inline void SetAreaAccuracy(G4double ep);
93
94 G4ThreeVector GetPointOnSurface() const override;
95
96 G4BooleanSolid(__void__&);
97 // Fake default constructor for usage restricted to direct object
98 // persistency for clients requiring preallocation of memory for
99 // persistifiable objects.
100
101 G4BooleanSolid(const G4BooleanSolid& rhs);
103 // Copy constructor and assignment operator.
104
105 static void SetExternalBooleanProcessor(G4VBooleanProcessor* extProcessor);
106 // Set Boolean processor to replace default processor.
108 // Get Boolean processor needed for G4MultiUnion.
109
110 protected:
111
112 void GetListOfPrimitives(std::vector<std::pair<G4VSolid *,G4Transform3D>>&,
113 const G4Transform3D&) const;
114 // Get list of constituent primitives of the solid and their placements.
115
117 const G4VSolid*) const;
118 // Stack polyhedra for processing. Return top polyhedron.
119
120 protected:
121
124
126 // Cached value of fCubicVolume
128 // Cached value of Surface Area
129
131 // External Boolean processor
132
133 private:
134
135 G4int fCubVolStatistics = 1000000;
136 G4int fAreaStatistics = 1000000;
137 G4double fCubVolEpsilon = 0.001;
138 G4double fAreaAccuracy = -1;
139
140 mutable G4bool fRebuildPolyhedron = false;
141 mutable G4Polyhedron* fpPolyhedron = nullptr;
142
143 mutable std::vector<std::pair<G4VSolid *,G4Transform3D>> fPrimitives;
144 mutable G4double fPrimitivesSurfaceArea = 0.0;
145
146 G4bool createdDisplacedSolid = false;
147 // If & only if this object created it, it must delete it
148};
149
150#include "G4BooleanSolid.icc"
151
152#endif
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4double GetSurfaceArea() override
G4VSolid * fPtrSolidA
G4BooleanSolid & operator=(const G4BooleanSolid &rhs)
void SetCubVolEpsilon(G4double ep)
void SetAreaStatistics(G4int st)
G4Polyhedron * GetPolyhedron() const override
G4VSolid * fPtrSolidB
G4double GetAreaAccuracy() const
const G4VSolid * GetConstituentSolid(G4int no) const override
~G4BooleanSolid() override
void GetListOfPrimitives(std::vector< std::pair< G4VSolid *, G4Transform3D > > &, const G4Transform3D &) const
G4double GetCubVolEpsilon() const
G4int GetAreaStatistics() const
G4double GetCubicVolume() override
G4GeometryType GetEntityType() const override
G4BooleanSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
G4int GetCubVolStatistics() const
static G4VBooleanProcessor * GetExternalBooleanProcessor()
static G4VBooleanProcessor * fExternalBoolProcessor
G4Polyhedron * StackPolyhedron(HepPolyhedronProcessor &, const G4VSolid *) const
std::ostream & StreamInfo(std::ostream &os) const override
void SetCubVolStatistics(G4int st)
void SetAreaAccuracy(G4double ep)
static void SetExternalBooleanProcessor(G4VBooleanProcessor *extProcessor)
G4ThreeVector GetPointOnSurface() const override