Merge branch 'invalid_handles' into 'master'

make all negative handles invalid, not just -1

Since opposite_halfedge_handle for a handle with idx -1 produces a handle with idx -2, it can be helpful to detect handles with -2 as index as invalid as well.

See merge request !96
This commit is contained in:
Jan Möbius
2016-10-21 10:37:39 +02:00

View File

@@ -73,8 +73,8 @@ public:
/// Get the underlying index of this handle
int idx() const { return idx_; }
/// The handle is valid iff the index is not equal to -1.
bool is_valid() const { return idx_ != -1; }
/// The handle is valid iff the index is not negative.
bool is_valid() const { return idx_ >= 0; }
/// reset handle to be invalid
void reset() { idx_=-1; }