Class MeshKernel

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class MeshKernel : public zmesh::core::PropertyKernel

实现了较低级别的拓扑操作和常见的网格操作 低级别的拓扑操作不安全, 不建议用, 一般用Mesh中的较高级的操作

Subclassed by zmesh::core::Mesh

Public Functions

MeshKernel()
inline virtual ~MeshKernel()
inline MeshKernel(const MeshKernel &rhs)
MeshKernel &operator=(const MeshKernel &rhs)

copy, 包括自定义属性

MeshKernel &assign(const MeshKernel &rhs)

copy, 不包括自定义属性

VertexHandle new_vertex()

添加新的顶点

HalfedgeHandle new_edge()

添加新的边

HalfedgeHandle new_edge(VertexHandle start, VertexHandle end)

添加新的边, 两个端点由参数给定

FaceHandle new_face()

添加新的面, 不给定任何相邻的边和点

inline size_t vertices_size() const

顶点的数目, 包括被标记为删除的顶点

inline size_t edges_size() const

边的数目, 包括被标记为删除的边

inline size_t halfedges_size() const

半边的数目, 包括被标记为删除的半边

inline size_t faces_size() const

面的数目, 包括被标记为删除的半边

inline size_t n_vertices() const

顶点的数目, 不包括被标记为删除的顶点

inline size_t n_edges() const

顶点的数目, 不包括被标记为删除的边

inline size_t n_halfedges() const

顶点的数目, 不包括被标记为删除的半边

inline size_t n_faces() const

顶点的数目, 不包括被标记为删除的面

inline bool is_empty() const

判断网格是否为空(有没有顶点)

void free_memory()

释放内存

virtual void clear()

清除所有数据

inline bool is_deleted(VertexHandle v) const

顶点是否被删除

inline bool is_deleted(EdgeHandle e) const

边是否被删除

inline bool is_deleted(HalfedgeHandle h) const

半边是否被删除

inline bool is_deleted(FaceHandle f) const

面是否被删除

inline bool is_valid(VertexHandle v) const

顶点是否有效

inline bool is_valid(EdgeHandle e) const

边是否有效

inline bool is_valid(HalfedgeHandle h) const

半边是否有效

inline bool is_valid(FaceHandle f) const

面是否有效

inline const Point &point(VertexHandle v) const

获得顶点对应的三维坐标

inline Point &point(VertexHandle v)

获得顶点对应的三维坐标

inline void set_point(VertexHandle v, Point p)

设置顶点对应的三维坐标

inline std::vector<Point> &points()

返回所有顶点的三维坐标

inline HalfedgeHandle halfedge(VertexHandle v) const

返回顶点v的一条outgoing halfedge

inline void set_halfedge(VertexHandle v, HalfedgeHandle h)

设置顶点v的outgoing halfedge

inline HalfedgeHandle outgoing_halfedge(VertexHandle v) const

返回顶点v的一条outgoing halfedge

inline HalfedgeHandle incoming_halfedge(VertexHandle v) const

返回顶点v的一条incoming halfedge

inline bool is_boundary(VertexHandle v) const

判断顶点是不是边界点

inline bool is_isolated(VertexHandle v) const

判断顶点是不是孤立点

inline HalfedgeHandle halfedge(EdgeHandle e, int i) const

返回边e的半边, i必须是0或1

inline VertexHandle vertex(EdgeHandle e, int i) const

返回边e的顶点, i必须是0或1

inline bool is_boundary(EdgeHandle e) const

判断边是不是边界

inline VertexHandle to_vertex(HalfedgeHandle h) const

返回半边的to顶点

inline VertexHandle from_vertex(HalfedgeHandle h) const

返回半边的from顶点

inline void set_to_vertex(HalfedgeHandle h, VertexHandle v)

设置半边的to顶点

inline FaceHandle face(HalfedgeHandle h) const

返回与半边h相接的一个面

inline EdgeHandle edge(HalfedgeHandle h) const

返回与半边h相关的一条边

inline HalfedgeHandle opposite(HalfedgeHandle h) const

返回半边h的反向半边

inline HalfedgeHandle next_halfedge(HalfedgeHandle h) const

返回h的下一条半边

inline void set_next_halfedge(HalfedgeHandle h, HalfedgeHandle nh)

设置h的下一条半边

inline HalfedgeHandle prev_halfedge(HalfedgeHandle h) const

返回h的上一条半边

inline void set_prev_halfedge(HalfedgeHandle h, HalfedgeHandle ph)

设置h的上一条半边

inline HalfedgeHandle cw_halfedge(HalfedgeHandle h) const

返回h按顺时针旋转的下一条半边

inline HalfedgeHandle ccw_halfedge(HalfedgeHandle h) const

返回h按逆时针旋转的下一条半边

inline bool is_boundary(HalfedgeHandle h) const

判断半边是不是边界

inline HalfedgeHandle halfedge(FaceHandle f) const

返回与f相接的一条半边

inline void set_halfedge(FaceHandle f, HalfedgeHandle h)

设置f相接的半边

inline void set_face(HalfedgeHandle h, FaceHandle f)

设置半边相接的面

inline bool is_boundary(FaceHandle f) const

判断面是不是边界

Protected Attributes

VertexPropertyHandle<Point> vpoints_
VertexPropertyHandle<VertexTopology> vertices_
EdgePropertyHandle<EdgeTopology> edges_
HalfedgePropertyHandle<HalfedgeTopology> halfedges_
FacePropertyHandle<FaceTopology> faces_
bool has_garbage_ = {false}
VertexPropertyHandle<bool> v_deleted_bits_
EdgePropertyHandle<bool> e_deleted_bits_
FacePropertyHandle<bool> f_deleted_bits_
Index n_deleted_vertices_ = {0}
Index n_deleted_edges_ = {0}
Index n_deleted_faces_ = {0}