43 #include <boost/operators.hpp>
54 template <
class IndexTagT>
57 template <
class IndexTagT>
59 operator>>(std::istream& is, MeshIndex<IndexTagT>&);
61 template <
class IndexTagT>
63 : boost::totally_ordered<
65 boost::unit_steppable<MeshIndex<IndexTagT>,
66 boost::additive<MeshIndex<IndexTagT>
71 using Base = boost::totally_ordered<
73 boost::unit_steppable<MeshIndex<IndexTagT>,
74 boost::additive<MeshIndex<IndexTagT>>>>;
83 explicit MeshIndex(
const int index) : index_(index) {}
117 return (this->
get() < other.
get());
124 return (this->
get() == other.
get());
147 index_ += other.
get();
155 index_ -= other.
get();
168 template <
class IndexTagT>
172 return (os << index.
get());
176 template <
class IndexTagT>
180 return (is >> index.index_);
void invalidate()
Invalidate the index.
boost::totally_ordered< MeshIndex< IndexTagT >, boost::unit_steppable< MeshIndex< IndexTagT >, boost::additive< MeshIndex< IndexTagT > >> > Base
Self & operator--()
Decrement operators (with boost::operators): -- (pre and post)
MeshIndex< IndexTagT > Self
bool isValid() const
Returns true if the index is valid.
void set(const int index)
Set the index.
int get() const
Get the index.
bool operator==(const Self &other) const
Comparison operators (with boost::operators): == !=.
Self & operator+=(const Self &other)
Addition operators (with boost::operators): + +=.
Self & operator++()
Increment operators (with boost::operators): ++ (pre and post)
bool operator<(const Self &other) const
Comparison operators (with boost::operators): < > <= >=.
Self & operator-=(const Self &other)
Subtraction operators (with boost::operators): - -=.
MeshIndex(const int index)
Constructor.
pcl::detail::MeshIndex< struct EdgeIndexTag > EdgeIndex
Index used to access elements in the half-edge mesh.
pcl::detail::MeshIndex< struct HalfEdgeIndexTag > HalfEdgeIndex
Index used to access elements in the half-edge mesh.
std::istream & operator>>(std::istream &is, MeshIndex< IndexTagT > &)
istream operator.
std::ostream & operator<<(std::ostream &os, const MeshIndex< IndexTagT > &index)
ostream operator.
EdgeIndex toEdgeIndex(const HalfEdgeIndex &index)
Convert the given half-edge index to an edge index.
HalfEdgeIndex toHalfEdgeIndex(const EdgeIndex &index, const bool get_first=true)
Convert the given edge index to a half-edge index.