35 #ifndef CHUNK_BUILDER_HPP 36 #define CHUNK_BUILDER_HPP 41 #include <unordered_map> 50 class ChunkBuilder :
public std::enable_shared_from_this<ChunkBuilder>
61 std::shared_ptr<std::unordered_map<
unsigned int, std::vector<std::weak_ptr<ChunkBuilder>>>>
106 std::shared_ptr<std::unordered_map<unsigned int, unsigned int>> splitVertices,
107 std::shared_ptr<std::unordered_map<unsigned int, unsigned int>> splitFaces)
const;
145 std::shared_ptr<std::unordered_map<unsigned int, std::vector<std::weak_ptr<ChunkBuilder>>>>
151 #endif // CHUNK_BUILDER_HPP std::vector< VertexHandle > m_duplicateVertices
Handle to access vertices of the mesh.
unsigned int numVertices() const
numVertices amount of vertices ot the resulting mesh
std::shared_ptr< std::unordered_map< unsigned int, std::vector< std::weak_ptr< ChunkBuilder > > > > m_vertexUse
std::shared_ptr< MeshBuffer > MeshBufferPtr
std::shared_ptr< ChunkBuilder > ChunkBuilderPtr
void addDuplicateVertex(const VertexHandle &index)
addDuplicateVertex marks a vertex as duplicate
Half-edge data structure implementing the BaseMesh interface.
void addFace(const FaceHandle &index)
assigns a face to the chunk this builder is generating
MeshBufferPtr buildMesh(MeshBufferPtr attributedMesh, std::shared_ptr< std::unordered_map< unsigned int, unsigned int >> splitVertices, std::shared_ptr< std::unordered_map< unsigned int, unsigned int >> splitFaces) const
buildMesh builds a chunk by generating a new mesh buffer
std::shared_ptr< HalfEdgeMesh< BaseVector< float > > > m_originalMesh
std::vector< FaceHandle > m_faces
unsigned int m_numVertices
ChunkBuilder(std::shared_ptr< HalfEdgeMesh< BaseVector< float >>> originalMesh, std::shared_ptr< std::unordered_map< unsigned int, std::vector< std::weak_ptr< ChunkBuilder >>>> vertexUse)
ChunkBuilder constructs a chun builder that can create individual chunks.
unsigned int numFaces() const
numFaces delivers the number of faces for the chunk
Handle to access faces of the mesh.