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 (
unsigned (iterator_ - cloud_.begin ()));
226 return (
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 (
unsigned (*iterator_));
300 return (
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_;
326template <
class Po
intT>
333template <
class Po
intT>
341template <
class Po
intT>
349template <
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);
369template <
class Po
intT>
376template <
class Po
intT>
void
379 iterator_->operator++ ();
383template <
class Po
intT>
void
386 iterator_->operator++ (0);
390template <
class Po
intT>
PointT&
393 return (iterator_->operator * ());
397template <
class Po
intT>
PointT*
400 return (iterator_->operator-> ());
404template <
class Po
intT>
unsigned
407 return (iterator_->getCurrentPointIndex ());
411template <
class Po
intT>
unsigned
414 return (iterator_->getCurrentIndex ());
418template <
class Po
intT> std::size_t
421 return (iterator_->size ());
425template <
class Po
intT>
void
432template <
class Po
intT>
bool
435 return (iterator_->isValid ());
440template <
class Po
intT>
447template <
class Po
intT>
455template <
class Po
intT>
463template <
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);
483template <
class Po
intT>
490template <
class Po
intT>
void
493 iterator_->operator++ ();
497template <
class Po
intT>
void
500 iterator_->operator++ (0);
504template <
class Po
intT>
const PointT&
507 return (iterator_->operator * ());
511template <
class Po
intT>
const PointT*
514 return (iterator_->operator-> ());
518template <
class Po
intT>
unsigned
521 return (iterator_->getCurrentPointIndex ());
525template <
class Po
intT>
unsigned
528 return (iterator_->getCurrentIndex ());
532template <
class Po
intT> std::size_t
535 return (iterator_->size ());
539template <
class Po
intT>
void
546template <
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)
PointT & operator*() const
IteratorIdx(PointCloud< PointT > &cloud, const Indices &indices)
unsigned getCurrentIndex() 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.