|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4DisplacedSolid is a solid that has been shifted from its original frame of reference to a new one. It is meant to be used internally only, for simplifying the implementation of "Boolean solids". More...
#include <G4DisplacedSolid.hh>
Protected Attributes | |
| G4VSolid * | fPtrSolid = nullptr |
| G4AffineTransform * | fPtrTransform = nullptr |
| G4AffineTransform * | fDirectTransform = nullptr |
| G4bool | fRebuildPolyhedron = false |
| G4Polyhedron * | fpPolyhedron = nullptr |
| Protected Attributes inherited from G4VSolid | |
| G4double | kCarTolerance |
Additional Inherited Members | |
| Protected Member Functions inherited from G4VSolid | |
| void | CalculateClippedPolygonExtent (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const |
| void | ClipCrossSection (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const |
| void | ClipBetweenSections (G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const |
| void | ClipPolygon (G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const |
G4DisplacedSolid is a solid that has been shifted from its original frame of reference to a new one. It is meant to be used internally only, for simplifying the implementation of "Boolean solids".
Definition at line 51 of file G4DisplacedSolid.hh.
| G4DisplacedSolid::G4DisplacedSolid | ( | const G4String & | pName, |
| G4VSolid * | pSolid, | ||
| G4RotationMatrix * | rotMatrix, | ||
| const G4ThreeVector & | transVector ) |
Constructor of a displaced solid rotation and translation vectors.
| [in] | pName | The name of the diplaced solid. |
| [in] | pSolid | Pointer to the original reference solid. |
| [in] | rotMatrix | Pointer to the rotation vector. |
| [in] | transVector | The translation vector. |
Definition at line 47 of file G4DisplacedSolid.cc.
Referenced by Clone(), G4DisplacedSolid(), GetDisplacedSolidPtr(), GetDisplacedSolidPtr(), and operator=().
| G4DisplacedSolid::G4DisplacedSolid | ( | const G4String & | pName, |
| G4VSolid * | pSolid, | ||
| const G4Transform3D & | transform ) |
Constructor of a displaced solid with a transformation.
| [in] | pName | The name of the displaced solid. |
| [in] | pSolid | Pointer to the original reference solid. |
| [in] | transform | The composed 3D transformation. |
Definition at line 72 of file G4DisplacedSolid.cc.
| G4DisplacedSolid::G4DisplacedSolid | ( | const G4String & | pName, |
| G4VSolid * | pSolid, | ||
| const G4AffineTransform | directTransform ) |
Constructor for use in instantiating a transient instance from a persistent one.
| [in] | pName | The name of the displaced solid. |
| [in] | pSolid | Pointer to the original reference solid. |
| [in] | directTransform | The internal transformation. |
Definition at line 99 of file G4DisplacedSolid.cc.
|
override |
Destructor. Deletes all cached transformations.
Definition at line 133 of file G4DisplacedSolid.cc.
| G4DisplacedSolid::G4DisplacedSolid | ( | __void__ & | a | ) |
Fake default constructor for usage restricted to direct object persistency for clients requiring preallocation of memory for persistifiable objects.
Definition at line 124 of file G4DisplacedSolid.cc.
| G4DisplacedSolid::G4DisplacedSolid | ( | const G4DisplacedSolid & | rhs | ) |
Copy constructor and assignment operator.
Definition at line 143 of file G4DisplacedSolid.cc.
|
overridevirtual |
Computes the bounding limits of the solid.
| [out] | pMin | The minimum bounding limit point. |
| [out] | pMax | The maximum bounding limit point. |
Reimplemented from G4VSolid.
Definition at line 286 of file G4DisplacedSolid.cc.
|
overridevirtual |
Calculates the minimum and maximum extent of the solid, when under the specified transform, and within the specified limits.
| [in] | pAxis | The axis along which compute the extent. |
| [in] | pVoxelLimit | The limiting space dictated by voxels. |
| [in] | pTransform | The internal transformation applied to the solid. |
| [out] | pMin | The minimum extent value. |
| [out] | pMax | The maximum extent value. |
Implements G4VSolid.
Definition at line 331 of file G4DisplacedSolid.cc.
| void G4DisplacedSolid::CleanTransformations | ( | ) |
Deletes cached transformations. Used in destructor.
Definition at line 176 of file G4DisplacedSolid.cc.
Referenced by ~G4DisplacedSolid().
|
overridevirtual |
Makes a clone of the object for use in multi-treading.
Reimplemented from G4VSolid.
Definition at line 499 of file G4DisplacedSolid.cc.
|
overridevirtual |
Throws an exception as paramterisations are not allowed for these solids.
Reimplemented from G4VSolid.
Definition at line 428 of file G4DisplacedSolid.cc.
|
overridevirtual |
Creates a Polyhedron used for Visualisation. It is the caller's responsibility to delete it. A null pointer means "not created".
Reimplemented from G4VSolid.
Definition at line 545 of file G4DisplacedSolid.cc.
Referenced by GetPolyhedron().
|
overridevirtual |
Methods for creating graphical representations (i.e. for visualisation).
Implements G4VSolid.
Definition at line 535 of file G4DisplacedSolid.cc.
|
overridevirtual |
Calculates the safety distance to the nearest surface of a shape from an outside point. The distance can be an underestimate.
Implements G4VSolid.
Definition at line 383 of file G4DisplacedSolid.cc.
|
overridevirtual |
Returns the distance along the normalised vector "v" to the shape, from the point at offset "p". If there is no intersection, return kInfinity. The first intersection resulting from leaving a surface/volume is discarded. Hence, it is tolerant of points on the surface of the shape.
Implements G4VSolid.
Definition at line 369 of file G4DisplacedSolid.cc.
|
overridevirtual |
Calculates the safety distance to the nearest surface of a shape from an inside point "p". The distance can be an underestimate.
Implements G4VSolid.
Definition at line 417 of file G4DisplacedSolid.cc.
|
overridevirtual |
Returns the distance along the normalised vector "v" to the shape, from a point at an offset "p" inside or on the surface of the shape. Intersections with surfaces, when the point is < Tolerance/2 from a surface must be ignored. Must be called as solid.DistanceToOut(p,v) or by specifying all the parameters.
| [in] | p | The reference point in space. |
| [in] | v | The normalised direction. |
| [in] | calcNorm | Flag to enable the normal computation or not. |
| [out] | validNorm | Set to true if the solid lies entirely behind or on the exiting surface (calcNorm must be true, otherwise it is unused). |
| [out] | n | The exiting outwards normal vector (undefined Magnitude). (calcNorm must be true, otherwise it is unused). |
Implements G4VSolid.
Definition at line 394 of file G4DisplacedSolid.cc.
| G4VSolid * G4DisplacedSolid::GetConstituentMovedSolid | ( | ) | const |
Returns a pointer to the original not displaced solid.
Definition at line 195 of file G4DisplacedSolid.cc.
Referenced by G4tgbGeometryDumper::DumpBooleanVolume(), and G4BooleanSolid::GetListOfPrimitives().
|
overridevirtual |
Methods returning an estimation of the solid volume (capacity) and surface area, in internal units.
Reimplemented from G4VSolid.
Definition at line 442 of file G4DisplacedSolid.cc.
| G4AffineTransform G4DisplacedSolid::GetDirectTransform | ( | ) | const |
Accessor/modifier for the associated internal transformation, as above.
Definition at line 216 of file G4DisplacedSolid.cc.
|
overridevirtual |
If the Solid is a "G4DisplacedSolid", return a self pointer else return nullptr.
Reimplemented from G4VSolid.
Definition at line 185 of file G4DisplacedSolid.cc.
|
overridevirtual |
Reimplemented from G4VSolid.
Definition at line 190 of file G4DisplacedSolid.cc.
|
overridevirtual |
Returns the type ID, "G4DisplacedSolid" of the solid.
Implements G4VSolid.
Definition at line 490 of file G4DisplacedSolid.cc.
Referenced by StreamInfo().
| G4RotationMatrix G4DisplacedSolid::GetFrameRotation | ( | ) | const |
Get/Set the rotation/translation, as applied to the frame of reference.
Definition at line 230 of file G4DisplacedSolid.cc.
| G4ThreeVector G4DisplacedSolid::GetFrameTranslation | ( | ) | const |
Definition at line 244 of file G4DisplacedSolid.cc.
|
overridevirtual |
Returns the number of constituents of the solid. For non-Boolean solids the return value is one.
Reimplemented from G4VSolid.
Definition at line 472 of file G4DisplacedSolid.cc.
| G4RotationMatrix G4DisplacedSolid::GetObjectRotation | ( | ) | const |
Get/Set the rotation/translation, as applied to the object.
Definition at line 257 of file G4DisplacedSolid.cc.
Referenced by CreatePolyhedron().
| G4ThreeVector G4DisplacedSolid::GetObjectTranslation | ( | ) | const |
Definition at line 271 of file G4DisplacedSolid.cc.
Referenced by CreatePolyhedron(), and G4tgbGeometryDumper::DumpBooleanVolume().
|
overridevirtual |
Returns a random point located on the surface of the solid. Points returned may not necessarily be uniformly distributed.
Reimplemented from G4VSolid.
Definition at line 462 of file G4DisplacedSolid.cc.
|
overridevirtual |
Smart access function - creates on request and stores for future access. A null pointer means "not available".
Reimplemented from G4VSolid.
Definition at line 567 of file G4DisplacedSolid.cc.
Referenced by G4MultiUnion::CreatePolyhedron().
|
overridevirtual |
Returns an estimation of the solid surface area in internal units. This method may be overloaded by derived classes to compute the exact geometrical quantity for solids where this is possible, or anyway to cache the computed value. Note: the computed value is NOT cached.
Reimplemented from G4VSolid.
Definition at line 451 of file G4DisplacedSolid.cc.
| G4AffineTransform G4DisplacedSolid::GetTransform | ( | ) | const |
Accessor/modifier for the associated internal transformation.
Definition at line 202 of file G4DisplacedSolid.cc.
Referenced by G4tgbGeometryDumper::DumpBooleanVolume().
|
overridevirtual |
Returns if the given point "p" is inside or not the solid.
Implements G4VSolid.
Definition at line 346 of file G4DisplacedSolid.cc.
|
overridevirtual |
Returns true if the solid has only planar faces, false otherwise.
Reimplemented from G4VSolid.
Definition at line 481 of file G4DisplacedSolid.cc.
| G4DisplacedSolid & G4DisplacedSolid::operator= | ( | const G4DisplacedSolid & | rhs | ) |
Definition at line 154 of file G4DisplacedSolid.cc.
| void G4DisplacedSolid::SetDirectTransform | ( | G4AffineTransform & | transform | ) |
Definition at line 222 of file G4DisplacedSolid.cc.
| void G4DisplacedSolid::SetFrameRotation | ( | const G4RotationMatrix & | matrix | ) |
Definition at line 236 of file G4DisplacedSolid.cc.
| void G4DisplacedSolid::SetFrameTranslation | ( | const G4ThreeVector & | vector | ) |
Definition at line 249 of file G4DisplacedSolid.cc.
| void G4DisplacedSolid::SetObjectRotation | ( | const G4RotationMatrix & | matrix | ) |
Definition at line 263 of file G4DisplacedSolid.cc.
| void G4DisplacedSolid::SetObjectTranslation | ( | const G4ThreeVector & | vector | ) |
Definition at line 276 of file G4DisplacedSolid.cc.
| void G4DisplacedSolid::SetTransform | ( | G4AffineTransform & | transform | ) |
Definition at line 208 of file G4DisplacedSolid.cc.
|
overridevirtual |
Streams the object contents to an output stream.
Implements G4VSolid.
Definition at line 508 of file G4DisplacedSolid.cc.
|
overridevirtual |
Returns the outwards pointing unit normal of the shape for the surface closest to the point at offset "p".
Implements G4VSolid.
Definition at line 357 of file G4DisplacedSolid.cc.
|
protected |
Definition at line 287 of file G4DisplacedSolid.hh.
Referenced by BoundingLimits(), CalculateExtent(), CleanTransformations(), DistanceToOut(), G4DisplacedSolid(), G4DisplacedSolid(), G4DisplacedSolid(), G4DisplacedSolid(), GetDirectTransform(), GetFrameRotation(), GetObjectTranslation(), GetPointOnSurface(), operator=(), SetDirectTransform(), SetFrameRotation(), SetObjectTranslation(), StreamInfo(), and SurfaceNormal().
|
mutableprotected |
Definition at line 289 of file G4DisplacedSolid.hh.
Referenced by GetPolyhedron(), operator=(), and ~G4DisplacedSolid().
|
protected |
Definition at line 285 of file G4DisplacedSolid.hh.
Referenced by BoundingLimits(), CalculateExtent(), CreatePolyhedron(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), G4DisplacedSolid(), GetConstituentMovedSolid(), GetCubicVolume(), GetNumOfConstituents(), GetPointOnSurface(), GetSurfaceArea(), Inside(), IsFaceted(), operator=(), StreamInfo(), and SurfaceNormal().
|
protected |
Definition at line 286 of file G4DisplacedSolid.hh.
Referenced by CleanTransformations(), DistanceToIn(), DistanceToIn(), DistanceToOut(), DistanceToOut(), G4DisplacedSolid(), G4DisplacedSolid(), G4DisplacedSolid(), G4DisplacedSolid(), GetFrameTranslation(), GetObjectRotation(), GetTransform(), Inside(), operator=(), SetFrameTranslation(), SetObjectRotation(), SetTransform(), and SurfaceNormal().
|
mutableprotected |
Definition at line 288 of file G4DisplacedSolid.hh.
Referenced by GetPolyhedron(), operator=(), SetDirectTransform(), SetFrameRotation(), SetFrameTranslation(), SetObjectRotation(), SetObjectTranslation(), and SetTransform().