11 #ifndef __UT_PointGrid_h__
12 #define __UT_PointGrid_h__
126 int xres,
int yres,
int zres);
131 bool canBuild(
int xres,
int yres,
int zres);
173 bool boundsCheck =
true)
const;
234 int &xmin,
int &ymin,
int &zmin,
235 int &xmax,
int &ymax,
int &zmax)
const;
242 const UT_GridIdxKey &
b)
const
244 return a.grididx < b.grididx;
295 template <
typename INDEX,
typename KEY>
void gridIdxToIndex(grididxtype idx, int &x, int &y, int &z)
const UT_Vector3Array & myV3Array
#define SYS_PACKED_STRUCT_HINT_END
#define SYS_STATIC_ASSERT(expr)
UT_PointGridIterator< T > findCloseKeys(const UT_Vector3 &position, queuetype &queuetype, fpreal radius) const
bool getBit(exint index) const
Iteration over a range of elements This class implements a point-in-grid acceleration structure that ...
keytype getKey(indextype idx) const
Gets the key for a given index.
int64 getMemoryUsage() const
SYS_PACKED_STRUCT_HINT_END grididxtype indexToGridIdx(int x, int y, int z)
int getXRes() const
X-resolution of the underlying grid.
GLdouble GLdouble GLdouble z
UT_Vector3 myInvVoxelSize
GLboolean GLboolean GLboolean GLboolean a
int getYRes() const
Y-resolution of the underlying grid.
exint entries() const
The total number of keys over which this iterator will iterate.
bool calcBounds(const UT_Vector3 &pos, fpreal radius, int &xmin, int &ymin, int &zmin, int &xmax, int &ymax, int &zmax) const
keytype operator*() const
bool hasCloseKeys(const UT_Vector3 &position, fpreal radius) const
exint maxKeyValue() const
UT_PointGridIterator< T > getKeysAt(int x, int y, int z, queuetype &queue) const
int getZRes() const
Z-resolution of the underlying grid.
UT_VoxelArray< indextype > myEnds
static void destroyQueue(queuetype *queue)
Destroys a queue created with createQueue().
static const keytype INVALIDKEY
Invalid key value.
const UT_BitArray * myValidArray
UT_ValArray< UT_PointGridSequence > queuetype
THREADED_METHOD1(UT_PointGrid< T >, shouldMultithread(), computeGridIdx, UT_ValArray< bool > &, tileoccupied)
void computeGridIdxPartial(UT_ValArray< bool > &tileoccupied, const UT_JobInfo &info)
Generic UT_Vector3Array based accessor for UT_PointGrid.
exint entries() const
Returns the total number of points.
UT_PointGrid(const T &accessor)
bool shouldMultithread() const
UT_Vector3T< int > myBBoxMin
UT_PointGridIterator< T > getInvalidKeys(queuetype &queue) const
bool posToIndex(UT_Vector3 position, int &x, int &y, int &z, bool boundsCheck=true) const
UT_Vector3Grid::queuetype UT_Vector3GridQueue
static const indextype INVALIDINDEX
UT_PointGridVector3ArrayAccessor(const UT_Vector3Array &positions, const UT_ValArray< keytype > &keys, const UT_BitArray *valid=NULL)
static queuetype * createQueue()
int getRes(int axis) const
Resolution of the underlying grid along the specified axis.
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the queue
bool operator()(const UT_GridIdxKey &a, const UT_GridIdxKey &b) const
keytype getKeyAt(indextype idx) const
Returns the key at the specified index.
GLboolean GLboolean GLboolean b
exint entriesAt(int x, int y, int z) const
Returns number of points contained in a given voxel.
void findIdxRangesPartial(UT_ValArray< UT_Vector3T< int > > &bboxmins, UT_ValArray< UT_Vector3T< int > > &bboxmaxs, indextype numValidKeys, const UT_JobInfo &info)
void uncompressTilesPartial(const UT_ValArray< bool > &tileoccupied, const UT_JobInfo &info)
SYS_PACKED_STRUCT_HINT_BEGIN(UT_GridIdxKey, 4)
const UT_Vector3 & getVoxelSize() const
Returns the voxel size of the underlying grid.
exint entries() const
Alias of size(). size() is preferred.
indextype entries() const
Returns the number of points.
UT_PointGrid< UT_PointGridVector3ArrayAccessor< int32, exint > > UT_Vector3Grid
int64 getMemoryUsage() const
Returns the total memory usage (in bytes) of the grid.
static const grididxtype INVALIDGRIDIDX
THREADED_METHOD3(UT_PointGrid< T >, shouldMultithread(), findIdxRanges, UT_ValArray< UT_Vector3T< int > > &, bboxmins, UT_ValArray< UT_Vector3T< int > > &, bboxmaxs, indextype, numValidKeys)
exint numSequences() const
bool isValid() const
Test to see whether the iterator is valid.
const UT_ValArray< keytype > & myKeyArray
bool build(const UT_Vector3 &orig, const UT_Vector3 &size, int xres, int yres, int zres)
SIM_API const UT_StringHolder position
int getRes(int axis) const
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
Iteration over a range of keys returned from a UT_PointGrid query.
const UT_PointGrid< T > * myGrid
UT_VoxelArray< indextype > myBegins
UT_Vector3 getPos(indextype idx) const
Returns the position for a given index.
UT_PointGridIterator< T >::queuetype queuetype
bool isValidIndex(int x, int y, int z) const
Returns true if the given x, y, z values lie inside the valid index.
UT_Vector3T< int > myBBoxMax
bool isValidIndex(int x, int y, int z) const
Returns true if the specified index is valid for the underlying grid.
UT_ValArray< UT_GridIdxKey > myIdxKeys
bool canBuild(int xres, int yres, int zres)
UT_PointGridIterator< T > iterator
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.