Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VCSGfaceted.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// G4VCSGfaceted
27//
28// Class description:
29//
30// Virtual class defining CSG-like type shape that is built entirely
31// of G4CSGface faces.
32
33// Author: David C. Williams ([email protected])
34// --------------------------------------------------------------------
35#ifndef G4VCSGFACETED_HH
36#define G4VCSGFACETED_HH
37
38#include "G4VSolid.hh"
39
40class G4VCSGface;
41class G4VisExtent;
42
43class G4VCSGfaceted : public G4VSolid
44{
45 public:
46
47 G4VCSGfaceted( const G4String& name );
48 virtual ~G4VCSGfaceted();
49
50 G4VCSGfaceted( const G4VCSGfaceted& source );
51 G4VCSGfaceted& operator=( const G4VCSGfaceted& source );
52
53 G4bool CalculateExtent( const EAxis pAxis,
54 const G4VoxelLimits& pVoxelLimit,
55 const G4AffineTransform& pTransform,
56 G4double& pmin, G4double& pmax) const override;
57
58 EInside Inside( const G4ThreeVector& p ) const override;
59
60 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const override;
61
63 const G4ThreeVector& v ) const override;
64 G4double DistanceToIn( const G4ThreeVector& p ) const override;
66 const G4ThreeVector& v,
67 const G4bool calcNorm = false,
68 G4bool* validNorm = nullptr,
69 G4ThreeVector* n = nullptr ) const override;
70 G4double DistanceToOut( const G4ThreeVector& p ) const override;
71
72 G4GeometryType GetEntityType() const override;
73
74 std::ostream& StreamInfo(std::ostream& os) const override;
75
76 G4Polyhedron* CreatePolyhedron() const override = 0;
77
78 void DescribeYourselfTo( G4VGraphicsScene& scene ) const override;
79
80 G4VisExtent GetExtent() const override;
81
82 G4Polyhedron* GetPolyhedron () const override;
83
90 void SetAreaStatistics(G4int st);
92
93 G4double GetCubicVolume() override;
94 // Returns an estimation of the geometrical cubic volume of the
95 // solid. Caches the computed value once computed the first time.
96 G4double GetSurfaceArea() override;
97 // Returns an estimation of the geometrical surface area of the
98 // solid. Caches the computed value once computed the first time.
99
100 G4VCSGfaceted(__void__&);
101 // Fake default constructor for usage restricted to direct object
102 // persistency for clients requiring preallocation of memory for
103 // persistifiable objects.
104
105 protected:
106
108 G4VCSGface **faces = nullptr;
111 mutable G4bool fRebuildPolyhedron = false;
112 mutable G4Polyhedron* fpPolyhedron = nullptr;
113
114 virtual G4double DistanceTo( const G4ThreeVector& p,
115 const G4bool outgoing ) const;
116
118 // Returns a random point located on the surface of the solid
119 // in case of generic Polycone or generic Polyhedra.
120
121 void CopyStuff( const G4VCSGfaceted& source );
122 void DeleteStuff();
123
124 private:
125
126 G4int fStatistics;
127 G4double fCubVolEpsilon;
128 G4double fAreaAccuracy;
129 // Statistics, error accuracy for volume estimation.
130};
131
132#endif
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
void CopyStuff(const G4VCSGfaceted &source)
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const override
G4double GetCubVolEpsilon() const
G4Polyhedron * GetPolyhedron() const override
G4VCSGfaceted & operator=(const G4VCSGfaceted &source)
G4double fCubicVolume
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const override
G4int GetCubVolStatistics() const
void SetAreaStatistics(G4int st)
EInside Inside(const G4ThreeVector &p) const override
G4double GetSurfaceArea() override
G4VisExtent GetExtent() const override
G4VCSGface ** faces
void SetAreaAccuracy(G4double ep)
void DescribeYourselfTo(G4VGraphicsScene &scene) const override
G4VCSGfaceted(const G4String &name)
G4Polyhedron * fpPolyhedron
G4bool fRebuildPolyhedron
G4Polyhedron * CreatePolyhedron() const override=0
G4double GetCubicVolume() override
G4int GetAreaStatistics() const
std::ostream & StreamInfo(std::ostream &os) const override
G4double GetAreaAccuracy() const
G4double fSurfaceArea
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const override
G4ThreeVector GetPointOnSurfaceGeneric() const
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const override
virtual G4double DistanceTo(const G4ThreeVector &p, const G4bool outgoing) const
void SetCubVolEpsilon(G4double ep)
void SetCubVolStatistics(G4int st)
G4GeometryType GetEntityType() const override
virtual ~G4VCSGfaceted()
EAxis
Definition geomdefs.hh:54
EInside
Definition geomdefs.hh:67