49 #ifndef OPENMESH_HANDLES_HH
50 #define OPENMESH_HANDLES_HH
55 #include <OpenMesh/Core/System/config.h>
71 explicit BaseHandle(
int _idx=-1) : idx_(_idx) {}
74 int idx()
const {
return idx_; }
84 bool operator==(
const BaseHandle& _rhs)
const {
85 return (this->idx_ == _rhs.idx_);
88 bool operator!=(
const BaseHandle& _rhs)
const {
89 return (this->idx_ != _rhs.idx_);
92 bool operator<(
const BaseHandle& _rhs)
const {
93 return (this->idx_ < _rhs.idx_);
98 void __increment() { ++idx_; }
99 void __decrement() { --idx_; }
101 void __increment(
int amount) { idx_ += amount; }
102 void __decrement(
int amount) { idx_ -= amount; }
110 inline size_t hash_value(
const BaseHandle& h) {
return h.idx(); }
117 return (_os << _hnd.
idx());
157 #include <functional>
160 #if defined(_MSVC_VER)
161 # pragma warning(push)
162 # pragma warning(disable:4099) // For VC++ it is class hash
168 :
public std::unary_function<OpenMesh::BaseHandle, std::size_t>
178 struct hash<
OpenMesh::VertexHandle >
179 :
public std::unary_function<OpenMesh::VertexHandle, std::size_t>
189 struct hash<
OpenMesh::HalfedgeHandle >
190 :
public std::unary_function<OpenMesh::HalfedgeHandle, std::size_t>
201 :
public std::unary_function<OpenMesh::EdgeHandle, std::size_t>
212 :
public std::unary_function<OpenMesh::FaceHandle, std::size_t>
221 #if defined(_MSVC_VER)
222 # pragma warning(pop)
226 #endif // OM_HAS_HASH
229 #endif // OPENMESH_HANDLES_HH
Base class for all handle types.
Definition: Handles.hh:67
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:74
Handle for a vertex entity.
Definition: Handles.hh:125
bool is_valid() const
The handle is valid iff the index is not equal to -1.
Definition: Handles.hh:77
auto operator<<(std::ostream &os, const VectorT< Scalar, DIM > &_vec) -> typename std::enable_if< sizeof(decltype(os<< _vec[0])) >=0
output a vector by printing its space-separated compontens
Handle for a edge entity.
Definition: Handles.hh:139
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
void reset()
reset handle to be invalid
Definition: Handles.hh:80
void invalidate()
reset handle to be invalid
Definition: Handles.hh:82
Handle for a halfedge entity.
Definition: Handles.hh:132
Handle for a face entity.
Definition: Handles.hh:146