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();
90 bool hasHalfEdges()
const;
94 std::vector<int> boundaryHalfEdgesFromVertex(
int vertex_index)
const;
98 std::vector<int> boundaryVerticesFromVertex(
int vertex_index)
const;
101 std::vector<std::vector<int>> getBoundaries()
const;
109 static std::shared_ptr<HalfEdgeTriangleMesh> CreateFromTriangleMesh(
116 int nextHalfEdgeFromVertex(
int init_half_edge_index)
const;
117 int nextHalfEdgeOnBoundary(
int curr_half_edge_index)
const;
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
const QCPVector2D operator+(const QCPVector2D &vec1, const QCPVector2D &vec2)
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()
Default Constructor.
HalfEdgeTriangleMesh inherits TriangleMesh class with the addition of HalfEdge data structure for eac...
HalfEdgeTriangleMesh(const char *name="HalfEdgeTriangleMesh")
Default Constructor.
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_
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
std::vector< Eigen::Vector3i > triangles_
List of triangles in the mesh.
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< Eigen::Vector3d > triangle_normals_
List of triangle normals in the mesh.
std::size_t edgeSize() const
~HalfEdgeTriangleMesh() override
void operator+=(MiniVec< T, N > &a, const MiniVec< T, N > &b)
Generic file read and write utility for python interface.
Eigen::Matrix< Index, 2, 1 > Vector2i