OpenMesh
|
Base type for a polygonal mesh. More...
#include <OpenMesh/Mesh/PolyMeshT.hh>
Public Types | |
typedef PolyMeshT< Kernel > | This |
Self type. Used to specify iterators/circulators. | |
typedef Kernel::VertexHandle | VertexHandle |
Handle for referencing the corresponding item. | |
typedef Kernel::HalfedgeHandle | HalfedgeHandle |
typedef Kernel::EdgeHandle | EdgeHandle |
typedef Kernel::FaceHandle | FaceHandle |
typedef Kernel::VertexIter | VertexIter |
typedef Kernel::HalfedgeIter | HalfedgeIter |
typedef Kernel::EdgeIter | EdgeIter |
typedef Kernel::FaceIter | FaceIter |
typedef Kernel::ConstVertexIter | ConstVertexIter |
typedef Kernel::ConstHalfedgeIter | ConstHalfedgeIter |
typedef Kernel::ConstEdgeIter | ConstEdgeIter |
typedef Kernel::ConstFaceIter | ConstFaceIter |
Mesh Items | |
typedef Kernel::Scalar | Scalar |
Scalar type. | |
typedef Kernel::Point | Point |
Coordinate type. | |
typedef Kernel::Normal | Normal |
Normal type. | |
typedef Kernel::Color | Color |
Color type. | |
typedef Kernel::TexCoord1D | TexCoord1D |
TexCoord1D type. | |
typedef Kernel::TexCoord2D | TexCoord2D |
TexCoord2D type. | |
typedef Kernel::TexCoord3D | TexCoord3D |
TexCoord3D type. | |
typedef Kernel::Vertex | Vertex |
Vertex type. | |
typedef Kernel::Halfedge | Halfedge |
Halfedge type. | |
typedef Kernel::Edge | Edge |
Edge type. | |
typedef Kernel::Face | Face |
Face type. | |
Mesh Circulators | |
Refer to OpenMesh::Mesh::Iterators or Mesh Iterators and Circulators for documentation. | |
typedef Kernel::VertexVertexIter | VertexVertexIter |
Circulator. | |
typedef Kernel::VertexOHalfedgeIter | VertexOHalfedgeIter |
Circulator. | |
typedef Kernel::VertexIHalfedgeIter | VertexIHalfedgeIter |
Circulator. | |
typedef Kernel::VertexEdgeIter | VertexEdgeIter |
Circulator. | |
typedef Kernel::VertexFaceIter | VertexFaceIter |
Circulator. | |
typedef Kernel::FaceVertexIter | FaceVertexIter |
Circulator. | |
typedef Kernel::FaceHalfedgeIter | FaceHalfedgeIter |
Circulator. | |
typedef Kernel::FaceEdgeIter | FaceEdgeIter |
Circulator. | |
typedef Kernel::FaceFaceIter | FaceFaceIter |
Circulator. | |
typedef Kernel::ConstVertexVertexIter | ConstVertexVertexIter |
Circulator. | |
typedef Kernel::ConstVertexOHalfedgeIter | ConstVertexOHalfedgeIter |
Circulator. | |
typedef Kernel::ConstVertexIHalfedgeIter | ConstVertexIHalfedgeIter |
Circulator. | |
typedef Kernel::ConstVertexEdgeIter | ConstVertexEdgeIter |
Circulator. | |
typedef Kernel::ConstVertexFaceIter | ConstVertexFaceIter |
Circulator. | |
typedef Kernel::ConstFaceVertexIter | ConstFaceVertexIter |
Circulator. | |
typedef Kernel::ConstFaceHalfedgeIter | ConstFaceHalfedgeIter |
Circulator. | |
typedef Kernel::ConstFaceEdgeIter | ConstFaceEdgeIter |
Circulator. | |
typedef Kernel::ConstFaceFaceIter | ConstFaceFaceIter |
Circulator. | |
Public Member Functions | |
template<typename T > | |
PolyMeshT (const T &t) | |
VertexHandle | new_vertex () |
Uses default copy and assignment operator. More... | |
VertexHandle | new_vertex (const Point &_p) |
Adds a new vertex initialized to a custom position. More... | |
VertexHandle | new_vertex_dirty (const Point &_p) |
Same as new_vertex(const Point&) but never shrinks, only enlarges the vertex property vectors. More... | |
VertexHandle | add_vertex (const Point &_p) |
Alias for new_vertex(const Point&). | |
VertexHandle | add_vertex_dirty (const Point &_p) |
Alias for new_vertex_dirty(). | |
void | calc_edge_vector (EdgeHandle _eh, Normal &_edge_vec) const |
Calculates the edge vector as the vector defined by the halfedge with id #0 (see below) | |
Normal | calc_edge_vector (EdgeHandle _eh) const |
Calculates the edge vector as the vector defined by the halfedge with id #0 (see below) | |
void | calc_edge_vector (HalfedgeHandle _heh, Normal &_edge_vec) const |
Calculates the edge vector as the difference of the the points defined by to_vertex_handle() and from_vertex_handle() | |
Normal | calc_edge_vector (HalfedgeHandle _heh) const |
Calculates the edge vector as the difference of the the points defined by to_vertex_handle() and from_vertex_handle() | |
Scalar | calc_edge_length (EdgeHandle _eh) const |
Scalar | calc_edge_length (HalfedgeHandle _heh) const |
Calculates the length of the edge _heh. | |
Scalar | calc_edge_sqr_length (EdgeHandle _eh) const |
Scalar | calc_edge_sqr_length (HalfedgeHandle _heh) const |
Point | calc_edge_midpoint (HalfedgeHandle _heh) const |
Calculates the midpoint of the halfedge _heh, defined by the positions of the two incident vertices. | |
Point | calc_edge_midpoint (EdgeHandle _eh) const |
Calculates the midpoint of the edge _eh, defined by the positions of the two incident vertices. | |
void | calc_sector_vectors (HalfedgeHandle _in_heh, Normal &_vec0, Normal &_vec1) const |
defines a consistent representation of a sector geometry: the halfedge _in_heh defines the sector orientation the vertex pointed by _in_heh defines the sector center _vec0 and _vec1 are resp. More... | |
Scalar | calc_sector_angle (HalfedgeHandle _in_heh) const |
calculates the sector angle. More... | |
void | calc_sector_normal (HalfedgeHandle _in_heh, Normal &_sector_normal) const |
calculates the normal (non-normalized) of the face sector defined by the angle <(_in_heh,next_halfedge(_in_heh)) | |
Scalar | calc_sector_area (HalfedgeHandle _in_heh) const |
calculates the area of the face sector defined by the angle <(_in_heh,next_halfedge(_in_heh)) NOTE: special cases (e.g. More... | |
Scalar | calc_dihedral_angle_fast (HalfedgeHandle _heh) const |
calculates the dihedral angle on the halfedge _heh More... | |
Scalar | calc_dihedral_angle_fast (EdgeHandle _eh) const |
calculates the dihedral angle on the edge _eh More... | |
Scalar | calc_dihedral_angle (HalfedgeHandle _heh) const |
Scalar | calc_dihedral_angle (EdgeHandle _eh) const |
unsigned int | find_feature_edges (Scalar _angle_tresh=OpenMesh::deg_to_rad(44.0)) |
tags an edge as a feature if its dihedral angle is larger than _angle_tresh returns the number of the found feature edges, requires edge_status property | |
void | split (FaceHandle _fh, const Point &_p) |
Face split (= 1-to-n split) | |
void | split (FaceHandle _fh, VertexHandle _vh) |
void | split (EdgeHandle _eh, const Point &_p) |
void | split (EdgeHandle _eh, VertexHandle _vh) |
Normal vector computation | |
void | update_normals () |
Compute normals for all primitives. More... | |
void | update_normal (FaceHandle _fh) |
Update normal for face _fh. | |
void | update_face_normals () |
Update normal vectors for all faces. More... | |
virtual Normal | calc_face_normal (FaceHandle _fh) const |
Calculate normal vector for face _fh. More... | |
Normal | calc_face_normal (const Point &_p0, const Point &_p1, const Point &_p2) const |
Calculate normal vector for face (_p0, _p1, _p2). More... | |
void | calc_face_centroid (FaceHandle _fh, Point &_pt) const |
calculates the average of the vertices defining _fh | |
Point | calc_face_centroid (FaceHandle _fh) const |
Computes and returns the average of the vertices defining _gh. | |
void | update_normal (HalfedgeHandle _heh, const double _feature_angle=0.8) |
Update normal for halfedge _heh. | |
void | update_halfedge_normals (const double _feature_angle=0.8) |
Update normal vectors for all halfedges. More... | |
virtual Normal | calc_halfedge_normal (HalfedgeHandle _heh, const double _feature_angle=0.8) const |
Calculate halfedge normal for one specific halfedge. More... | |
bool | is_estimated_feature_edge (HalfedgeHandle _heh, const double _feature_angle) const |
identifies feature edges w.r.t. More... | |
void | update_normal (VertexHandle _vh) |
Update normal for vertex _vh. | |
void | update_vertex_normals () |
Update normal vectors for all vertices. More... | |
Normal | calc_vertex_normal (VertexHandle _vh) const |
Calculate vertex normal for one specific vertex. More... | |
void | calc_vertex_normal_fast (VertexHandle _vh, Normal &_n) const |
Different methods for calculation of the normal at _vh: More... | |
void | calc_vertex_normal_correct (VertexHandle _vh, Normal &_n) const |
Compute normals for all primitives. More... | |
void | calc_vertex_normal_loop (VertexHandle _vh, Normal &_n) const |
Compute normals for all primitives. More... | |
enum | { IsPolyMesh = 1 } |
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex count! It only checks if the datatype is PolyMeshT or TriMeshT ) | |
enum | { IsTriMesh = 0 } |
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex count! It only checks if the datatype is PolyMeshT or TriMeshT ) | |
static bool | is_polymesh () |
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex count! It only checks if the datatype is PolyMeshT or TriMeshT ) | |
static bool | is_trimesh () |
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex count! It only checks if the datatype is PolyMeshT or TriMeshT ) | |
Base type for a polygonal mesh.
This is the base class for a polygonal mesh. It is parameterized by a mesh kernel that is given as a template argument. This class inherits all methods from its mesh kernel.
Kernel | template argument for the mesh kernel |
|
inline |
calculates the dihedral angle on the halfedge _heh
|
inline |
calculates the dihedral angle on the edge _eh
|
virtual |
Calculate normal vector for face _fh.
Reimplemented in OpenMesh::TriMeshT< Kernel >.
PolyMeshT< Kernel >::Normal OpenMesh::PolyMeshT< Kernel >::calc_face_normal | ( | const Point & | _p0, |
const Point & | _p1, | ||
const Point & | _p2 | ||
) | const |
Calculate normal vector for face (_p0, _p1, _p2).
|
virtual |
Calculate halfedge normal for one specific halfedge.
Calculate normal vector for halfedge _heh.
_heh | Handle of the halfedge |
_feature_angle | If the dihedral angle across this edge is greater than this value, the edge is considered as a feature edge (angle in radians) |
|
inline |
calculates the sector angle.
The vertex pointed by _in_heh defines the sector center The angle will be calculated between the given halfedge and the next halfedge.
Seen from the center vertex this will be the next halfedge in clockwise direction.
NOTE: only boundary concave sectors are treated correctly
|
inline |
calculates the area of the face sector defined by the angle <(_in_heh,next_halfedge(_in_heh)) NOTE: special cases (e.g.
concave sectors) are not handled correctly
|
inline |
defines a consistent representation of a sector geometry: the halfedge _in_heh defines the sector orientation the vertex pointed by _in_heh defines the sector center _vec0 and _vec1 are resp.
the first and the second vectors defining the sector
PolyMeshT< Kernel >::Normal OpenMesh::PolyMeshT< Kernel >::calc_vertex_normal | ( | VertexHandle | _vh | ) | const |
Calculate vertex normal for one specific vertex.
Calculate normal vector for vertex _vh by averaging normals of adjacent faces.
_vh | Handle of the vertex |
void OpenMesh::PolyMeshT< Kernel >::calc_vertex_normal_correct | ( | VertexHandle | _vh, |
Normal & | _n | ||
) | const |
Compute normals for all primitives.
Calls update_face_normals() , update_halfedge_normals() and update_vertex_normals() if the normals (i.e. the properties) exist.
void OpenMesh::PolyMeshT< Kernel >::calc_vertex_normal_fast | ( | VertexHandle | _vh, |
Normal & | _n | ||
) | const |
Different methods for calculation of the normal at _vh:
void OpenMesh::PolyMeshT< Kernel >::calc_vertex_normal_loop | ( | VertexHandle | _vh, |
Normal & | _n | ||
) | const |
Compute normals for all primitives.
Calls update_face_normals() , update_halfedge_normals() and update_vertex_normals() if the normals (i.e. the properties) exist.
bool OpenMesh::PolyMeshT< Kernel >::is_estimated_feature_edge | ( | HalfedgeHandle | _heh, |
const double | _feature_angle | ||
) | const |
identifies feature edges w.r.t.
the minimal dihedral angle for feature edges (in radians) and the status feature tag
|
inline |
Uses default copy and assignment operator.
Use them to assign two meshes of equal type. If the mesh types vary, use PolyMeshT::assign() instead. Adds a new default-initialized vertex.
|
inline |
Adds a new vertex initialized to a custom position.
|
inline |
Same as new_vertex(const Point&) but never shrinks, only enlarges the vertex property vectors.
If you are rebuilding a mesh that you erased with ArrayKernel::clean() or ArrayKernel::clean_keep_reservation() using this method instead of new_vertex(const Point &) saves reallocation and reinitialization of property memory.
void OpenMesh::PolyMeshT< Kernel >::update_face_normals | ( | ) |
Update normal vectors for all faces.
void OpenMesh::PolyMeshT< Kernel >::update_halfedge_normals | ( | const double | _feature_angle = 0.8 | ) |
Update normal vectors for all halfedges.
Uses the existing face normals to compute halfedge normals
void OpenMesh::PolyMeshT< Kernel >::update_normals | ( | ) |
Compute normals for all primitives.
Calls update_face_normals() , update_halfedge_normals() and update_vertex_normals() if the normals (i.e. the properties) exist.
void OpenMesh::PolyMeshT< Kernel >::update_vertex_normals | ( | ) |
Update normal vectors for all vertices.
Uses existing face normals to calculate new vertex normals.