Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ReflectedSolid.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// G4ReflectedSolid
27//
28// Class description:
29//
30// A Reflected solid is a solid that has been shifted from its original
31// frame of reference to a new reflected one.
32
33// Author: Vladimir Grichine (CERN), 23.07.2001 - Created
34// --------------------------------------------------------------------
35#ifndef G4ReflectedSolid_hh
36#define G4ReflectedSolid_hh
37
38#include "G4VSolid.hh"
39#include "G4ThreeVector.hh"
40#include "G4Transform3D.hh"
41
42/**
43 * @brief G4ReflectedSolid is a solid that has been shifted from its original
44 * frame of reference to a new reflected one.
45 */
46
48{
49 public:
50
51 /**
52 * Constructor for G4ReflectedSolid. For use in instantiating
53 * a transient instance.
54 * @param[in] pName The solid's name.
55 * @param[in] pSolid The original primitive being reflected.
56 * @param[in] transform The associated transformation.
57 */
58 G4ReflectedSolid( const G4String& pName,
59 G4VSolid* pSolid ,
60 const G4Transform3D& transform ) ;
61
62 /**
63 * Destructor.
64 */
65 ~G4ReflectedSolid() override;
66
67 // Includes all the methods that a solid requires.
68
69 /**
70 * Computes the bounding limits of the solid.
71 * @param[out] pMin The minimum bounding limit point.
72 * @param[out] pMax The maximum bounding limit point.
73 */
74 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
75
76 /**
77 * Calculates the minimum and maximum extent of the solid, when under the
78 * specified transform, and within the specified limits.
79 * @param[in] pAxis The axis along which compute the extent.
80 * @param[in] pVoxelLimit The limiting space dictated by voxels.
81 * @param[in] pTransform The internal transformation applied to the solid.
82 * @param[out] pMin The minimum extent value.
83 * @param[out] pMax The maximum extent value.
84 * @returns True if the solid is intersected by the extent region.
85 */
86 G4bool CalculateExtent( const EAxis pAxis,
87 const G4VoxelLimits& pVoxelLimit,
88 const G4AffineTransform& pTransform,
89 G4double& pMin, G4double& pMax) const override;
90
91 /**
92 * Concrete implementations of the expected query interfaces for
93 * solids, as defined in the base class G4VSolid.
94 */
95 EInside Inside( const G4ThreeVector& p ) const override;
96 G4ThreeVector SurfaceNormal( const G4ThreeVector& p ) const override;
98 const G4ThreeVector& v ) const override;
99 G4double DistanceToIn( const G4ThreeVector& p) const override;
101 const G4ThreeVector& v,
102 const G4bool calcNorm = false,
103 G4bool* validNorm = nullptr,
104 G4ThreeVector* n = nullptr ) const override;
105 G4double DistanceToOut( const G4ThreeVector& p ) const override;
106
107 /**
108 * Dispatch method for parameterisation replication mechanism and
109 * dimension computation.
110 */
112 const G4int n,
113 const G4VPhysicalVolume* pRep ) override;
114
115 /**
116 * Returning an estimation of the solid volume (capacity) and
117 * surface area, in internal units.
118 */
119 G4double GetCubicVolume() override;
120 G4double GetSurfaceArea() override;
121
122 /**
123 * Returns a random point located and uniformly distributed on the
124 * surface of the solid.
125 */
126 G4ThreeVector GetPointOnSurface() const override;
127
128 /**
129 * Returns the number of constituent solids (in case Boolean).
130 */
131 G4int GetNumOfConstituents() const override;
132
133 /**
134 * Returns true as the solid has only planar faces.
135 */
136 G4bool IsFaceted() const override;
137
138 /**
139 * Makes a clone of the object for use in multi-treading.
140 * @returns A pointer to the new cloned allocated solid.
141 */
142 G4VSolid* Clone() const override;
143
144 /**
145 * Returns a random point located and uniformly distributed on the
146 * surface of the solid.
147 */
148 G4GeometryType GetEntityType() const override;
149
150 /**
151 * If the Solid is a G4ReflectedSolid, return a self pointer else
152 * return nullptr.
153 */
154 virtual const G4ReflectedSolid* GetReflectedSolidPtr() const;
156
157 /**
158 * Returns a pointer to the original solid primitive.
159 */
161
162 /**
163 * Accessors and modifier for the transformation.
164 */
168
169 /**
170 * Streams the object contents to an output stream.
171 */
172 std::ostream& StreamInfo(std::ostream& os) const override;
173
174 /**
175 * Copy constructor and assignment operator.
176 */
179
180 /**
181 * Methods for creating graphical representations (i.e. for visualisation).
182 */
183 void DescribeYourselfTo(G4VGraphicsScene& scene) const override;
184 G4Polyhedron* CreatePolyhedron() const override;
185 G4Polyhedron* GetPolyhedron() const override;
186
187 protected:
188
189 G4VSolid* fPtrSolid = nullptr;
191
192 /** Caches for the reflected G4Polyhedron. */
193 mutable G4bool fRebuildPolyhedron = false;
194 mutable G4Polyhedron* fpPolyhedron = nullptr;
195};
196
197#endif
CLHEP::Hep3Vector G4ThreeVector
HepGeom::Transform3D G4Transform3D
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4String G4GeometryType
Definition G4VSolid.hh:70
G4AffineTransform is a class for geometric affine transformations. It supports efficient arbitrary ro...
G4VSolid * Clone() const override
G4GeometryType GetEntityType() const override
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const override
G4Transform3D GetDirectTransform3D() const
G4Polyhedron * fpPolyhedron
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const override
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const override
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const override
std::ostream & StreamInfo(std::ostream &os) const override
EInside Inside(const G4ThreeVector &p) const override
G4bool IsFaceted() const override
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const override
G4Polyhedron * CreatePolyhedron() const override
G4Polyhedron * GetPolyhedron() const override
void SetDirectTransform3D(G4Transform3D &)
void DescribeYourselfTo(G4VGraphicsScene &scene) const override
G4Transform3D GetTransform3D() const
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep) override
G4VSolid * GetConstituentMovedSolid() const
~G4ReflectedSolid() override
G4double GetCubicVolume() override
G4ReflectedSolid(const G4String &pName, G4VSolid *pSolid, const G4Transform3D &transform)
virtual const G4ReflectedSolid * GetReflectedSolidPtr() const
G4ReflectedSolid & operator=(const G4ReflectedSolid &rhs)
G4int GetNumOfConstituents() const override
G4ThreeVector GetPointOnSurface() const override
G4Transform3D * fDirectTransform3D
G4double GetSurfaceArea() override
G4VPVParameterisation ia an abstract base class for Parameterisation, able to compute the transformat...
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4VSolid(const G4String &name)
Definition G4VSolid.cc:59
G4VoxelLimits represents limitation/restrictions of space, where restrictions are only made perpendic...
EAxis
Definition geomdefs.hh:54
EInside
Definition geomdefs.hh:67