#ifndef VCGTRIMESH_HPP #define VCGTRIMESH_HPP #include "mesh.hpp" #include #include #ifdef POLYSCOPE_DEFINED #include #endif using VertexIndex = size_t; class VCGTriMeshVertex; class VCGTriMeshEdge; class VCGTriMeshFace; struct VCGTriMeshUsedTypes : public vcg::UsedTypes::AsVertexType, vcg::Use::AsEdgeType, vcg::Use::AsFaceType> {}; class VCGTriMeshVertex : public vcg::Vertex {}; class VCGTriMeshFace : public vcg::Face {}; class VCGTriMeshEdge : public vcg::Edge {}; class VCGTriMesh : public vcg::tri::TriMesh, std::vector, std::vector>, public Mesh { public: VCGTriMesh(); VCGTriMesh(const std::string &filename); bool load(const std::string &filename) override; Eigen::MatrixX3d getVertices() const; Eigen::MatrixX3i getFaces() const; bool save(const std::string plyFilename); template size_t getIndex(const MeshElement &element) { return vcg::tri::Index(*this, element); } #ifdef POLYSCOPE_DEFINED polyscope::SurfaceMesh *registerForDrawing( const std::optional> &desiredColor = std::nullopt, const bool &shouldEnable = true) const; #endif Eigen::MatrixX2i getEdges() const; void updateEigenEdgeAndVertices(); }; #endif // VCGTRIMESH_HPP