37 #ifndef CHUNK_MANAGER_HPP 38 #define CHUNK_MANAGER_HPP 53 using FilterFunction = std::function<bool(MultiChannelMap::val_type, size_t)>;
70 float maxChunkOverlap,
72 std::string layer = std::string(
"mesh"),
73 size_t cacheSize = 200
79 float maxChunkOverlap,
81 std::vector<std::string> layers,
82 size_t cacheSize = 200);
94 ChunkManager(std::string hdf5Path,
size_t cacheSize = 200,
float chunkSize = 10.0f);
130 std::unordered_map<std::size_t, MeshBufferPtr>& chunks,
131 std::string layer = std::string(
"mesh"));
156 const std::map<std::string, FilterFunction>
filter,
157 std::string layer = std::string(
"mesh"));
199 std::shared_ptr<std::unordered_map<unsigned int, unsigned int>> splitVertices,
200 std::shared_ptr<std::unordered_map<unsigned int, unsigned int>> splitFaces);
239 template <
typename T>
241 std::unordered_map<std::size_t, MeshBufferPtr>& chunks,
242 std::string channelName,
243 std::size_t staticVertexIndexOffset,
244 std::size_t numVertices,
245 std::size_t numFaces,
246 std::vector<std::unordered_map<std::size_t, std::size_t>>& areaVertexIndices);
261 template <
typename T>
264 const std::vector<bool>& faceFilter,
265 const size_t numVertices,
266 const size_t numFaces,
273 #include "ChunkManager.tcc" 275 #endif // CHUNK_MANAGER_HPP void buildChunks(MeshBufferPtr mesh, float maxChunkOverlap, std::string savePath, std::string layer=std::string("mesh"))
buildChunks builds chunks from an original mesh
std::shared_ptr< MeshBuffer > MeshBufferPtr
MeshBufferPtr extractArea(const BoundingBox< BaseVector< float >> &area, std::string layer=std::string("mesh"))
extractArea creates and returns MeshBufferPtr of merged chunks for given area.
A dynamic bounding box class.
std::function< bool(MultiChannelMap::val_type, size_t)> FilterFunction
std::vector< std::string > getChannelsFromMesh(std::string layer=std::string("mesh"))
Get all existing channels from mesh.
ChunkManager(MeshBufferPtr meshes, float chunksize, float maxChunkOverlap, std::string savePath, std::string layer=std::string("mesh"), size_t cacheSize=200)
ChunkManager creates chunks from an original mesh.
BaseVector< float > getFaceCenter(std::shared_ptr< HalfEdgeMesh< BaseVector< float >>> mesh, const FaceHandle &handle) const
getFaceCenter gets the center point for a given face
ChannelPtr< T > extractChannelOfArea(std::unordered_map< std::size_t, MeshBufferPtr > &chunks, std::string channelName, std::size_t staticVertexIndexOffset, std::size_t numVertices, std::size_t numFaces, std::vector< std::unordered_map< std::size_t, std::size_t >> &areaVertexIndices)
reads and combines a channel of multiple chunks
void initBoundingBox(MeshBufferPtr mesh)
initBoundingBox calculates a bounding box of the original mesh
void loadAllChunks(std::string layer=std::string("mesh"))
Loads all chunks into the ChunkHashGrid. DEBUG – Only used for testing, but might be useful for smal...
Half-edge data structure implementing the BaseMesh interface.
void filter(lvr2::PointBufferPtr &cloud, lvr2::indexArray &inlier, size_t j)
BoundingBox< BaseVector< float > > m_boundingBox
BoundingBox< BaseVector< float > > getGlobalBoundingBox()
getGlobalBoundingBox is a getter for the bounding box of the entire chunked model ...
BaseVector< int > getCellCoordinates(const BaseVector< float > &vec) const
find corresponding grid cell of given point
void cutLargeFaces(std::shared_ptr< HalfEdgeMesh< BaseVector< float >>> halfEdgeMesh, float overlapRatio, std::shared_ptr< std::unordered_map< unsigned int, unsigned int >> splitVertices, std::shared_ptr< std::unordered_map< unsigned int, unsigned int >> splitFaces)
cutLargeFaces cuts a face if it is too large
MultiChannelMap::val_type applyChannelFilter(const std::vector< bool > &vertexFilter, const std::vector< bool > &faceFilter, const size_t numVertices, const size_t numFaces, const MeshBufferPtr meshBuffer, const MultiChannelMap::val_type &originalChannel) const
applies given filter arrays to one channel
typename Channel< T >::Ptr ChannelPtr
Handle to access faces of the mesh.