51 const auto & map = blocks_[voxelId / blockSize_].smap;
52 auto it = map.find( voxelId );
53 return ( it != map.end() ) ? &it->second :
nullptr;
63 size_t blockSize_ = 0;
64 std::vector<Block> blocks_;
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
storage for points on voxel edges used in Marching Cubes algorithms
Definition MRSeparationPoint.h:22
MRMESH_API Triangulation getTriangulation(Vector< VoxelId, FaceId > *outVoxelPerFaceMap=nullptr) const
combines triangulations from every block into one and returns it
auto findSeparationPointSet(size_t voxelId) const -> const SeparationPointSet *
finds the set (locating the block) by voxel id
Definition MRSeparationPoint.h:49
MRMESH_API void getPoints(VertCoords &points) const
obtains coordinates of all stored points
MRMESH_API int makeUniqueVids()
MRMESH_API void resize(size_t blockCount, size_t blockSize)
prepares storage for given number of blocks, each containing given size of voxels
Block & getBlock(size_t blockIndex)
get block for filling in the thread responsible for it
Definition MRSeparationPoint.h:42
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:20
Definition MRCameraOrientationPlugin.h:8
NeighborDir
Definition MRSeparationPoint.h:13
std::array< VertId, size_t(NeighborDir::Count)> SeparationPointSet
Definition MRSeparationPoint.h:17
HashMap< size_t, SeparationPointSet > SeparationPointMap
Definition MRSeparationPoint.h:18
phmap::flat_hash_map< K, V, Hash, Eq > HashMap
Definition MRMesh/MRMeshFwd.h:460
Definition MRSeparationPoint.h:25
SeparationPointMap smap
Definition MRSeparationPoint.h:26
VertId nextVid() const
during filling, it is the id of next valid point;
Definition MRSeparationPoint.h:32
Vector< VoxelId, FaceId > faceMap
Definition MRSeparationPoint.h:35
std::vector< Vector3f > coords
Definition MRSeparationPoint.h:27
Triangulation tris
Definition MRSeparationPoint.h:34
VertId shift
after makeUniqueVids(), it is the unique id of first point in coords
Definition MRSeparationPoint.h:29