- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# OpenMesh::TriMeshT< Kernel > Class Template Reference

Base type for a triangle mesh. More...

`#include <OpenMesh/Mesh/TriMeshT.hh>`

Inheritance diagram for OpenMesh::TriMeshT< Kernel >:

List of all members.

enum |
| Determine whether this is a PolyMeshT or TriMeshT.
enum |
| Determine whether this is a PolyMeshT or TriMeshT.
static bool | is_polymesh ()
| Determine whether this is a PolyMeshT or TriMeshT.
static bool | is_trimesh ()
| Determine whether this is a PolyMeshT or TriMeshT.
## Public Types
typedef TriMeshT< Kernel > | This
| Self type. Used to specify iterators/circulators.
typedef PolyMesh::Scalar | Scalar
| Scalar type.
typedef PolyMesh::Point | Point
| Coordinate type.
typedef PolyMesh::Normal | Normal
| Normal type.
typedef PolyMesh::Color | Color
| Color type.
typedef PolyMesh::TexCoord1D | TexCoord1D
| TexCoord1D type.
typedef PolyMesh::TexCoord2D | TexCoord2D
| TexCoord2D type.
typedef PolyMesh::TexCoord3D | TexCoord3D
| TexCoord3D type.
typedef PolyMesh::Vertex | Vertex
| Vertex type.
typedef PolyMesh::Halfedge | Halfedge
| Halfedge type.
typedef PolyMesh::Edge | Edge
| Edge type.
typedef PolyMesh::Face | Face
| Face type.
typedef PolyMesh::VertexHandle | VertexHandle
| Handle for referencing the corresponding item.
typedef PolyMesh::HalfedgeHandle | HalfedgeHandle
| Handle for referencing the corresponding item.
typedef PolyMesh::EdgeHandle | EdgeHandle
| Handle for referencing the corresponding item.
typedef PolyMesh::FaceHandle | FaceHandle
| Handle for referencing the corresponding item.
typedef PolyMesh::VertexIter | VertexIter
| Linear iterator.
typedef PolyMesh::ConstVertexIter | ConstVertexIter
| Linear iterator.
typedef PolyMesh::EdgeIter | EdgeIter
| Linear iterator.
typedef PolyMesh::ConstEdgeIter | ConstEdgeIter
| Linear iterator.
typedef PolyMesh::FaceIter | FaceIter
| Linear iterator.
typedef PolyMesh::ConstFaceIter | ConstFaceIter
| Linear iterator.
typedef PolyMesh::VertexVertexIter | VertexVertexIter
| Circulator.
typedef PolyMesh::VertexOHalfedgeIter | VertexOHalfedgeIter
| Circulator.
typedef PolyMesh::VertexIHalfedgeIter | VertexIHalfedgeIter
| Circulator.
typedef PolyMesh::VertexEdgeIter | VertexEdgeIter
| Circulator.
typedef PolyMesh::VertexFaceIter | VertexFaceIter
| Circulator.
typedef PolyMesh::FaceVertexIter | FaceVertexIter
| Circulator.
typedef PolyMesh::FaceHalfedgeIter | FaceHalfedgeIter
| Circulator.
typedef PolyMesh::FaceEdgeIter | FaceEdgeIter
| Circulator.
typedef PolyMesh::FaceFaceIter | FaceFaceIter
| Circulator.
typedef PolyMesh::ConstVertexVertexIter | ConstVertexVertexIter
| Circulator.
typedef PolyMesh::ConstVertexOHalfedgeIter | ConstVertexOHalfedgeIter
| Circulator.
typedef PolyMesh::ConstVertexIHalfedgeIter | ConstVertexIHalfedgeIter
| Circulator.
typedef PolyMesh::ConstVertexEdgeIter | ConstVertexEdgeIter
| Circulator.
typedef PolyMesh::ConstVertexFaceIter | ConstVertexFaceIter
| Circulator.
typedef PolyMesh::ConstFaceVertexIter | ConstFaceVertexIter
| Circulator.
typedef PolyMesh::ConstFaceHalfedgeIter | ConstFaceHalfedgeIter
| Circulator.
typedef PolyMesh::ConstFaceEdgeIter | ConstFaceEdgeIter
| Circulator.
typedef PolyMesh::ConstFaceFaceIter | ConstFaceFaceIter
| Circulator.
## Public Member Functions
| TriMeshT ()
| Default constructor.
| ~TriMeshT ()
| Destructor.
TriMeshT & | operator= (const TriMeshT &_rhs)
| Assignment operator.
VertexHandle | opposite_vh (HalfedgeHandle _heh) const
| Returns the opposite vertex to the halfedge _heh in the face referenced by _heh returns InvalidVertexHandle if the _heh is boundary.
VertexHandle | opposite_he_opposite_vh (HalfedgeHandle _heh) const
| Returns the opposite vertex to the opposite halfedge of _heh in the face referenced by it returns InvalidVertexHandle if the opposite halfedge is boundary.
void | remove_edge (HalfedgeHandle _hh)
| Helper for halfedge collapse.
void | remove_loop (HalfedgeHandle _hh)
| Helper for halfedge collapse.
HalfedgeHandle | insert_loop (HalfedgeHandle _hh)
| Helper for vertex split.
HalfedgeHandle | insert_edge (VertexHandle _vh, HalfedgeHandle _h0, HalfedgeHandle _h1)
| Helper for vertex split.
Addding items to a mesh
FaceHandle | add_face (const std::vector< VertexHandle > &_vhandles)
| Override OpenMesh::Mesh::PolyMeshT::add_face().
FaceHandle | add_face (VertexHandle _v0, VertexHandle _v1, VertexHandle _v2)
| Add face wrapper that accepts three vertex handles.
template<class OtherMesh>
TriMeshT & | assign (const OtherMesh &_rhs)
| Inherited assignment method.
Topology modifying operators
void | collapse (HalfedgeHandle _heh)
| Halfedge collapse: collapse the from-vertex of halfedge _heh into its to-vertex.
bool | is_collapse_ok (HalfedgeHandle _heh)
| Returns whether collapsing halfedge _heh is ok or would lead to topological inconsistencies.
HalfedgeHandle | vertex_split (Point _v0_point, VertexHandle _v1, VertexHandle _vl, VertexHandle _vr)
| Vertex Split: inverse operation to collapse().
HalfedgeHandle | vertex_split (VertexHandle v0, VertexHandle v1, VertexHandle vl, VertexHandle vr)
| Vertex Split: inverse operation to collapse().
bool | is_flip_ok (EdgeHandle _eh) const
| Check whether flipping _eh is topologically correct.
void | flip (EdgeHandle _eh)
| Flip edge _eh.
void | split (EdgeHandle _eh, VertexHandle _vh)
| Edge split (= 2-to-4 split).
void | split (EdgeHandle _eh, const Point &_p)
| Edge split (= 2-to-4 split).
void | split (FaceHandle _fh, VertexHandle _vh)
| Face split (= 1-to-3 split, calls corresponding PolyMeshT function).
void | split (FaceHandle _fh, const Point &_p)
| Face split (= 1-to-3 split, calls corresponding PolyMeshT function).

## Detailed Description

### template<class Kernel>
class OpenMesh::TriMeshT< Kernel >

Base type for a triangle mesh.

Base type for a triangle mesh, parameterized by a mesh kernel. The mesh inherits all methods from the kernel class and the more general polygonal mesh PolyMeshT. Therefore it provides the same types for items, handles, iterators and so on.

Parameters:

  | Kernel,: | template argument for the mesh kernel

Note:
  You should use the predefined mesh-kernel combinations in Predefined Mesh Types

See also:
  Specifying your MyMesh

  OpenMesh::PolyMeshT

## Member Function Documentation

template<class Kernel>

TriMeshT& OpenMesh::TriMeshT< Kernel >::operator= | ( | const TriMeshT< Kernel > & | _rhs | ) | `[inline]`

Assignment operator.

See also:
  PolyMeshT::operator=()

template<class Kernel>

TriMeshT< Kernel >::FaceHandle OpenMesh::TriMeshT< Kernel >::add_face | ( | const std::vector< VertexHandle > & | _vhandles | ) |

Override OpenMesh::Mesh::PolyMeshT::add_face().

Faces that aren't triangles will be triangulated and added. In this case an invalid face handle will be returned.

face is triangle -> ok

face is not a triangle -> triangulate

Reimplemented from OpenMesh::PolyMeshT< Kernel >.

template<class Kernel>

FaceHandle OpenMesh::TriMeshT< Kernel >::add_face | ( | VertexHandle | _v0,
|  | VertexHandle | _v1,
|  | VertexHandle | _v2 |
| ) |  |  | `[inline]`

Add face wrapper that accepts three vertex handles.

Provided for convenience.

template<class Kernel>
template<class OtherMesh>

TriMeshT& OpenMesh::TriMeshT< Kernel >::assign | ( | const OtherMesh & | _rhs | ) |

Inherited assignment method.

See also:
  OpenMesh::PolyMeshT::assign()

Reimplemented from OpenMesh::PolyMeshT< Kernel >.

template<class Kernel>

void OpenMesh::TriMeshT< Kernel >::collapse | ( | HalfedgeHandle | _heh | ) |

Halfedge collapse: collapse the from-vertex of halfedge _heh into its to-vertex.

Attention:
  Needs vertex/edge/face status attribute in order to delete the items that degenerate.

Note:
  This function does not perform a garbage collection. It only marks degenerate items as deleted.

Attention:
  A halfedge collapse may lead to topological inconsistencies. Therefore you should check this using is_collapse_ok().

template<class Kernel>

bool OpenMesh::TriMeshT< Kernel >::is_collapse_ok | ( | HalfedgeHandle | _heh | ) |

Returns whether collapsing halfedge _heh is ok or would lead to topological inconsistencies.

Attention:
  This method need the Attributes::Status attribute and changes the tagged bit.

template<class Impl>

void OpenMesh::TriMeshT< Impl >::flip | ( | EdgeHandle | _eh | ) |

Flip edge _eh.

Check for topological correctness first using is_flip_ok().

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

- Core/Mesh/TriMeshT.hh
- Core/Mesh/TriMeshT.cc