31 const std::string attribute_type<EdgeHandle>::attr_group =
"edge_attributes";
32 const std::string attribute_type<OptionalEdgeHandle>::attr_group =
"edge_attributes";
33 const std::string attribute_type<VertexHandle>::attr_group =
"vertex_attributes";
34 const std::string attribute_type<OptionalVertexHandle>::attr_group =
"vertex_attributes";
35 const std::string attribute_type<FaceHandle>::attr_group =
"face_attributes";
36 const std::string attribute_type<OptionalFaceHandle>::attr_group =
"face_attributes";
37 const std::string attribute_type<ClusterHandle>::attr_group =
"cluster_attributes";
38 const std::string attribute_type<OptionalClusterHandle>::attr_group =
"cluster_attributes";
53 new_indices.insert(vH, k);
58 for(
auto fH : hem.
faces())
61 indices[i][0] = new_indices[vHs[0]];
62 indices[i][1] = new_indices[vHs[1]];
63 indices[i][2] = new_indices[vHs[2]];
74 if(vertices_opt && indices_opt)
76 auto& vertices = vertices_opt.get();
77 auto& indices = indices_opt.get();
80 for (
size_t i = 0; i < vertices.numElements(); i++)
85 for (
size_t i = 0; i < indices.numElements(); i++)
87 const std::array<VertexHandle, 3>& face = indices[i];
88 hem.
addFace(face[0], face[1], face[2]);
size_t numVertices() const final
Returns the number of vertices in the mesh.
bool containsVertex(VertexHandle vH) const
Checks if the given vertex is part of this mesh.
Handle to access vertices of the mesh.
boost::optional< HalfEdgeMesh< BaseVec > > getMesh()
Reads a HalfEdgeMesh from the persistence layer.
uint32_t Index
Datatype used as index for each vertex, face and edge.
void reserve(size_t newCap)
virtual FloatChannelOptional getVertices()=0
Persistence layer interface, Accesses the vertices of the mesh in the persistence layer...
virtual bool addVertices(const FloatChannel &channel_ptr)=0
Persistence layer interface, Writes the vertices of the mesh to the persistence layer.
array< VertexHandle, 3 > getVerticesOfFace(FaceHandle handle) const final
Get the three vertices surrounding the given face.
virtual bool addIndices(const IndexChannel &channel_ptr)=0
Persistence layer interface, Writes the face indices of the mesh to the persistence layer...
virtual IndexChannelOptional getIndices()=0
Persistence layer interface, Accesses the face indices of the mesh in the persistence layer...
FaceHandle addFace(VertexHandle v1H, VertexHandle v2H, VertexHandle v3H) final
Creates a face connecting the three given vertices.
virtual FaceIteratorProxy< BaseVecT > faces() const
Method for usage in range-based for-loops.
Half-edge data structure implementing the BaseMesh interface.
size_t numFaces() const final
Returns the number of faces in the mesh.
A map with constant lookup overhead using small-ish integer-keys.
bool addMesh(const HalfEdgeMesh< BaseVec > &hem)
Adds a HalfEdgeMesh to the persistence layer.
Index nextVertexIndex() const
Returns the handle index which would be assigned to the next vertex that is created. This method is mainly useful for manually iterating over all possible handles. As handles are strictly increasing, all vertices currently in this mesh have a handle index smaller than what this method returns.
BaseVecT getVertexPosition(VertexHandle handle) const final
Get the position of the given vertex.
VertexHandle addVertex(BaseVecT pos) final
Adds a vertex with the given position to the mesh.