Geant4-11
|
#include <G4Voxelizer.hh>
Data Structures | |
class | G4VoxelComparator |
Public Member Functions | |
G4int | AllocatedMemory () |
G4bool | Contains (const G4ThreeVector &point) const |
long long | CountVoxels (std::vector< G4double > boundaries[]) const |
void | DisplayBoundaries () |
void | DisplayListNodes () const |
void | DisplayVoxelLimits () const |
G4double | DistanceToBoundingBox (const G4ThreeVector &point) const |
G4double | DistanceToFirst (const G4ThreeVector &point, const G4ThreeVector &direction) const |
G4double | DistanceToNext (const G4ThreeVector &point, const G4ThreeVector &direction, std::vector< G4int > &curVoxel) const |
const G4SurfBits & | Empty () const |
G4Voxelizer () | |
G4int | GetBitsPerSlice () const |
const std::vector< G4double > & | GetBoundary (G4int index) const |
const std::vector< G4VoxelBox > & | GetBoxes () const |
const std::vector< G4int > & | GetCandidates (std::vector< G4int > &curVoxel) 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 |
long long | GetCountOfVoxels () const |
G4int | GetMaxVoxels (G4ThreeVector &ratioOfReduction) |
G4int | GetPointIndex (const G4ThreeVector &p) const |
G4bool | GetPointVoxel (const G4ThreeVector &p, std::vector< G4int > &voxels) const |
G4int | GetTotalCandidates () const |
void | GetVoxel (std::vector< G4int > &curVoxel, const G4ThreeVector &point) const |
const G4VoxelBox & | GetVoxelBox (G4int i) const |
const std::vector< G4int > & | GetVoxelBoxCandidates (G4int i) const |
G4int | GetVoxelBoxesSize () const |
G4int | GetVoxelsIndex (const std::vector< G4int > &voxels) const |
G4int | GetVoxelsIndex (G4int x, G4int y, G4int z) const |
G4bool | IsEmpty (G4int index) const |
void | SetMaxVoxels (const G4ThreeVector &reductionRatio) |
void | SetMaxVoxels (G4int max) |
G4bool | UpdateCurrentVoxel (const G4ThreeVector &point, const G4ThreeVector &direction, std::vector< G4int > &curVoxel) const |
void | Voxelize (std::vector< G4VFacet * > &facets) |
void | Voxelize (std::vector< G4VSolid * > &solids, std::vector< G4Transform3D > &transforms) |
~G4Voxelizer () | |
Static Public Member Functions | |
template<typename T > | |
static G4int | BinarySearch (const std::vector< T > &vec, T value) |
static G4int | GetDefaultVoxelsCount () |
static G4double | MinDistanceToBox (const G4ThreeVector &aPoint, const G4ThreeVector &f) |
static void | SetDefaultVoxelsCount (G4int count) |
Static Private Member Functions | |
static void | FindComponentsFastest (unsigned int mask, std::vector< G4int > &list, G4int i) |
Private Attributes | |
G4SurfBits | fBitmasks [3] |
std::vector< G4double > | fBoundaries [3] |
G4Box | fBoundingBox |
G4ThreeVector | fBoundingBoxCenter |
G4ThreeVector | fBoundingBoxSize |
std::vector< G4VoxelBox > | fBoxes |
std::map< G4int, std::vector< G4int > > | fCandidates |
std::vector< G4int > | fCandidatesCounts [3] |
long long | fCountOfVoxels |
G4SurfBits | fEmpty |
G4int | fMaxVoxels |
const std::vector< G4int > | fNoCandidates |
G4int | fNPerSlice |
G4ThreeVector | fReductionRatio |
G4double | fTolerance |
G4int | fTotalCandidates |
std::vector< G4VoxelBox > | fVoxelBoxes |
std::vector< std::vector< G4int > > | fVoxelBoxesCandidates |
Static Private Attributes | |
static G4ThreadLocal G4int | fDefaultVoxelsCount = -1 |
Definition at line 62 of file G4Voxelizer.hh.
G4Voxelizer::G4Voxelizer | ( | ) |
Definition at line 55 of file G4Voxelizer.cc.
References G4SolidStore::DeRegister(), fBoundingBox, fCountOfVoxels, fDefaultVoxelsCount, fNPerSlice, fTolerance, fTotalCandidates, G4SolidStore::GetInstance(), G4GeometryTolerance::GetInstance(), G4GeometryTolerance::GetSurfaceTolerance(), and SetMaxVoxels().
G4Voxelizer::~G4Voxelizer | ( | ) |
Definition at line 68 of file G4Voxelizer.cc.
G4int G4Voxelizer::AllocatedMemory | ( | ) |
Definition at line 1360 of file G4Voxelizer.cc.
References fBitmasks, fBoundaries, fBoxes, fCandidates, fCandidatesCounts, fEmpty, and G4SurfBits::GetNbytes().
Referenced by G4TessellatedSolid::AllocatedMemory().
|
inlinestatic |
Referenced by BuildBitmasks(), GetCandidatesVoxelArray(), and UpdateCurrentVoxel().
|
private |
Definition at line 351 of file G4Voxelizer.cc.
References BinarySearch(), G4SurfBits::Clear(), fBoxes, fCandidatesCounts, G4cout, G4endl, GetBitsPerSlice(), G4INCL::Math::max(), G4INCL::Math::min(), G4SurfBits::SetBitNumber(), and G4INCL::CrossSections::total().
Referenced by Voxelize().
|
private |
Definition at line 244 of file G4Voxelizer.cc.
References CreateSortedBoundary(), fBoundaries, fBoxes, fTolerance, G4cout, G4endl, G4INCL::Math::max(), and CLHEP::detail::n.
Referenced by Voxelize().
|
private |
Definition at line 456 of file G4Voxelizer.cc.
References BuildBoundingBox(), fBoundaries, G4INCL::Math::max(), and G4INCL::Math::min().
Referenced by BuildBoundingBox(), and Voxelize().
|
private |
Definition at line 468 of file G4Voxelizer.cc.
References amax, amin, fBoundingBox, fBoundingBoxCenter, fBoundingBoxSize, G4INCL::Math::max(), G4INCL::Math::min(), G4Box::SetXHalfLength(), G4Box::SetYHalfLength(), G4Box::SetZHalfLength(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().
|
private |
Definition at line 73 of file G4Voxelizer.cc.
References G4SurfBits::Clear(), anonymous_namespace{G4MTcoutDestination.cc}::empty, fBoundaries, fCandidates, fEmpty, fTotalCandidates, G4cout, G4endl, GetCandidatesVoxelArray(), GetVoxelsIndex(), G4INCL::Math::max(), G4SurfBits::ResetAllBits(), G4SurfBits::ResetBitNumber(), and G4SurfBits::SetBitNumber().
Referenced by Voxelize().
|
private |
Definition at line 515 of file G4Voxelizer.cc.
References G4VoxelInfo::count, fCandidatesCounts, G4INCL::Math::max(), G4VoxelInfo::next, pos, and G4VoxelInfo::previous.
Referenced by Voxelize().
|
private |
Definition at line 670 of file G4Voxelizer.cc.
References fCandidatesCounts, G4INCL::Math::max(), and G4INCL::CrossSections::total().
Referenced by Voxelize().
|
private |
Definition at line 164 of file G4Voxelizer.cc.
References G4VFacet::Extent(), fBoxes, fNPerSlice, fTolerance, fTotalCandidates, G4INCL::Math::max(), and G4INCL::Math::min().
|
private |
Definition at line 116 of file G4Voxelizer.cc.
References G4VSolid::BoundingLimits(), fBoxes, fNPerSlice, fTolerance, fTotalCandidates, G4VSolid::GetEntityType(), G4Orb::GetRadialTolerance(), G4INCL::Math::max(), G4INCL::Math::min(), CLHEP::Hep3Vector::set(), G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}::transform(), and TransformLimits().
Referenced by Voxelize().
G4bool G4Voxelizer::Contains | ( | const G4ThreeVector & | point | ) | const |
Definition at line 1161 of file G4Voxelizer.cc.
References fBoundaries.
Referenced by G4TessellatedSolid::DistanceToOutCore().
|
inline |
Referenced by Voxelize().
|
private |
Definition at line 731 of file G4Voxelizer.cc.
References fVoxelBoxes, fVoxelBoxesCandidates, GetCandidatesVoxelArray(), G4VoxelBox::hlen, and G4VoxelBox::pos.
Referenced by Voxelize().
|
private |
Definition at line 214 of file G4Voxelizer.cc.
References fBoxes, G4cout, and G4endl.
Referenced by BuildBoundaries().
void G4Voxelizer::DisplayBoundaries | ( | ) |
Definition at line 324 of file G4Voxelizer.cc.
References DisplayBoundaries(), fBoundaries, G4cout, and G4endl.
Referenced by DisplayBoundaries().
|
private |
Definition at line 335 of file G4Voxelizer.cc.
void G4Voxelizer::DisplayListNodes | ( | ) | const |
Definition at line 431 of file G4Voxelizer.cc.
References fBitmasks, fBoundaries, fNPerSlice, G4cout, G4endl, GetCandidatesAsString(), and G4SurfBits::set().
void G4Voxelizer::DisplayVoxelLimits | ( | ) | const |
Definition at line 197 of file G4Voxelizer.cc.
G4double G4Voxelizer::DistanceToBoundingBox | ( | const G4ThreeVector & | point | ) | const |
Definition at line 1183 of file G4Voxelizer.cc.
References fBoundingBoxCenter, fBoundingBoxSize, and MinDistanceToBox().
Referenced by G4MultiUnion::DistanceToIn(), and G4TessellatedSolid::SafetyFromOutside().
G4double G4Voxelizer::DistanceToFirst | ( | const G4ThreeVector & | point, |
const G4ThreeVector & | direction | ||
) | const |
Definition at line 1173 of file G4Voxelizer.cc.
References G4Box::DistanceToIn(), fBoundingBox, and fBoundingBoxCenter.
Referenced by G4MultiUnion::DistanceToIn(), and G4TessellatedSolid::DistanceToInCore().
G4double G4Voxelizer::DistanceToNext | ( | const G4ThreeVector & | point, |
const G4ThreeVector & | direction, | ||
std::vector< G4int > & | curVoxel | ||
) | const |
Definition at line 1218 of file G4Voxelizer.cc.
References fBoundaries, and kInfinity.
Referenced by G4MultiUnion::DistanceToIn(), G4TessellatedSolid::DistanceToInCore(), G4TessellatedSolid::DistanceToOutCore(), and G4TessellatedSolid::InsideVoxels().
|
inline |
Referenced by G4TessellatedSolid::Voxelize().
|
staticprivate |
Definition at line 911 of file G4Voxelizer.cc.
Referenced by GetCandidatesVoxelArray().
|
inline |
Referenced by BuildBitmasks(), G4MultiUnion::DistanceToIn(), and G4MultiUnion::DistanceToOutVoxels().
Referenced by G4TessellatedSolid::PrecalculateInsides().
|
inline |
Referenced by G4MultiUnion::DistanceToIn(), and G4MultiUnion::SafetyFromOutsideNumberNode().
|
private |
Definition at line 416 of file G4Voxelizer.cc.
References fBoxes, and G4SurfBits::TestBitNumber().
Referenced by DisplayListNodes().
void G4Voxelizer::GetCandidatesVoxel | ( | std::vector< G4int > & | voxels | ) |
Definition at line 896 of file G4Voxelizer.cc.
References G4cout, G4endl, and GetCandidatesVoxelArray().
G4int G4Voxelizer::GetCandidatesVoxelArray | ( | const G4ThreeVector & | point, |
std::vector< G4int > & | list, | ||
G4SurfBits * | crossed = nullptr |
||
) | const |
Definition at line 973 of file G4Voxelizer.cc.
References BinarySearch(), G4SurfBits::fAllBits, fBitmasks, fBoundaries, FindComponentsFastest(), fNPerSlice, fTotalCandidates, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().
Referenced by BuildEmpty(), CreateMiniVoxels(), G4MultiUnion::DistanceToIn(), G4MultiUnion::DistanceToOut(), G4MultiUnion::DistanceToOutVoxels(), GetCandidatesVoxel(), GetCandidatesVoxelArray(), G4MultiUnion::InsideWithExclusion(), and G4MultiUnion::SurfaceNormal().
G4int G4Voxelizer::GetCandidatesVoxelArray | ( | const std::vector< G4int > & | voxels, |
const G4SurfBits | bitmasks[], | ||
std::vector< G4int > & | list, | ||
G4SurfBits * | crossed = nullptr |
||
) | const |
Definition at line 1094 of file G4Voxelizer.cc.
References G4SurfBits::fAllBits, FindComponentsFastest(), fNPerSlice, and fTotalCandidates.
G4int G4Voxelizer::GetCandidatesVoxelArray | ( | const std::vector< G4int > & | voxels, |
std::vector< G4int > & | list, | ||
G4SurfBits * | crossed = nullptr |
||
) | const |
Definition at line 1152 of file G4Voxelizer.cc.
References fBitmasks, and GetCandidatesVoxelArray().
|
inline |
|
static |
Definition at line 1354 of file G4Voxelizer.cc.
References fDefaultVoxelsCount.
|
inlineprivate |
Referenced by TransformLimits().
|
inline |
Referenced by G4TessellatedSolid::CopyObjects().
|
inline |
Referenced by G4TessellatedSolid::InsideVoxels(), and G4TessellatedSolid::SafetyFromOutside().
|
inline |
|
inline |
|
inline |
|
inline |
Referenced by G4TessellatedSolid::MinDistanceFacet().
Referenced by G4TessellatedSolid::MinDistanceFacet().
|
inline |
Referenced by G4TessellatedSolid::MinDistanceFacet().
Referenced by G4TessellatedSolid::PrecalculateInsides(), and G4TessellatedSolid::SetAllUsingStack().
|
static |
Definition at line 1192 of file G4Voxelizer.cc.
References CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().
Referenced by DistanceToBoundingBox(), and G4TessellatedSolid::MinDistanceFacet().
|
static |
Definition at line 1348 of file G4Voxelizer.cc.
References fDefaultVoxelsCount.
void G4Voxelizer::SetMaxVoxels | ( | const G4ThreeVector & | reductionRatio | ) |
Definition at line 1341 of file G4Voxelizer.cc.
References fMaxVoxels, and fReductionRatio.
void G4Voxelizer::SetMaxVoxels | ( | G4int | max | ) |
Definition at line 1334 of file G4Voxelizer.cc.
References fMaxVoxels, fReductionRatio, G4INCL::Math::max(), and CLHEP::Hep3Vector::set().
Referenced by G4TessellatedSolid::CopyObjects(), G4Voxelizer(), and G4TessellatedSolid::SetMaxVoxels().
|
private |
Definition at line 499 of file G4Voxelizer.cc.
References fCandidatesCounts, and CLHEP::Hep3Vector::set().
Referenced by Voxelize().
|
private |
Definition at line 930 of file G4Voxelizer.cc.
References GetGlobalPoint(), kInfinity, G4INCL::Math::max(), G4INCL::Math::min(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().
Referenced by BuildVoxelLimits().
G4bool G4Voxelizer::UpdateCurrentVoxel | ( | const G4ThreeVector & | point, |
const G4ThreeVector & | direction, | ||
std::vector< G4int > & | curVoxel | ||
) | const |
Definition at line 1303 of file G4Voxelizer.cc.
References BinarySearch(), and fBoundaries.
Referenced by G4TessellatedSolid::DistanceToInCore(), G4TessellatedSolid::DistanceToOutCore(), and G4TessellatedSolid::InsideVoxels().
void G4Voxelizer::Voxelize | ( | std::vector< G4VFacet * > & | facets | ) |
Definition at line 767 of file G4Voxelizer.cc.
References BuildBitmasks(), BuildBoundaries(), BuildBoundingBox(), BuildEmpty(), BuildReduceVoxels(), BuildReduceVoxels2(), BuildVoxelLimits(), G4SurfBits::Clear(), CountVoxels(), CreateMiniVoxels(), fBitmasks, fBoundaries, fBoxes, fCandidatesCounts, fCountOfVoxels, fMaxVoxels, fReductionRatio, fTotalCandidates, G4cout, G4endl, SetReductionRatio(), and G4INCL::CrossSections::total().
void G4Voxelizer::Voxelize | ( | std::vector< G4VSolid * > & | solids, |
std::vector< G4Transform3D > & | transforms | ||
) |
Definition at line 713 of file G4Voxelizer.cc.
References BuildBitmasks(), BuildBoundaries(), BuildBoundingBox(), BuildEmpty(), BuildVoxelLimits(), fBitmasks, fBoundaries, and fCandidatesCounts.
Referenced by G4MultiUnion::Voxelize(), and G4TessellatedSolid::Voxelize().
|
private |
Definition at line 244 of file G4Voxelizer.hh.
Referenced by AllocatedMemory(), DisplayListNodes(), GetCandidatesVoxelArray(), and Voxelize().
|
private |
Definition at line 237 of file G4Voxelizer.hh.
Referenced by AllocatedMemory(), BuildBoundaries(), BuildBoundingBox(), BuildEmpty(), Contains(), DisplayBoundaries(), DisplayListNodes(), DistanceToNext(), GetCandidatesVoxelArray(), UpdateCurrentVoxel(), and Voxelize().
|
private |
Definition at line 248 of file G4Voxelizer.hh.
Referenced by BuildBoundingBox(), DistanceToFirst(), and G4Voxelizer().
|
private |
Definition at line 246 of file G4Voxelizer.hh.
Referenced by BuildBoundingBox(), DistanceToBoundingBox(), and DistanceToFirst().
|
private |
Definition at line 250 of file G4Voxelizer.hh.
Referenced by BuildBoundingBox(), and DistanceToBoundingBox().
|
private |
Definition at line 234 of file G4Voxelizer.hh.
Referenced by AllocatedMemory(), BuildBitmasks(), BuildBoundaries(), BuildVoxelLimits(), CreateSortedBoundary(), DisplayVoxelLimits(), GetCandidatesAsString(), and Voxelize().
Definition at line 226 of file G4Voxelizer.hh.
Referenced by AllocatedMemory(), and BuildEmpty().
|
private |
Definition at line 240 of file G4Voxelizer.hh.
Referenced by AllocatedMemory(), BuildBitmasks(), BuildReduceVoxels(), BuildReduceVoxels2(), SetReductionRatio(), and Voxelize().
|
private |
Definition at line 230 of file G4Voxelizer.hh.
Referenced by G4Voxelizer(), and Voxelize().
|
staticprivate |
Definition at line 222 of file G4Voxelizer.hh.
Referenced by G4Voxelizer(), GetDefaultVoxelsCount(), and SetDefaultVoxelsCount().
|
private |
Definition at line 258 of file G4Voxelizer.hh.
Referenced by AllocatedMemory(), and BuildEmpty().
|
private |
Definition at line 254 of file G4Voxelizer.hh.
Referenced by SetMaxVoxels(), and Voxelize().
|
private |
Definition at line 228 of file G4Voxelizer.hh.
|
private |
Definition at line 232 of file G4Voxelizer.hh.
Referenced by BuildVoxelLimits(), DisplayListNodes(), G4Voxelizer(), and GetCandidatesVoxelArray().
|
private |
Definition at line 252 of file G4Voxelizer.hh.
Referenced by SetMaxVoxels(), and Voxelize().
|
private |
Definition at line 256 of file G4Voxelizer.hh.
Referenced by BuildBoundaries(), BuildVoxelLimits(), and G4Voxelizer().
|
private |
Definition at line 242 of file G4Voxelizer.hh.
Referenced by BuildEmpty(), BuildVoxelLimits(), G4Voxelizer(), GetCandidatesVoxelArray(), and Voxelize().
|
private |
Definition at line 224 of file G4Voxelizer.hh.
Referenced by CreateMiniVoxels().
|
private |
Definition at line 225 of file G4Voxelizer.hh.
Referenced by CreateMiniVoxels().