43#include <boost/operators.hpp>
54template <
class IndexTagT>
57template <
class IndexTagT>
59operator>>(std::istream& is, MeshIndex<IndexTagT>&);
61template <
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();
167template <
class IndexTagT>
171 return (
os << index.get());
175template <
class IndexTagT>
179 return (
is >> index.index_);
Iterator class for point clouds with or without given indices.
void invalidate()
Invalidate the index.
Self & operator--()
Decrement operators (with boost::operators): -- (pre and post)
boost::totally_ordered< MeshIndex< IndexTagT >, boost::unit_steppable< MeshIndex< IndexTagT >, boost::additive< MeshIndex< IndexTagT > > > > Base
MeshIndex< IndexTagT > Self
bool isValid() const
Returns true if the index is valid.
void set(const int index)
Set the index.
Self & operator++()
Increment operators (with boost::operators): ++ (pre and post)
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-=(const Self &other)
Subtraction operators (with boost::operators): - -=.
bool operator<(const Self &other) const
Comparison operators (with boost::operators): < > <= >=.
MeshIndex(const int index)
Constructor.
pcl::detail::MeshIndex< struct HalfEdgeIndexTag > HalfEdgeIndex
Index used to access elements in the half-edge mesh.
pcl::detail::MeshIndex< struct EdgeIndexTag > EdgeIndex
Index used to access elements in the half-edge mesh.
std::ostream & operator<<(std::ostream &os, const MeshIndex< IndexTagT > &index)
ostream operator.
std::istream & operator>>(std::istream &is, MeshIndex< IndexTagT > &)
istream 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.