39 #ifndef PCL_POINT_CLOUD_ITERATOR_HPP_
40 #define PCL_POINT_CLOUD_ITERATOR_HPP_
42 #include <pcl/cloud_iterator.h>
49 template <
class Po
intT>
55 , iterator_ (cloud.begin ())
78 return (&(*iterator_));
83 return (iterator_ - cloud_.begin ());
88 return (iterator_ - cloud_.begin ());
93 return cloud_.size ();
98 iterator_ = cloud_.begin ();
103 return (iterator_ != cloud_.end ());
113 template <
class Po
intT>
120 , iterator_ (indices_.begin ())
126 , indices_ (indices.indices)
127 , iterator_ (indices_.begin ())
145 return (cloud_.points [*iterator_]);
150 return (&(cloud_.points [*iterator_]));
160 return (iterator_ - indices_.begin ());
165 return indices_.size ();
170 iterator_ = indices_.begin ();
175 return (iterator_ != indices_.end ());
181 Indices::iterator iterator_;
187 template <
class Po
intT>
193 , iterator_ (cloud.begin ())
216 return (&(*iterator_));
221 return (
static_cast<unsigned>(iterator_ - cloud_.begin ()));
226 return (
static_cast<unsigned>(iterator_ - cloud_.begin ()));
229 std::size_t
size ()
const override
231 return cloud_.size ();
236 iterator_ = cloud_.begin ();
241 return (iterator_ != cloud_.end ());
251 template <
class Po
intT>
259 , iterator_ (indices_.begin ())
266 , indices_ (indices.indices)
267 , iterator_ (indices_.begin ())
285 return (cloud_[*iterator_]);
290 return (&(cloud_.points [*iterator_]));
295 return (
static_cast<unsigned>(*iterator_));
300 return (
static_cast<unsigned>(iterator_ - indices_.begin ()));
303 std::size_t
size ()
const override
305 return indices_.size ();
310 iterator_ = indices_.begin ();
315 return (iterator_ != indices_.end ());
321 Indices::iterator iterator_;
326 template <
class Po
intT>
333 template <
class Po
intT>
341 template <
class Po
intT>
349 template <
class Po
intT>
354 indices.reserve (corrs.size ());
357 for (
const auto &corr : corrs)
358 indices.push_back (corr.index_query);
362 for (
const auto &corr : corrs)
363 indices.push_back (corr.index_match);
369 template <
class Po
intT>
376 template <
class Po
intT>
void
379 iterator_->operator++ ();
383 template <
class Po
intT>
void
386 iterator_->operator++ (0);
390 template <
class Po
intT>
PointT&
393 return (iterator_->operator * ());
397 template <
class Po
intT>
PointT*
400 return (iterator_->operator-> ());
404 template <
class Po
intT>
unsigned
407 return (iterator_->getCurrentPointIndex ());
411 template <
class Po
intT>
unsigned
414 return (iterator_->getCurrentIndex ());
418 template <
class Po
intT> std::size_t
421 return (iterator_->size ());
425 template <
class Po
intT>
void
432 template <
class Po
intT>
bool
435 return (iterator_->isValid ());
440 template <
class Po
intT>
447 template <
class Po
intT>
455 template <
class Po
intT>
463 template <
class Po
intT>
468 indices.reserve (corrs.size ());
471 for (
const auto &corr : corrs)
472 indices.push_back (corr.index_query);
476 for (
const auto &corr : corrs)
477 indices.push_back (corr.index_match);
483 template <
class Po
intT>
490 template <
class Po
intT>
void
493 iterator_->operator++ ();
497 template <
class Po
intT>
void
500 iterator_->operator++ (0);
504 template <
class Po
intT>
const PointT&
507 return (iterator_->operator * ());
511 template <
class Po
intT>
const PointT*
514 return (iterator_->operator-> ());
518 template <
class Po
intT>
unsigned
521 return (iterator_->getCurrentPointIndex ());
525 template <
class Po
intT>
unsigned
528 return (iterator_->getCurrentIndex ());
532 template <
class Po
intT> std::size_t
535 return (iterator_->size ());
539 template <
class Po
intT>
void
546 template <
class Po
intT>
bool
549 return (iterator_->isValid ());
Iterator class for point clouds with or without given indices.
CloudIterator(PointCloud< PointT > &cloud)
unsigned getCurrentIndex() const
unsigned getCurrentPointIndex() const
std::size_t size() const
Size of the range the iterator is going through.
PointT * operator->() const
PointT & operator*() const
unsigned getCurrentPointIndex() const override
ConstIteratorIdx(const PointCloud< PointT > &cloud, const PointIndices &indices)
bool isValid() const override
std::size_t size() const override
ConstIteratorIdx(const PointCloud< PointT > &cloud, const Indices &indices)
unsigned getCurrentIndex() const override
~ConstIteratorIdx() override=default
DefaultConstIterator(const PointCloud< PointT > &cloud)
bool isValid() const override
std::size_t size() const override
unsigned getCurrentPointIndex() const override
~DefaultConstIterator() override=default
unsigned getCurrentIndex() const override
Iterator class for point clouds with or without given indices.
const PointT * operator->() const
unsigned getCurrentIndex() const
ConstCloudIterator(const PointCloud< PointT > &cloud)
unsigned getCurrentPointIndex() const
const PointT & operator*() const
std::size_t size() const
Size of the range the iterator is going through.
~DefaultIterator()=default
unsigned getCurrentPointIndex() const
PointT & operator*() const
unsigned getCurrentIndex() const
DefaultIterator(PointCloud< PointT > &cloud)
IteratorIdx(PointCloud< PointT > &cloud, const Indices &indices)
unsigned getCurrentIndex() const
PointT & operator*() const
unsigned getCurrentPointIndex() const
IteratorIdx(PointCloud< PointT > &cloud, const PointIndices &indices)
virtual ~IteratorIdx()=default
PointCloud represents the base class in PCL for storing collections of 3D points.
typename VectorType::iterator iterator
typename VectorType::const_iterator const_iterator
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
IndicesAllocator<> Indices
Type used for indices in PCL.
A point structure representing Euclidean xyz coordinates, and the RGB color.