Geant4
10.00.p01
|
#include <UVoxelizer.hh>
Public Member Functions | |
void | Voxelize (std::vector< VUSolid * > &solids, std::vector< UTransform3D * > &transforms) |
void | Voxelize (std::vector< VUFacet * > &facets) |
void | DisplayVoxelLimits () |
void | DisplayBoundaries () |
void | DisplayListNodes () |
UVoxelizer () | |
~UVoxelizer () | |
void | GetCandidatesVoxel (std::vector< int > &voxels) |
int | GetCandidatesVoxelArray (const UVector3 &point, std::vector< int > &list, UBits *crossed=NULL) const |
int | GetCandidatesVoxelArray (const std::vector< int > &voxels, const UBits bitmasks[], std::vector< int > &list, UBits *crossed=NULL) const |
int | GetCandidatesVoxelArray (const std::vector< int > &voxels, std::vector< int > &list, UBits *crossed=NULL) const |
const std::vector< UVoxelBox > & | GetBoxes () const |
const std::vector< double > & | GetBoundary (int index) const |
bool | UpdateCurrentVoxel (const UVector3 &point, const UVector3 &direction, std::vector< int > &curVoxel) const |
void | GetVoxel (std::vector< int > &curVoxel, const UVector3 &point) const |
int | GetBitsPerSlice () const |
bool | Contains (const UVector3 &point) const |
double | DistanceToNext (const UVector3 &point, const UVector3 &direction, std::vector< int > &curVoxel) const |
double | DistanceToFirst (const UVector3 &point, const UVector3 &direction) const |
double | SafetyToBoundingBox (const UVector3 &point) const |
int | GetVoxelsIndex (int x, int y, int z) const |
int | GetVoxelsIndex (const std::vector< int > &voxels) const |
bool | GetPointVoxel (const UVector3 &p, std::vector< int > &voxels) const |
int | GetPointIndex (const UVector3 &p) const |
const UBits & | Empty () const |
bool | IsEmpty (int index) const |
void | SetMaxVoxels (int max) |
void | SetMaxVoxels (const UVector3 &reductionRatio) |
int | GetMaxVoxels (UVector3 &ratioOfReduction) |
int | AllocatedMemory () |
long long | GetCountOfVoxels () const |
long long | CountVoxels (std::vector< double > boundaries[]) const |
const std::vector< int > & | GetCandidates (std::vector< int > &curVoxel) const |
int | GetVoxelBoxesSize () const |
const UVoxelBox & | GetVoxelBox (int i) const |
const std::vector< int > & | GetVoxelBoxCandidates (int i) const |
int | GetTotalCandidates () const |
void | BuildBoundingBox () |
void | BuildBoundingBox (UVector3 &amin, UVector3 &amax, double tolerance=0) |
Static Public Member Functions | |
template<typename T > | |
static int | BinarySearch (const std::vector< T > &vec, T value) |
static double | MinDistanceToBox (const UVector3 &aPoint, const UVector3 &f) |
static void | SetDefaultVoxelsCount (int count) |
static int | GetDefaultVoxelsCount () |
Private Member Functions | |
void | BuildEmpty () |
std::string | GetCandidatesAsString (const UBits &bits) |
void | CreateSortedBoundary (std::vector< double > &boundaryRaw, int axis) |
void | BuildBoundaries () |
void | BuildReduceVoxels (std::vector< double > fBoundaries[], UVector3 reductionRatio) |
void | BuildReduceVoxels2 (std::vector< double > fBoundaries[], UVector3 reductionRatio) |
void | BuildVoxelLimits (std::vector< VUSolid * > &solids, std::vector< UTransform3D * > &transforms) |
void | BuildVoxelLimits (std::vector< VUFacet * > &facets) |
void | DisplayBoundaries (std::vector< double > &fBoundaries) |
void | BuildBitmasks (std::vector< double > fBoundaries[], UBits bitmasks[]) |
void | SetReductionRatio (int maxVoxels, UVector3 &reductionRatio) |
void | CreateMiniVoxels (std::vector< double > fBoundaries[], UBits bitmasks[]) |
Private Attributes | |
std::vector< UVoxelBox > | fVoxelBoxes |
std::vector< std::vector< int > > | fVoxelBoxesCandidates |
std::map< int, std::vector< int > > | fCandidates |
const std::vector< int > | fNoCandidates |
long long | fCountOfVoxels |
int | fNPerSlice |
std::vector< UVoxelBox > | fBoxes |
std::vector< double > | fBoundaries [3] |
std::vector< int > | fCandidatesCounts [3] |
int | fTotalCandidates |
UBits | fBitmasks [3] |
UVector3 | fBoundingBoxCenter |
UBox | fBoundingBox |
UVector3 | fBoundingBoxSize |
UVector3 | fReductionRatio |
int | fMaxVoxels |
double | fTolerance |
UBits | fEmpty |
Static Private Attributes | |
static int | fDefaultVoxelsCount = -1 |
Definition at line 49 of file UVoxelizer.hh.
UVoxelizer::UVoxelizer | ( | ) |
Definition at line 31 of file UVoxelizer.cc.
References G4SolidStore::DeRegister(), fBoundingBox, fCountOfVoxels, fDefaultVoxelsCount, fNPerSlice, fTolerance, fTotalCandidates, G4SolidStore::GetInstance(), SetMaxVoxels(), and VUSolid::Tolerance().
UVoxelizer::~UVoxelizer | ( | ) |
Definition at line 45 of file UVoxelizer.cc.
int UVoxelizer::AllocatedMemory | ( | ) |
Definition at line 1136 of file UVoxelizer.cc.
References fBitmasks, fBoundaries, fBoxes, fCandidates, fCandidatesCounts, fEmpty, and UBits::GetNbytes().
|
inlinestatic |
Definition at line 58 of file UVoxelizer.hh.
Referenced by BuildBitmasks(), GetCandidatesVoxelArray(), GetPointIndex(), GetPointVoxel(), UVCSGfaceted::GetSection(), UPolycone::GetSection(), GetVoxel(), UVCSGfaceted::SafetyFromInside(), and UPolycone::SafetyFromInside().
|
private |
Definition at line 298 of file UVoxelizer.cc.
References BinarySearch(), UBits::Clear(), fBoxes, fCandidatesCounts, GetBitsPerSlice(), UUtils::SaveVectorToExternalFile(), UBits::SetBitNumber(), UUtils::ToString(), and G4INCL::CrossSections::total().
Referenced by Voxelize().
|
private |
Definition at line 207 of file UVoxelizer.cc.
References CreateSortedBoundary(), fBoundaries, fBoxes, fTolerance, and n.
Referenced by Voxelize().
void UVoxelizer::BuildBoundingBox | ( | ) |
Definition at line 424 of file UVoxelizer.cc.
References fBoundaries, G4INCL::Math::max(), and G4INCL::Math::min().
Definition at line 431 of file UVoxelizer.cc.
References fBoundingBox, fBoundingBoxCenter, fBoundingBoxSize, G4INCL::Math::min(), UVector3::x, UVector3::y, and UVector3::z.
|
private |
Definition at line 50 of file UVoxelizer.cc.
References UBits::Clear(), fBoundaries, fCandidates, fEmpty, fTotalCandidates, GetCandidatesVoxelArray(), GetVoxelsIndex(), G4INCL::Math::max(), UBits::ResetAllBits(), UBits::ResetBitNumber(), and UBits::SetBitNumber().
Referenced by Voxelize().
|
private |
Definition at line 490 of file UVoxelizer.cc.
References UVoxelInfo::count, fCandidatesCounts, G4INCL::Math::max(), UVoxelInfo::next, pos, and UVoxelInfo::previous.
Referenced by Voxelize().
|
private |
Definition at line 584 of file UVoxelizer.cc.
References fCandidatesCounts, G4INCL::Math::max(), and G4INCL::CrossSections::total().
Referenced by Voxelize().
|
private |
|
private |
Definition at line 139 of file UVoxelizer.cc.
References VUFacet::Extent(), fBoxes, fNPerSlice, fTolerance, fTotalCandidates, G4INCL::Math::max(), G4INCL::Math::min(), UVector3::Set(), and z.
bool UVoxelizer::Contains | ( | const UVector3 & | point | ) | const |
Definition at line 997 of file UVoxelizer.cc.
References fBoundaries.
|
inline |
Definition at line 191 of file UVoxelizer.hh.
Referenced by Voxelize().
|
private |
Definition at line 646 of file UVoxelizer.cc.
References fVoxelBoxes, fVoxelBoxesCandidates, GetCandidatesVoxelArray(), UVoxelBox::hlen, and UVoxelBox::pos.
Referenced by Voxelize().
|
private |
Definition at line 189 of file UVoxelizer.cc.
References fBoxes.
Referenced by BuildBoundaries().
void UVoxelizer::DisplayBoundaries | ( | ) |
Definition at line 270 of file UVoxelizer.cc.
References fBoundaries.
|
private |
Definition at line 281 of file UVoxelizer.cc.
void UVoxelizer::DisplayListNodes | ( | ) |
Definition at line 403 of file UVoxelizer.cc.
References fBitmasks, fBoundaries, fNPerSlice, GetCandidatesAsString(), and UBits::Set().
void UVoxelizer::DisplayVoxelLimits | ( | ) |
Definition at line 173 of file UVoxelizer.cc.
References fBoxes.
Definition at line 1007 of file UVoxelizer.cc.
References UBox::DistanceToIn(), fBoundingBox, and fBoundingBoxCenter.
double UVoxelizer::DistanceToNext | ( | const UVector3 & | point, |
const UVector3 & | direction, | ||
std::vector< int > & | curVoxel | ||
) | const |
Definition at line 1056 of file UVoxelizer.cc.
References fBoundaries, and UUtils::kInfinity.
|
inline |
Definition at line 164 of file UVoxelizer.hh.
References fEmpty.
|
inline |
Definition at line 115 of file UVoxelizer.hh.
References fNPerSlice.
Referenced by BuildBitmasks().
|
inline |
Definition at line 96 of file UVoxelizer.hh.
References fBoundaries.
Referenced by GetVoxel().
|
inline |
Definition at line 92 of file UVoxelizer.hh.
References fBoxes.
|
inline |
Definition at line 221 of file UVoxelizer.hh.
References fCandidates, fEmpty, fNoCandidates, and GetVoxelsIndex().
|
private |
Definition at line 389 of file UVoxelizer.cc.
References fBoxes, and UBits::TestBitNumber().
Referenced by DisplayListNodes().
void UVoxelizer::GetCandidatesVoxel | ( | std::vector< int > & | voxels | ) |
Definition at line 777 of file UVoxelizer.cc.
References GetCandidatesVoxelArray().
int UVoxelizer::GetCandidatesVoxelArray | ( | const UVector3 & | point, |
std::vector< int > & | list, | ||
UBits * | crossed = NULL |
||
) | const |
Definition at line 867 of file UVoxelizer.cc.
References BinarySearch(), UBits::fAllBits, fBitmasks, fBoundaries, findComponentsFastest(), fNPerSlice, fTotalCandidates, UVector3::x, UVector3::y, and UVector3::z.
Referenced by BuildEmpty(), CreateMiniVoxels(), GetCandidatesVoxel(), and GetCandidatesVoxelArray().
int UVoxelizer::GetCandidatesVoxelArray | ( | const std::vector< int > & | voxels, |
const UBits | bitmasks[], | ||
std::vector< int > & | list, | ||
UBits * | crossed = NULL |
||
) | const |
Definition at line 938 of file UVoxelizer.cc.
References UBits::fAllBits, findComponentsFastest(), fNPerSlice, and fTotalCandidates.
int UVoxelizer::GetCandidatesVoxelArray | ( | const std::vector< int > & | voxels, |
std::vector< int > & | list, | ||
UBits * | crossed = NULL |
||
) | const |
Definition at line 990 of file UVoxelizer.cc.
References fBitmasks, and GetCandidatesVoxelArray().
|
inline |
Definition at line 186 of file UVoxelizer.hh.
References fCountOfVoxels.
|
static |
Definition at line 1156 of file UVoxelizer.cc.
References fDefaultVoxelsCount.
|
inline |
Definition at line 178 of file UVoxelizer.hh.
References fMaxVoxels, and fReductionRatio.
|
inline |
Definition at line 153 of file UVoxelizer.hh.
References BinarySearch(), fBoundaries, and z.
|
inline |
Definition at line 142 of file UVoxelizer.hh.
References BinarySearch(), and fBoundaries.
|
inline |
Definition at line 246 of file UVoxelizer.hh.
References fTotalCandidates.
|
inline |
Definition at line 103 of file UVoxelizer.hh.
References BinarySearch(), GetBoundary(), and n.
|
inline |
Definition at line 236 of file UVoxelizer.hh.
References fVoxelBoxes.
|
inline |
Definition at line 241 of file UVoxelizer.hh.
References fVoxelBoxesCandidates.
|
inline |
Definition at line 231 of file UVoxelizer.hh.
References fVoxelBoxes.
|
inline |
Definition at line 128 of file UVoxelizer.hh.
References fBoundaries.
Referenced by BuildEmpty(), GetCandidates(), and GetVoxelsIndex().
|
inline |
Definition at line 137 of file UVoxelizer.hh.
References GetVoxelsIndex().
|
inline |
Definition at line 169 of file UVoxelizer.hh.
References fEmpty.
Definition at line 1021 of file UVoxelizer.cc.
References UVector3::x, UVector3::y, and UVector3::z.
Referenced by SafetyToBoundingBox().
double UVoxelizer::SafetyToBoundingBox | ( | const UVector3 & | point | ) | const |
Definition at line 1014 of file UVoxelizer.cc.
References fBoundingBoxCenter, fBoundingBoxSize, and MinDistanceToBox().
|
static |
Definition at line 1151 of file UVoxelizer.cc.
References fDefaultVoxelsCount.
void UVoxelizer::SetMaxVoxels | ( | int | max | ) |
Definition at line 1124 of file UVoxelizer.cc.
References fMaxVoxels, fReductionRatio, G4INCL::Math::max(), and UVector3::Set().
Referenced by UVoxelizer().
void UVoxelizer::SetMaxVoxels | ( | const UVector3 & | reductionRatio | ) |
Definition at line 1130 of file UVoxelizer.cc.
References fMaxVoxels, and fReductionRatio.
|
private |
Definition at line 477 of file UVoxelizer.cc.
References fCandidatesCounts, and UVector3::Set().
Referenced by Voxelize().
bool UVoxelizer::UpdateCurrentVoxel | ( | const UVector3 & | point, |
const UVector3 & | direction, | ||
std::vector< int > & | curVoxel | ||
) | const |
void UVoxelizer::Voxelize | ( | std::vector< VUSolid * > & | solids, |
std::vector< UTransform3D * > & | transforms | ||
) |
void UVoxelizer::Voxelize | ( | std::vector< VUFacet * > & | facets | ) |
Definition at line 680 of file UVoxelizer.cc.
References BuildBitmasks(), BuildBoundaries(), BuildEmpty(), BuildReduceVoxels(), BuildReduceVoxels2(), BuildVoxelLimits(), UBits::Clear(), CountVoxels(), CreateMiniVoxels(), fBitmasks, fBoundaries, fBoxes, fCandidatesCounts, fCountOfVoxels, fMaxVoxels, fReductionRatio, fTotalCandidates, SetReductionRatio(), and G4INCL::CrossSections::total().
|
private |
Definition at line 311 of file UVoxelizer.hh.
Referenced by AllocatedMemory(), DisplayListNodes(), GetCandidatesVoxelArray(), and Voxelize().
|
private |
Definition at line 305 of file UVoxelizer.hh.
Referenced by AllocatedMemory(), BuildBoundaries(), BuildBoundingBox(), BuildEmpty(), Contains(), DisplayBoundaries(), DisplayListNodes(), DistanceToNext(), GetBoundary(), GetCandidatesVoxelArray(), GetPointIndex(), GetPointVoxel(), GetVoxelsIndex(), and Voxelize().
|
private |
Definition at line 314 of file UVoxelizer.hh.
Referenced by BuildBoundingBox(), DistanceToFirst(), and UVoxelizer().
|
private |
Definition at line 313 of file UVoxelizer.hh.
Referenced by BuildBoundingBox(), DistanceToFirst(), and SafetyToBoundingBox().
|
private |
Definition at line 315 of file UVoxelizer.hh.
Referenced by BuildBoundingBox(), and SafetyToBoundingBox().
|
private |
Definition at line 303 of file UVoxelizer.hh.
Referenced by AllocatedMemory(), BuildBitmasks(), BuildBoundaries(), BuildVoxelLimits(), CreateSortedBoundary(), DisplayVoxelLimits(), GetBoxes(), GetCandidatesAsString(), and Voxelize().
|
mutableprivate |
Definition at line 269 of file UVoxelizer.hh.
Referenced by AllocatedMemory(), BuildEmpty(), and GetCandidates().
|
private |
Definition at line 307 of file UVoxelizer.hh.
Referenced by AllocatedMemory(), BuildBitmasks(), BuildReduceVoxels(), BuildReduceVoxels2(), SetReductionRatio(), and Voxelize().
|
private |
Definition at line 273 of file UVoxelizer.hh.
Referenced by GetCountOfVoxels(), UVoxelizer(), and Voxelize().
|
staticprivate |
Definition at line 263 of file UVoxelizer.hh.
Referenced by GetDefaultVoxelsCount(), SetDefaultVoxelsCount(), and UVoxelizer().
|
private |
Definition at line 323 of file UVoxelizer.hh.
Referenced by AllocatedMemory(), BuildEmpty(), Empty(), GetCandidates(), and IsEmpty().
|
private |
Definition at line 319 of file UVoxelizer.hh.
Referenced by GetMaxVoxels(), SetMaxVoxels(), and Voxelize().
|
private |
Definition at line 271 of file UVoxelizer.hh.
Referenced by GetCandidates().
|
private |
Definition at line 301 of file UVoxelizer.hh.
Referenced by BuildVoxelLimits(), DisplayListNodes(), GetBitsPerSlice(), GetCandidatesVoxelArray(), and UVoxelizer().
|
private |
Definition at line 317 of file UVoxelizer.hh.
Referenced by GetMaxVoxels(), SetMaxVoxels(), and Voxelize().
|
private |
Definition at line 321 of file UVoxelizer.hh.
Referenced by BuildBoundaries(), BuildVoxelLimits(), and UVoxelizer().
|
private |
Definition at line 309 of file UVoxelizer.hh.
Referenced by BuildEmpty(), BuildVoxelLimits(), GetCandidatesVoxelArray(), GetTotalCandidates(), UVoxelizer(), and Voxelize().
|
private |
Definition at line 265 of file UVoxelizer.hh.
Referenced by CreateMiniVoxels(), GetVoxelBox(), and GetVoxelBoxesSize().
|
private |
Definition at line 267 of file UVoxelizer.hh.
Referenced by CreateMiniVoxels(), and GetVoxelBoxCandidates().