42 #ifndef OPENMESH_HANDLES_HH
43 #define OPENMESH_HANDLES_HH
48 #include <OpenMesh/Core/System/config.h>
64 explicit BaseHandle(
int _idx=-1) : idx_(_idx) {}
67 int idx()
const {
return idx_; }
77 bool operator==(
const BaseHandle& _rhs)
const {
78 return (this->idx_ == _rhs.idx_);
81 bool operator!=(
const BaseHandle& _rhs)
const {
82 return (this->idx_ != _rhs.idx_);
85 bool operator<(
const BaseHandle& _rhs)
const {
86 return (this->idx_ < _rhs.idx_);
91 void __increment() { ++idx_; }
92 void __decrement() { --idx_; }
106 return (_os << _hnd.
idx());
144 #endif // OPENMESH_HANDLES_HH
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:67
bool is_valid() const
The handle is valid iff the index is not equal to -1.
Definition: Handles.hh:70
Handle for a halfedge entity.
Definition: Handles.hh:121
void reset()
reset handle to be invalid
Definition: Handles.hh:73
Base class for all handle types.
Definition: Handles.hh:60
Handle for a edge entity.
Definition: Handles.hh:128
void invalidate()
reset handle to be invalid
Definition: Handles.hh:75
Handle for a face entity.
Definition: Handles.hh:135
std::ostream & operator<<(std::ostream &_os, const BaseHandle &_hnd)
Write handle _hnd to stream _os.
Definition: Handles.hh:104
Handle for a vertex entity.
Definition: Handles.hh:114