MeshLib C++ Docs
Loading...
Searching...
No Matches

#include <MRMesh/MRVolumeIndexer.h>

Public Member Functions

 VolumeIndexer (const Vector3i &dims)
const Vector3i & dims () const
size_t size () const
 returns the total number of voxels
VoxelId endId () const
 returns the last plus one voxel Id for defining iteration range
size_t sizeXY () const
Vector3i toPos (VoxelId id) const
VoxelId toVoxelId (const Vector3i &pos) const
VoxelLocation toLoc (VoxelId id) const
VoxelLocation toLoc (const Vector3i &pos) const
bool isInDims (const Vector3i &pos) const
 returns true if this voxel is within dimensions
bool isBdVoxel (const Vector3i &pos) const
 returns true if this voxel is on the boundary of the volume
bool areNeigbors (VoxelId v0, VoxelId v1) const
 returns true if v1 is within at most 6 neighbors of v0
bool areNeigbors (const Vector3i &pos0, const Vector3i &pos1) const
bool hasNeighbour (const Vector3i &pos, OutEdge toNei) const
 given existing voxel at (pos), returns whether it has valid neighbor specified by the edge (toNei)
VoxelId getNeighbor (VoxelId v, OutEdge toNei) const
 returns id of v's neighbor specified by the edge
VoxelId getNeighbor (VoxelId v, const Vector3i &pos, OutEdge toNei) const
VoxelLocation getNeighbor (const VoxelLocation &loc, OutEdge toNei) const
VoxelId getExistingNeighbor (VoxelId v, OutEdge toNei) const
 returns id of v's neighbor specified by the edge, which is known to exist (so skipping a lot of checks)
VoxelId getNeighbor (VoxelId v, const Vector3i &pos, bool bdPos, OutEdge toNei) const

Protected Attributes

Vector3i dims_
size_t sizeXY_ = 0
 = dims_.x * dims_.y
size_t size_ = 0
 = dims_.x * dims_.y * dims_.z
int neiInc_ [OutEdgeCount] = {}

The documentation for this class was generated from the following file: