11 #include <unordered_map>
38 vertex_indices_(-1, -1),
39 triangle_index_(-1) {}
77 inline std::size_t
edgeSize()
const {
return half_edges_.size(); }
81 return vertices_.size() > 0 && triangles_.size() > 0;
86 return hasTriangles() && triangles_.size() == triangle_normals_.size();
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
HalfEdge class contains vertex, triangle info about a half edge, as well as relations of next and twi...
int next_
Index of the next HalfEdge in the same triangle.
Eigen::Vector2i vertex_indices_
Index of the ordered vertices forming this half edge.
int triangle_index_
Index of the triangle containing this half edge.
int twin_
Index of the twin HalfEdge.
HalfEdge(const Eigen::Vector2i &vertex_indices, int triangle_index, int next, int twin)
HalfEdge()
Default Constructor.
HalfEdgeTriangleMesh inherits TriangleMesh class with the addition of HalfEdge data structure for eac...
std::vector< int > boundaryVerticesFromVertex(int vertex_index) const
HalfEdgeTriangleMesh(const char *name="HalfEdgeTriangleMesh")
Default Constructor.
std::vector< int > boundaryHalfEdgesFromVertex(int vertex_index) const
virtual bool hasTriangles() const override
Returns true if the mesh contains triangles.
bool HasTriangleNormals() const
Returns true if the mesh contains triangle normals.
std::vector< std::vector< int > > ordered_half_edge_from_vertex_
bool hasHalfEdges() const
Returns true if half-edges have already been computed.
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
static std::shared_ptr< HalfEdgeTriangleMesh > CreateFromTriangleMesh(const ccMesh &mesh)
std::vector< Eigen::Vector3i > triangles_
List of triangles in the mesh.
virtual HalfEdgeTriangleMesh & clear() override
std::vector< HalfEdge > half_edges_
List of HalfEdge in the mesh.
virtual bool isSerializable() const override
Returns whether object is serializable of not.
std::vector< std::vector< int > > getBoundaries() const
Returns a vector of boundaries. A boundary is a vector of vertices.
HalfEdgeTriangleMesh operator+(const HalfEdgeTriangleMesh &mesh) const
std::vector< Eigen::Vector3d > triangle_normals_
List of triangle normals in the mesh.
std::size_t edgeSize() const
int nextHalfEdgeOnBoundary(int curr_half_edge_index) const
~HalfEdgeTriangleMesh() override
int nextHalfEdgeFromVertex(int init_half_edge_index) const
HalfEdgeTriangleMesh & operator+=(const HalfEdgeTriangleMesh &mesh)
Generic file read and write utility for python interface.
Eigen::Matrix< Index, 2, 1 > Vector2i