63 typename std::vector<T>::const_iterator begin = vec.begin(), end = vec.end();
64 int res = std::upper_bound(begin, end, value) - begin - 1;
70 void Voxelize(std::vector<VUSolid*>& solids, std::vector<UTransform3D*>& transforms);
73 void Voxelize(std::vector<VUFacet*>& facets);
92 inline const std::vector<UVoxelBox>&
GetBoxes()
const
96 inline const std::vector<double>&
GetBoundary(
int index)
const
105 for (
int i = 0; i <= 2; ++i)
107 const std::vector<double>& boundary =
GetBoundary(i);
110 else if (n == (
int) boundary.size() - 1) n--;
130 if (x < 0 || y < 0 || z < 0)
return -1;
133 int index = x + y * maxX + z * maxX * maxY;
144 for (
int i = 0; i <= 2; ++i)
147 for (
int i = 0; i <= 2; ++i)
160 int index = x + y * maxX + z * maxX * maxY;
191 inline long long CountVoxels(std::vector<double> boundaries[])
const
193 long long sx = boundaries[0].size() - 1;
194 long long sy = boundaries[1].size() - 1;
195 long long sz = boundaries[2].size() - 1;
221 inline const std::vector<int>&
GetCandidates(std::vector<int>& curVoxel)
const
224 if (voxelsIndex >= 0 && !
fEmpty[voxelsIndex])
288 void BuildVoxelLimits(std::vector<VUSolid*>& solids, std::vector<UTransform3D*>& transforms);
289 #endif // USOLIDSONLY
346 #endif // USOLIDSONLY
int GetVoxelsIndex(const std::vector< int > &voxels) const
static int fDefaultVoxelsCount
const std::vector< double > & GetBoundary(int index) const
int GetVoxelsIndex(int x, int y, int z) const
double DistanceToNext(const UVector3 &point, const UVector3 &direction, std::vector< int > &curVoxel) const
int GetTotalCandidates() const
void CreateMiniVoxels(std::vector< double > fBoundaries[], UBits bitmasks[])
void SetMaxVoxels(int max)
bool UpdateCurrentVoxel(const UVector3 &point, const UVector3 &direction, std::vector< int > &curVoxel) const
void GetVoxel(std::vector< int > &curVoxel, const UVector3 &point) const
bool Contains(const UVector3 &point) const
long long GetCountOfVoxels() const
std::vector< UVoxelBox > fBoxes
int GetMaxVoxels(UVector3 &ratioOfReduction)
void BuildVoxelLimits(std::vector< VUSolid * > &solids, std::vector< UTransform3D * > &transforms)
double DistanceToFirst(const UVector3 &point, const UVector3 &direction) const
std::vector< double > fBoundaries[3]
static int BinarySearch(const std::vector< T > &vec, T value)
int GetVoxelBoxesSize() const
void BuildReduceVoxels2(std::vector< double > fBoundaries[], UVector3 reductionRatio)
static double MinDistanceToBox(const UVector3 &aPoint, const UVector3 &f)
std::vector< std::vector< int > > fVoxelBoxesCandidates
const std::vector< int > fNoCandidates
int GetCandidatesVoxelArray(const UVector3 &point, std::vector< int > &list, UBits *crossed=NULL) const
void BuildBitmasks(std::vector< double > fBoundaries[], UBits bitmasks[])
long long CountVoxels(std::vector< double > boundaries[]) const
const UVoxelBox & GetVoxelBox(int i) const
bool GetPointVoxel(const UVector3 &p, std::vector< int > &voxels) const
std::string GetCandidatesAsString(const UBits &bits)
const std::vector< int > & GetCandidates(std::vector< int > &curVoxel) const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
const std::vector< int > & GetVoxelBoxCandidates(int i) const
void GetCandidatesVoxel(std::vector< int > &voxels)
static int GetDefaultVoxelsCount()
int GetPointIndex(const UVector3 &p) const
std::vector< UVoxelBox > fVoxelBoxes
int GetBitsPerSlice() const
void BuildReduceVoxels(std::vector< double > fBoundaries[], UVector3 reductionRatio)
std::vector< int > fCandidatesCounts[3]
void CreateSortedBoundary(std::vector< double > &boundaryRaw, int axis)
void DisplayVoxelLimits()
std::map< int, std::vector< int > > fCandidates
const std::vector< UVoxelBox > & GetBoxes() const
void SetReductionRatio(int maxVoxels, UVector3 &reductionRatio)
double SafetyToBoundingBox(const UVector3 &point) const
const UBits & Empty() const
static void SetDefaultVoxelsCount(int count)
void Voxelize(std::vector< VUSolid * > &solids, std::vector< UTransform3D * > &transforms)
UVector3 fBoundingBoxSize
bool IsEmpty(int index) const
UVector3 fBoundingBoxCenter