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

- Class List
- Class Hierarchy
- Class Members

# OpenMesh::Concepts::KernelT< FinalMeshItems > Class Template Reference
[Interface Concepts]

This class describes the minimum interface a mesh kernel has to implement (because the resulting mesh will rely on this interface). More...

`#include <MeshKernel.hh>`

List of all members.

## Public Types
Mesh Items
typedef FinalMeshItems::Vertex | Vertex
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::Halfedge | Halfedge
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::Edge | Edge
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::Face | Face
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::Point | Point
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::Scalar | Scalar
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::Normal | Normal
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::Color | Color
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::TexCoord | TexCoord
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::VertexHandle | VertexHandle
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::HalfedgeHandle | HalfedgeHandle
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::EdgeHandle | EdgeHandle
| Derive this type from the FinalMeshItems.
typedef FinalMeshItems::FaceHandle | FaceHandle
| Derive this type from the FinalMeshItems.
Kernel Iterators
typedef SomeIterator | KernelVertexIter
| This type depends on the container type in use.
typedef SomeIterator | KernelConstVertexIter
| This type depends on the container type in use.
typedef SomeIterator | KernelEdgeIter
| This type depends on the container type in use.
typedef SomeIterator | KernelConstEdgeIter
| This type depends on the container type in use.
typedef SomeIterator | KernelFaceIter
| This type depends on the container type in use.
typedef SomeIterator | KernelConstFaceIter
| This type depends on the container type in use.
## Public Member Functions
KernelT & | operator= (const KernelT &_rhs)
| Assignment operator.
void | reserve (unsigned int _n_vertices, unsigned int _n_edges, unsigned int _n_faces)
| Reserve memory for vertices, edges, faces.
Handle -> Item.
const Vertex & | vertex (VertexHandle _h) const
| Translate handle to item (see also OpenMesh::PolyMeshT::deref()).
Vertex & | vertex (VertexHandle _h)
| Translate handle to item (see also OpenMesh::PolyMeshT::deref()).
const Halfedge & | halfedge (HalfedgeHandle _h) const
| Translate handle to item (see also OpenMesh::PolyMeshT::deref()).
Halfedge & | halfedge (HalfedgeHandle _h)
| Translate handle to item (see also OpenMesh::PolyMeshT::deref()).
const Edge & | edge (EdgeHandle _h) const
| Translate handle to item (see also OpenMesh::PolyMeshT::deref()).
Edge & | edge (EdgeHandle _h)
| Translate handle to item (see also OpenMesh::PolyMeshT::deref()).
const Face & | face (FaceHandle _h) const
| Translate handle to item (see also OpenMesh::PolyMeshT::deref()).
Face & | face (FaceHandle _h)
| Translate handle to item (see also OpenMesh::PolyMeshT::deref()).
Item -> Handle
VertexHandle | handle (const Vertex &_v) const
| Translate item to handle.
HalfedgeHandle | handle (const Halfedge &_he) const
| Translate item to handle.
EdgeHandle | handle (const Edge &_e) const
| Translate item to handle.
FaceHandle | handle (const Face &_f) const
| Translate item to handle.
Get the i'th item
VertexHandle | vertex_handle (unsigned int _i) const
| Get the i'th item.
HalfedgeHandle | halfedge_handle (unsigned int _i) const
| Get the i'th item.
EdgeHandle | edge_handle (unsigned int _i) const
| Get the i'th item.
FaceHandle | face_handle (unsigned int _i) const
| Get the i'th item.
Delete items
void | clear ()
| Delete all items, i.e. clear all item containers.
void | garbage_collection ()
| Remove all items that are marked as deleted from the corresponding containers.
void | remove_last_vertex ()
| Remove the last vertex imidiately, i.e.
void | remove_last_edge ()
| Remove the last edge imidiately, i.e.
void | remove_last_face ()
| Remove the last face imidiately, i.e.
Number of elements
unsigned int | n_vertices () const
| Returns number of vertices.
unsigned int | n_halfedges () const
| Returns number of halfedges (should be 2*n_edges()).
unsigned int | n_edges () const
| Returns number of edges.
unsigned int | n_faces () const
| Returns number of faces.
bool | vertices_empty () const
| Is the vertex container empty?
bool | halfedges_empty () const
| Is the halfedge container empty (should be the same as edges_empty()).
bool | edges_empty () const
| Is the edge container empty?
bool | faces_empty () const
| Is the face container empty?
Vertex connectivity
HalfedgeHandle | halfedge_handle (VertexHandle _vh) const
| Get an outgoing halfedge of a given vertex.
void | set_halfedge_handle (VertexHandle _vh, HalfedgeHandle _heh)
| Set the outgoing halfedge handle of a given vertex.
const Point & | point (VertexHandle _vh) const
| Get the coordinate of a vertex.
const Point & | point (const Vertex &_v) const
| Get the coordinate of a vertex.
void | set_point (VertexHandle _vh, const Point &_p)
| Set the coordinate of a vertex.
void | set_point (Vertex &_v, const Point &_p)
| Set the coordinate of a vertex.
Halfedge connectivity
VertexHandle | to_vertex_handle (HalfedgeHandle _heh) const
| Get the vertex the halfedge points to.
VertexHandle | from_vertex_handle (HalfedgeHandle _heh) const
| Get the vertex the halfedge starts from (implemented as to-handle of the opposite halfedge, provided for convenience).
void | set_vertex_handle (HalfedgeHandle _heh, VertexHandle _vh)
| Set the to-vertex-handle of the halfedge.
FaceHandle | face_handle (HalfedgeHandle _heh) const
| Get the face the halfedge belongs to.
void | set_face_handle (HalfedgeHandle _heh, FaceHandle _fh)
| Set the face the halfedge belongs to.
HalfedgeHandle | next_halfedge_handle (HalfedgeHandle _heh) const
| Get the next halfedge handle.
void | set_next_halfedge_handle (HalfedgeHandle _heh, HalfedgeHandle _nheh)
| Set the next halfedge handle.
HalfedgeHandle | prev_halfedge_handle (HalfedgeHandle _heh) const
| Get the previous halfedge of the given halfedge.
HalfedgeHandle | opposite_halfedge_handle (HalfedgeHandle _heh) const
| Get the opposite halfedge.
HalfedgeHandle | ccw_rotated_halfedge_handle (HalfedgeHandle _heh) const
| Counter-clockwise rotate the given halfedge around its from vertex.
HalfedgeHandle | cw_rotated_halfedge_handle (HalfedgeHandle _heh) const
| Clockwise rotate the given halfedge around its from vertex.
EdgeHandle | edge_handle (HalfedgeHandle _heh) const
| Get the edge the current halfedge it contained in.
Edge connectivity
HalfedgeHandle | halfedge_handle (EdgeHandle _eh, unsigned int _i) const
| Get the first or second halfedge of the given edge.
Face connectivity
HalfedgeHandle | halfedge_handle (FaceHandle _fh) const
| Get a halfedge belonging to the face.
void | set_halfedge_handle (FaceHandle _fh, HalfedgeHandle _heh)
| Set one halfedge of the face.
set/get value of a standard property
const Point & | point (VertexHandle _vh) const
| Get position.
void | set_point (VertexHandle _vh, const Point &_p)
| Set position.
Point & | point (VertexHandle _vh)
| Convenience function.
const Normal & | normal (VertexHandle _vh) const
| Get normal.
void | set_normal (VertexHandle _vh, const Normal &_n)
| Set normal.
const Color & | color (VertexHandle _vh) const
| Get color.
void | set_color (VertexHandle _vh, const Color &_c) const TexCoord &texcoord(VertexHandle _vh) const
| Get texture coordinate.
void | set_texcoord (VertexHandle _vh, const TexCoord &_t)
| Set texture coordinate.
const StatusInfo & | status (VertexHandle _vh) const
| Get status.
StatusInfo & | status (VertexHandle _vh)
| Get status.
const StatusInfo & | status (HalfedgeHandle _vh) const
| Get status.
StatusInfo & | status (HalfedgeHandle _vh)
| Get status.
const StatusInfo & | status (EdgeHandle _vh) const
| Get status.
StatusInfo & | status (EdgeHandle _vh)
| Get status.
const Normal & | normal (FaceHandle _fh) const
| Get normal.
void | set_normal (FaceHandle _fh, const Normal &_n)
| Set normal.
const Color & | color (FaceHandle _fh) const
| Get color.
void | set_color (FaceHandle _fh, const Color &_c)
| Set color.
const StatusInfo & | status (FaceHandle _vh) const
| Get status.
StatusInfo & | status (FaceHandle _vh)
| Get status.
Dynamically add standard properties
void | request_vertex_normals ()
| Request property.
void | request_vertex_colors ()
| Request property.
void | request_vertex_texcoords ()
| Request property.
void | request_vertex_status ()
| Request property.
void | request_halfedge_status ()
| Request property.
void | request_edge_status ()
| Request property.
void | request_face_normals ()
| Request property.
void | request_face_colors ()
| Request property.
void | request_face_status ()
| Request property.
Remove standard properties
void | release_vertex_normals ()
| Remove property.
void | release_vertex_colors ()
| Remove property.
void | release_vertex_texcoords ()
| Remove property.
void | release_vertex_status ()
| Remove property.
void | release_halfedge_status ()
| Remove property.
void | release_edge_status ()
| Remove property.
void | release_face_normals ()
| Remove property.
void | release_face_colors ()
| Remove property.
void | release_face_status ()
| Remove property.
Check availability of standard properties
bool | has_vertex_normals () const
| Is property available?
bool | has_vertex_colors () const
| Is property available?
bool | has_vertex_texcoords () const
| Is property available?
bool | has_vertex_status () const
| Is property available?
bool | has_edge_status () const
| Is property available?
bool | has_halfedge_status () const
| Is property available?
bool | has_face_normals () const
| Is property available?
bool | has_face_colors () const
| Is property available?
bool | has_face_status () const
| Is property available?
Property management - add property
template<typename T>
bool | add_property ([VEHFM]PropHandleT< T > &_ph, const std::string &_name="")
| Add property.
Property management - remove property
template<typename T>
void | remove_property ([VEHFM]PropHandleT< T > &)
| Remove property.
Property management - get property by name
template<typename T>
bool | get_property_handle ([VEHFM]PropHandleT< T > &ph, const std::string &_n) const
| Get property handle by name.
Property management - get property
template<typename T>
PropertyT< T > & | property ([VEHF]PropHandleT< T > _ph)
| Get property.
template<typename T>
const PropertyT< T > & | property ([VEHF]PropHandleT< T > _ph) const
| Get property.
template<typename T>
PropertyT< T > & | mproperty (MPropHandleT< T > _ph)
| Get property.
template<typename T>
const PropertyT< T > & | mproperty (MPropHandleT< T > _ph) const
| Get property.
Property management - get property value for an item
template<typename T>
T & | property (VPropHandleT< T > _ph, VertexHandle _vh)
| Get value for item represented by the handle.
template<typename T>
const T & | property (VPropHandleT< T > _ph, VertexHandle _vh) const
| Get value for item represented by the handle.
template<typename T>
T & | property (EPropHandleT< T > _ph, EdgeHandle _vh)
| Get value for item represented by the handle.
template<typename T>
const T & | property (EPropHandleT< T > _ph, EdgeHandle _vh) const
| Get value for item represented by the handle.
template<typename T>
T & | property (HPropHandleT< T > _ph, HalfedgeHandle _vh)
| Get value for item represented by the handle.
template<typename T>
const T & | property (HPropHandleT< T > _ph, HalfedgeHandle _vh) const
| Get value for item represented by the handle.
template<typename T>
T & | property (FPropHandleT< T > _ph, FaceHandle _vh)
| Get value for item represented by the handle.
template<typename T>
const T & | property (FPropHandleT< T > _ph, FaceHandle _vh) const
| Get value for item represented by the handle.
template<typename T>
T & | property (MPropHandleT< T > _ph)
| Get value for item represented by the handle.
template<typename T>
const T & | property (MPropHandleT< T > _ph) const
| Get value for item represented by the handle.
Low-level adding new items
VertexHandle | new_vertex ()
| Add a new (default) vertex.
VertexHandle | new_vertex (const Point &_p)
| Add a new vertex with a given point coordinate.
VertexHandle | new_vertex (const Vertex &_v)
| Add a new vertex (copied from the given one).
HalfedgeHandle | new_edge (VertexHandle _start_vertex_handle, VertexHandle _end_vertex_handle)
| Add a new edge from `_start_vertex_handle` to `_end_vertex_handle`.
FaceHandle | new_face ()
| Adding a new face.
FaceHandle | new_face (const Face &_f)
| Adding a new face (copied from a `_f`).
Kernel item iterators
KernelVertexIter | vertices_begin ()
| Kernel item iterator.
KernelConstVertexIter | vertices_begin () const
| Kernel item iterator.
KernelVertexIter | vertices_end ()
| Kernel item iterator.
KernelConstVertexIter | vertices_end () const
| Kernel item iterator.
KernelEdgeIter | edges_begin ()
| Kernel item iterator.
KernelConstEdgeIter | edges_begin () const
| Kernel item iterator.
KernelEdgeIter | edges_end ()
| Kernel item iterator.
KernelConstEdgeIter | edges_end () const
| Kernel item iterator.
KernelFaceIter | faces_begin ()
| Kernel item iterator.
KernelConstFaceIter | faces_begin () const
| Kernel item iterator.
KernelFaceIter | faces_end ()
| Kernel item iterator.
KernelConstFaceIter | faces_end () const
| Kernel item iterator.

## Detailed Description

### template<class FinalMeshItems>
class OpenMesh::Concepts::KernelT< FinalMeshItems >

This class describes the minimum interface a mesh kernel has to implement (because the resulting mesh will rely on this interface).

This is the template class the actually holds the mesh kernel implementation. All functions marked as internal should only be used by the mesh class (that inherits the kernel). The mesh may then provide wrapper functions that provide the same functionality.

Todo:
  Check, if the member list is complete.

## Member Function Documentation

template<class FinalMeshItems>

void OpenMesh::Concepts::KernelT< FinalMeshItems >::reserve | ( | unsigned int | _n_vertices,
|  | unsigned int | _n_edges,
|  | unsigned int | _n_faces |
| ) |  |  |

Reserve memory for vertices, edges, faces.

Reserve memory for the mesh items vertices, edges, faces. Use this method if you can estimate the memory consumption, for instance in algorithm expanding the mesh. Depending on the underlying array type you might be better of using this method, then letting the array type decide when to increase the capacity. For instance the STL vector class `std::vector` (used in the supplied ArrayKernelT) doubles the capacity if it is exhausted. This might lead to an memory allocation exception, though an smaller increment would be enough.

template<class FinalMeshItems>

void OpenMesh::Concepts::KernelT< FinalMeshItems >::garbage_collection | ( |  | ) |

Remove all items that are marked as deleted from the corresponding containers.

Note:
  Needs the Attributes::Status attribute

  This function may not be implemented for all kernels.

template<class FinalMeshItems>

void OpenMesh::Concepts::KernelT< FinalMeshItems >::remove_last_vertex | ( |  | ) | `[inline]`

Remove the last vertex imidiately, i.e.

call pop_back() for the VertexContainer.

template<class FinalMeshItems>

void OpenMesh::Concepts::KernelT< FinalMeshItems >::remove_last_edge | ( |  | ) | `[inline]`

Remove the last edge imidiately, i.e.

call pop_back() for the EdgeContainer. Used e.g. by the add_face() method of PolyMeshT

template<class FinalMeshItems>

void OpenMesh::Concepts::KernelT< FinalMeshItems >::remove_last_face | ( |  | ) | `[inline]`

Remove the last face imidiately, i.e.

call pop_back() for the FaceContainer. Used e.g. by the add_face() method of PolyMeshT

template<class FinalMeshItems>

FaceHandle OpenMesh::Concepts::KernelT< FinalMeshItems >::face_handle | ( | HalfedgeHandle | _heh | ) | const

Get the face the halfedge belongs to.

Note:
  The handle is invalid if the halfedge is a boundary halfedge

template<class FinalMeshItems>

void OpenMesh::Concepts::KernelT< FinalMeshItems >::set_next_halfedge_handle | ( | HalfedgeHandle | _heh,
|  | HalfedgeHandle | _nheh |
| ) |  |  |

Set the next halfedge handle.

Note:
  If the previous halfedge is also stored (see OpenMesh::Attributes::PrevHalfedge) then this method also has to set this link)

template<class FinalMeshItems>

HalfedgeHandle OpenMesh::Concepts::KernelT< FinalMeshItems >::prev_halfedge_handle | ( | HalfedgeHandle | _heh | ) | const

Get the previous halfedge of the given halfedge.

The implementation should take care of an existing OpenMesh::Attributes::PrevHalfedge attribute.

template<class FinalMeshItems>

void OpenMesh::Concepts::KernelT< FinalMeshItems >::set_color | ( | VertexHandle | _vh,
|  | const Color & | _c |
| ) |  |  | const

Get texture coordinate.

Parameters:

  _c | Set color

template<class FinalMeshItems>
template<typename T>

bool OpenMesh::Concepts::KernelT< FinalMeshItems >::add_property | ( | [VEHFM] PropHandleT< T > & | _ph,
|  | const std::string & | _name = `""` |
| ) |  |  |

Add property.

Adds a property.

Depending on the property handle type a vertex, (half-)edge, face or mesh property is added to the mesh. If the action fails the handle is invalid. On success the handle must be used to access the property data with property().

Parameters:

  | _ph | A property handle defining the data type to bind to mesh. On success the handle is valid else invalid.
  | _name | Optional name of property. Following restrictions apply to the name: Maximum length of name is 256 characters The prefixes matching "^[vhefm]:" are reserved for internal usage. The expression "^<.*>$" is reserved for internal usage.

Returns:
  `true` on success else `false`.

template<class FinalMeshItems>

VertexHandle OpenMesh::Concepts::KernelT< FinalMeshItems >::new_vertex | ( |  | ) |

Add a new (default) vertex.

For internal use only.

template<class FinalMeshItems>

VertexHandle OpenMesh::Concepts::KernelT< FinalMeshItems >::new_vertex | ( | const Point & | _p | ) |

Add a new vertex with a given point coordinate.

For internal use only.

template<class FinalMeshItems>

VertexHandle OpenMesh::Concepts::KernelT< FinalMeshItems >::new_vertex | ( | const Vertex & | _v | ) |

Add a new vertex (copied from the given one).

For internal use only.

template<class FinalMeshItems>

HalfedgeHandle OpenMesh::Concepts::KernelT< FinalMeshItems >::new_edge | ( | VertexHandle | _start_vertex_handle,
|  | VertexHandle | _end_vertex_handle |
| ) |  |  |

Add a new edge from `_start_vertex_handle` to `_end_vertex_handle`.

This method should add an edge (i.e. two opposite halfedges) and set the corresponding vertex handles of these halfedges.

For internal use only.

template<class FinalMeshItems>

FaceHandle OpenMesh::Concepts::KernelT< FinalMeshItems >::new_face | ( |  | ) |

Adding a new face.

For internal use only.

template<class FinalMeshItems>

FaceHandle OpenMesh::Concepts::KernelT< FinalMeshItems >::new_face | ( | const Face & | _f | ) |

Adding a new face (copied from a `_f`).

For internal use only.

template<class FinalMeshItems>

KernelVertexIter OpenMesh::Concepts::KernelT< FinalMeshItems >::vertices_begin | ( |  | ) |

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelConstVertexIter OpenMesh::Concepts::KernelT< FinalMeshItems >::vertices_begin | ( |  | ) | const

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelVertexIter OpenMesh::Concepts::KernelT< FinalMeshItems >::vertices_end | ( |  | ) |

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelConstVertexIter OpenMesh::Concepts::KernelT< FinalMeshItems >::vertices_end | ( |  | ) | const

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelEdgeIter OpenMesh::Concepts::KernelT< FinalMeshItems >::edges_begin | ( |  | ) |

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelConstEdgeIter OpenMesh::Concepts::KernelT< FinalMeshItems >::edges_begin | ( |  | ) | const

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelEdgeIter OpenMesh::Concepts::KernelT< FinalMeshItems >::edges_end | ( |  | ) |

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelConstEdgeIter OpenMesh::Concepts::KernelT< FinalMeshItems >::edges_end | ( |  | ) | const

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelFaceIter OpenMesh::Concepts::KernelT< FinalMeshItems >::faces_begin | ( |  | ) |

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelConstFaceIter OpenMesh::Concepts::KernelT< FinalMeshItems >::faces_begin | ( |  | ) | const

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelFaceIter OpenMesh::Concepts::KernelT< FinalMeshItems >::faces_end | ( |  | ) |

Kernel item iterator.

For internal use only.

template<class FinalMeshItems>

KernelConstFaceIter OpenMesh::Concepts::KernelT< FinalMeshItems >::faces_end | ( |  | ) | const

Kernel item iterator.

For internal use only.

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

- Doc/Concepts/MeshKernel.hh