OpenMesh::PolyMeshT< Kernel > Class Template Reference

#include <OpenMesh/Mesh/PolyMeshT.hh>

Inheritance diagram for OpenMesh::PolyMeshT< Kernel >:

Inheritance graph
[legend]
enum  { IsPolyMesh = 1 }
 Determine whether this is a PolyMeshT or TriMeshT.
enum  { IsTriMesh = 0 }
static bool is_polymesh ()
static bool is_trimesh ()

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 for documentation.

typedef Kernel::VertexVertexIter VertexVertexIter
 Circulator.
typedef Kernel::VertexOHalfedgeIter VertexOHalfedgeIter
typedef Kernel::VertexIHalfedgeIter VertexIHalfedgeIter
typedef Kernel::VertexEdgeIter VertexEdgeIter
typedef Kernel::VertexFaceIter VertexFaceIter
typedef Kernel::FaceVertexIter FaceVertexIter
typedef Kernel::FaceHalfedgeIter FaceHalfedgeIter
typedef Kernel::FaceEdgeIter FaceEdgeIter
typedef Kernel::FaceFaceIter FaceFaceIter
typedef
Kernel::ConstVertexVertexIter 
ConstVertexVertexIter
typedef
Kernel::ConstVertexOHalfedgeIter 
ConstVertexOHalfedgeIter
typedef
Kernel::ConstVertexIHalfedgeIter 
ConstVertexIHalfedgeIter
typedef Kernel::ConstVertexEdgeIter ConstVertexEdgeIter
typedef Kernel::ConstVertexFaceIter ConstVertexFaceIter
typedef Kernel::ConstFaceVertexIter ConstFaceVertexIter
typedef
Kernel::ConstFaceHalfedgeIter 
ConstFaceHalfedgeIter
typedef Kernel::ConstFaceEdgeIter ConstFaceEdgeIter
typedef Kernel::ConstFaceFaceIter ConstFaceFaceIter

Public Member Functions

VertexHandle new_vertex ()
VertexHandle new_vertex (const Point &_p)
VertexHandle add_vertex (const Point &_p)
void calc_edge_vector (EdgeHandle _eh, Normal &_edge_vec) const
void calc_edge_vector (HalfedgeHandle _heh, Normal &_edge_vec) const
Scalar calc_edge_length (EdgeHandle _eh) const
Scalar calc_edge_length (HalfedgeHandle _heh) const
Scalar calc_edge_sqr_length (EdgeHandle _eh) const
Scalar calc_edge_sqr_length (HalfedgeHandle _heh) const
void calc_sector_vectors (HalfedgeHandle _in_heh, Normal &_vec0, Normal &_vec1) const
Scalar calc_sector_angle (HalfedgeHandle _in_heh) const
void calc_sector_normal (HalfedgeHandle _in_heh, Normal &_sector_normal) const
Scalar calc_sector_area (HalfedgeHandle _in_heh) const
Scalar calc_dihedral_angle_fast (HalfedgeHandle _heh) const
Scalar calc_dihedral_angle_fast (EdgeHandle _eh) const
Scalar calc_dihedral_angle (HalfedgeHandle _heh) const
Scalar calc_dihedral_angle (EdgeHandle _eh) const
uint find_feature_edges (Scalar _angle_tresh=OpenMesh::deg_to_rad(44.0))
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 ()
void update_normal (FaceHandle _fh)
 Update normal for face _fh.
void update_face_normals ()
Normal calc_face_normal (FaceHandle _fh) const
Normal calc_face_normal (const Point &_p0, const Point &_p1, const Point &_p2) const
void calc_face_centroid (FaceHandle _fh, Point &_pt) const
void update_normal (VertexHandle _vh)
 Update normal for vertex _vh.
void update_vertex_normals ()
Normal calc_vertex_normal (VertexHandle _vh) const
void calc_vertex_normal_fast (VertexHandle _vh, Normal &_n) const
void calc_vertex_normal_correct (VertexHandle _vh, Normal &_n) const
void calc_vertex_normal_loop (VertexHandle _vh, Normal &_n) const

Detailed Description

template<class Kernel>
class OpenMesh::PolyMeshT< Kernel >

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.

Parameters:
Kernel,: template argument for the mesh kernel
Note:
You should use the predefined mesh-kernel combinations in mesh_types_group
See also:
mesh_type

Member Function Documentation

template<class Kernel>
VertexHandle OpenMesh::PolyMeshT< Kernel >::new_vertex (  )  [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.

template<class Kernel>
void OpenMesh::PolyMeshT< Kernel >::update_normals (  )  [inline]

Calls update_face_normals() and update_vertex_normals() if these normals (i.e. the properties) exist

template<class Kernel>
void OpenMesh::PolyMeshT< Kernel >::update_face_normals (  )  [inline]

Update normal vectors for all faces.

Attention:
Needs the Attributes::Normal attribute for faces.

template<class Kernel>
PolyMeshT< Kernel >::Normal OpenMesh::PolyMeshT< Kernel >::calc_face_normal ( FaceHandle  _fh  )  const [inline]

Calculate normal vector for face _fh.

template<class Kernel>
PolyMeshT< Kernel >::Normal OpenMesh::PolyMeshT< Kernel >::calc_face_normal ( const Point _p0,
const Point _p1,
const Point _p2 
) const [inline]

Calculate normal vector for face (_p0, _p1, _p2).

template<class Kernel>
void OpenMesh::PolyMeshT< Kernel >::update_vertex_normals (  )  [inline]

Update normal vectors for all vertices.

Attention:
Needs the Attributes::Normal attribute for faces and vertices.

template<class Kernel>
PolyMeshT< Kernel >::Normal OpenMesh::PolyMeshT< Kernel >::calc_vertex_normal ( VertexHandle  _vh  )  const [inline]

Calculate normal vector for vertex _vh by averaging normals of adjacent faces. Face normals have to be computed first.

Attention:
Needs the Attributes::Normal attribute for faces.

template<class Kernel>
void OpenMesh::PolyMeshT< Kernel >::calc_vertex_normal_fast ( VertexHandle  _vh,
Normal _n 
) const [inline]

Different methods for calculation of the normal at _vh:

  • -"-_fast - the default one - the same as calc vertex_normal()
    • needs the Attributes::Normal attribute for faces
  • -"-_correct - works properly for non-triangular meshes
    • does not need any attributes
  • -"-_loop - calculates loop surface normals
    • does not need any attributes

template<class Kernel>
void OpenMesh::PolyMeshT< Kernel >::calc_edge_vector ( EdgeHandle  _eh,
Normal _edge_vec 
) const [inline]

Calculates the edge vector as the vector defined by the halfedge with id #0 (see below)

template<class Kernel>
void OpenMesh::PolyMeshT< Kernel >::calc_edge_vector ( HalfedgeHandle  _heh,
Normal _edge_vec 
) const [inline]

Calculates the edge vector as the difference of the the points defined by to_vertex_handle() and from_vertex_handle()

template<class Kernel>
Scalar OpenMesh::PolyMeshT< Kernel >::calc_edge_length ( HalfedgeHandle  _heh  )  const [inline]

Calculates the length of the edge _heh

template<class Kernel>
void OpenMesh::PolyMeshT< Kernel >::calc_sector_vectors ( HalfedgeHandle  _in_heh,
Normal _vec0,
Normal _vec1 
) const [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

template<class Kernel>
Scalar OpenMesh::PolyMeshT< Kernel >::calc_sector_angle ( HalfedgeHandle  _in_heh  )  const [inline]

calculates the sector angle NOTE: only boundary concave sectors are treated correctly

template<class Kernel>
void OpenMesh::PolyMeshT< Kernel >::calc_sector_normal ( HalfedgeHandle  _in_heh,
Normal _sector_normal 
) const [inline]

calculates the normal (non-normalized) of the face sector defined by the angle <(_in_heh,next_halfedge(_in_heh))

template<class Kernel>
Scalar OpenMesh::PolyMeshT< Kernel >::calc_sector_area ( HalfedgeHandle  _in_heh  )  const [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

template<class Kernel>
Scalar OpenMesh::PolyMeshT< Kernel >::calc_dihedral_angle_fast ( HalfedgeHandle  _heh  )  const [inline]

calculates the dihedral angle on the halfedge _heh

Attention:
Needs the Attributes::Normal attribute for faces

template<class Kernel>
Scalar OpenMesh::PolyMeshT< Kernel >::calc_dihedral_angle_fast ( EdgeHandle  _eh  )  const [inline]

calculates the dihedral angle on the edge _eh

Attention:
Needs the Attributes::Normal attribute for faces

template<class Kernel>
uint OpenMesh::PolyMeshT< Kernel >::find_feature_edges ( Scalar  _angle_tresh = OpenMesh::deg_to_rad(44.0)  )  [inline]

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


The documentation for this class was generated from the following files:

Generated on Fri Jan 16 13:01:04 2009 by  doxygen 1.5.5