|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4Voxelizer is a tool for generating the optimisation structure of tessellated surfaces and solids positioned in 3D space; it is used in G4TessellatedSolid and G4MultiUnion. More...
#include <G4Voxelizer.hh>
Public Member Functions | |
| G4Voxelizer () | |
| ~G4Voxelizer ()=default | |
| void | Voxelize (std::vector< G4VSolid * > &solids, std::vector< G4Transform3D > &transforms) |
| void | Voxelize (std::vector< G4VFacet * > &facets) |
| void | DisplayVoxelLimits () const |
| void | DisplayBoundaries () |
| void | DisplayListNodes () const |
| void | GetCandidatesVoxel (std::vector< G4int > &voxels) |
| G4int | GetCandidatesVoxelArray (const G4ThreeVector &point, std::vector< G4int > &list, G4SurfBits *crossed=nullptr) const |
| G4int | GetCandidatesVoxelArray (const std::vector< G4int > &voxels, const G4SurfBits bitmasks[], std::vector< G4int > &list, G4SurfBits *crossed=nullptr) const |
| G4int | GetCandidatesVoxelArray (const std::vector< G4int > &voxels, std::vector< G4int > &list, G4SurfBits *crossed=nullptr) const |
| const std::vector< G4VoxelBox > & | GetBoxes () const |
| const std::vector< G4double > & | GetBoundary (G4int index) const |
| G4bool | UpdateCurrentVoxel (const G4ThreeVector &point, const G4ThreeVector &direction, std::vector< G4int > &curVoxel) const |
| void | GetVoxel (std::vector< G4int > &curVoxel, const G4ThreeVector &point) const |
| G4int | GetBitsPerSlice () const |
| G4bool | Contains (const G4ThreeVector &point) const |
| G4double | DistanceToNext (const G4ThreeVector &point, const G4ThreeVector &direction, std::vector< G4int > &curVoxel) const |
| G4double | DistanceToFirst (const G4ThreeVector &point, const G4ThreeVector &direction) const |
| G4double | DistanceToBoundingBox (const G4ThreeVector &point) const |
| G4double | MinDistanceToBox (const G4ThreeVector &p, const G4ThreeVector &f) const |
| G4int | GetVoxelsIndex (G4int x, G4int y, G4int z) const |
| G4int | GetVoxelsIndex (const std::vector< G4int > &voxels) const |
| G4bool | GetPointVoxel (const G4ThreeVector &p, std::vector< G4int > &voxels) const |
| G4int | GetPointIndex (const G4ThreeVector &p) const |
| const G4SurfBits & | Empty () const |
| G4bool | IsEmpty (G4int index) const |
| void | SetMaxVoxels (G4int max) |
| void | SetMaxVoxels (const G4ThreeVector &reductionRatio) |
| G4int | GetMaxVoxels (G4ThreeVector &ratioOfReduction) |
| G4int | AllocatedMemory () |
| long long | GetCountOfVoxels () const |
| long long | CountVoxels (std::vector< G4double > boundaries[]) const |
| const std::vector< G4int > & | GetCandidates (std::vector< G4int > &curVoxel) const |
| G4int | GetVoxelBoxesSize () const |
| const G4VoxelBox & | GetVoxelBox (G4int i) const |
| const std::vector< G4int > & | GetVoxelBoxCandidates (G4int i) const |
| G4int | GetTotalCandidates () const |
Static Public Member Functions | |
| static void | SetDefaultVoxelsCount (G4int count) |
| static G4int | GetDefaultVoxelsCount () |
G4Voxelizer is a tool for generating the optimisation structure of tessellated surfaces and solids positioned in 3D space; it is used in G4TessellatedSolid and G4MultiUnion.
Definition at line 68 of file G4Voxelizer.hh.
| G4Voxelizer::G4Voxelizer | ( | ) |
Constructor and default Destructor.
Definition at line 51 of file G4Voxelizer.cc.
|
default |
| G4int G4Voxelizer::AllocatedMemory | ( | ) |
Logger returning the size of total allocated memory.
Definition at line 1253 of file G4Voxelizer.cc.
| G4bool G4Voxelizer::Contains | ( | const G4ThreeVector & | point | ) | const |
Returns true if 'point' is contained within boundaries.
Definition at line 1079 of file G4Voxelizer.cc.
|
inline |
Referenced by Voxelize().
| void G4Voxelizer::DisplayBoundaries | ( | ) |
Prints the positions of the boundaries of the slices on the three axes.
Definition at line 313 of file G4Voxelizer.cc.
Referenced by DisplayBoundaries().
| void G4Voxelizer::DisplayListNodes | ( | ) | const |
Prints which solids are present in the slices previously elaborated.
Definition at line 421 of file G4Voxelizer.cc.
| void G4Voxelizer::DisplayVoxelLimits | ( | ) | const |
Displays the dX, dY, dZ, pX, pY and pZ for each node.
Definition at line 191 of file G4Voxelizer.cc.
| G4double G4Voxelizer::DistanceToBoundingBox | ( | const G4ThreeVector & | point | ) | const |
Returns the minimum distance of 'point' to the bounding box.
Definition at line 1103 of file G4Voxelizer.cc.
| G4double G4Voxelizer::DistanceToFirst | ( | const G4ThreeVector & | point, |
| const G4ThreeVector & | direction ) const |
Returns the distance to first bounding box, given 'point' and 'direction'.
Definition at line 1093 of file G4Voxelizer.cc.
| G4double G4Voxelizer::DistanceToNext | ( | const G4ThreeVector & | point, |
| const G4ThreeVector & | direction, | ||
| std::vector< G4int > & | curVoxel ) const |
Returns the distance to next boundary, given 'point' and 'direction' and updates current voxel 'curVoxel', using the index corresponding to the closest voxel boundary on the ray.
Definition at line 1138 of file G4Voxelizer.cc.
|
inline |
Returns the empty bits container.
|
inline |
Returns memory size of a slice.
Returns the boundary vector, given an 'index'.
|
inline |
Returns the pointer to the array containing the characteristics of each box.
|
inline |
| void G4Voxelizer::GetCandidatesVoxel | ( | std::vector< G4int > & | voxels | ) |
Displays the nodes located in a voxel characterised by its three indexes.
Definition at line 838 of file G4Voxelizer.cc.
| G4int G4Voxelizer::GetCandidatesVoxelArray | ( | const G4ThreeVector & | point, |
| std::vector< G4int > & | list, | ||
| G4SurfBits * | crossed = nullptr ) const |
Methods returning in a vector container the nodes located in a voxel characterised by its three indexes.
Definition at line 918 of file G4Voxelizer.cc.
Referenced by GetCandidatesVoxel(), and GetCandidatesVoxelArray().
| G4int G4Voxelizer::GetCandidatesVoxelArray | ( | const std::vector< G4int > & | voxels, |
| const G4SurfBits | bitmasks[], | ||
| std::vector< G4int > & | list, | ||
| G4SurfBits * | crossed = nullptr ) const |
Definition at line 1005 of file G4Voxelizer.cc.
| G4int G4Voxelizer::GetCandidatesVoxelArray | ( | const std::vector< G4int > & | voxels, |
| std::vector< G4int > & | list, | ||
| G4SurfBits * | crossed = nullptr ) const |
Definition at line 1070 of file G4Voxelizer.cc.
|
inline |
Utility accessors/functions for voxels.
|
static |
Definition at line 1247 of file G4Voxelizer.cc.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Updates current voxel based on provided 'point'.
|
inline |
|
inline |
Accessors for voxels and points.
Returns true if empty bit in container, given an 'index'.
| G4double G4Voxelizer::MinDistanceToBox | ( | const G4ThreeVector & | p, |
| const G4ThreeVector & | f ) const |
Utility for estimating the isotropic safety from a point 'p' outside the current solid to any of its surfaces. The algorithm may be accurate or should provide a fast underestimate, based on safety point 'f'.
Definition at line 1112 of file G4Voxelizer.cc.
Referenced by DistanceToBoundingBox().
|
static |
Definition at line 1241 of file G4Voxelizer.cc.
| void G4Voxelizer::SetMaxVoxels | ( | const G4ThreeVector & | reductionRatio | ) |
Definition at line 1234 of file G4Voxelizer.cc.
| void G4Voxelizer::SetMaxVoxels | ( | G4int | max | ) |
Setters/getter for the maximum number of voxels.
Definition at line 1227 of file G4Voxelizer.cc.
Referenced by G4Voxelizer().
| G4bool G4Voxelizer::UpdateCurrentVoxel | ( | const G4ThreeVector & | point, |
| const G4ThreeVector & | direction, | ||
| std::vector< G4int > & | curVoxel ) const |
Utility method for checking/updating current voxel given in input.
Definition at line 1194 of file G4Voxelizer.cc.
| void G4Voxelizer::Voxelize | ( | std::vector< G4VFacet * > & | facets | ) |
Builds the voxelisation structure for facets forming a shape.
| [in] | facets | The list of facets. |
Definition at line 706 of file G4Voxelizer.cc.
| void G4Voxelizer::Voxelize | ( | std::vector< G4VSolid * > & | solids, |
| std::vector< G4Transform3D > & | transforms ) |
Builds the voxelisation structure for solids positioned in space.
| [in] | solids | The list of solids. |
| [in] | transforms | The associated transformation in space. |
Definition at line 649 of file G4Voxelizer.cc.