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 ())
80 return (&(*iterator_));
85 return (iterator_ - cloud_.begin ());
90 return (iterator_ - cloud_.begin ());
95 return cloud_.size ();
100 iterator_ = cloud_.begin ();
105 return (iterator_ != cloud_.end ());
115 template <
class Po
intT>
122 , iterator_ (indices_.begin ())
128 , indices_ (indices.indices)
129 , iterator_ (indices_.begin ())
147 return (cloud_.points [*iterator_]);
152 return (&(cloud_.points [*iterator_]));
162 return (iterator_ - indices_.begin ());
167 return indices_.size ();
172 iterator_ = indices_.begin ();
177 return (iterator_ != indices_.end ());
182 std::vector<int> indices_;
183 std::vector<int>::iterator iterator_;
189 template <
class Po
intT>
195 , iterator_ (cloud.begin ())
220 return (&(*iterator_));
225 return (
unsigned (iterator_ - cloud_.begin ()));
230 return (
unsigned (iterator_ - cloud_.begin ()));
233 std::size_t
size ()
const override
235 return cloud_.size ();
240 iterator_ = cloud_.begin ();
245 return (iterator_ != cloud_.end ());
255 template <
class Po
intT>
260 const std::vector<int>& indices)
263 , iterator_ (indices_.begin ())
270 , indices_ (indices.indices)
271 , iterator_ (indices_.begin ())
289 return (cloud_.points[*iterator_]);
294 return (&(cloud_.points [*iterator_]));
299 return (
unsigned (*iterator_));
304 return (
unsigned (iterator_ - indices_.begin ()));
307 std::size_t
size ()
const override
309 return indices_.size ();
314 iterator_ = indices_.begin ();
319 return (iterator_ != indices_.end ());
324 std::vector<int> indices_;
325 std::vector<int>::iterator iterator_;
330 template <
class Po
intT>
337 template <
class Po
intT>
345 template <
class Po
intT>
353 template <
class Po
intT>
357 std::vector<int> indices;
358 indices.reserve (corrs.size ());
361 for (
const auto &corr : corrs)
362 indices.push_back (corr.index_query);
366 for (
const auto &corr : corrs)
367 indices.push_back (corr.index_match);
373 template <
class Po
intT>
380 template <
class Po
intT>
void
383 iterator_->operator++ ();
387 template <
class Po
intT>
void
390 iterator_->operator++ (0);
394 template <
class Po
intT>
PointT&
397 return (iterator_->operator * ());
401 template <
class Po
intT>
PointT*
404 return (iterator_->operator-> ());
408 template <
class Po
intT>
unsigned
411 return (iterator_->getCurrentPointIndex ());
415 template <
class Po
intT>
unsigned
418 return (iterator_->getCurrentIndex ());
422 template <
class Po
intT> std::size_t
425 return (iterator_->size ());
429 template <
class Po
intT>
void
436 template <
class Po
intT>
bool
439 return (iterator_->isValid ());
444 template <
class Po
intT>
451 template <
class Po
intT>
459 template <
class Po
intT>
467 template <
class Po
intT>
471 std::vector<int> indices;
472 indices.reserve (corrs.size ());
475 for (
const auto &corr : corrs)
476 indices.push_back (corr.index_query);
480 for (
const auto &corr : corrs)
481 indices.push_back (corr.index_match);
487 template <
class Po
intT>
494 template <
class Po
intT>
void
497 iterator_->operator++ ();
501 template <
class Po
intT>
void
504 iterator_->operator++ (0);
508 template <
class Po
intT>
const PointT&
511 return (iterator_->operator * ());
515 template <
class Po
intT>
const PointT*
518 return (iterator_->operator-> ());
522 template <
class Po
intT>
unsigned
525 return (iterator_->getCurrentPointIndex ());
529 template <
class Po
intT>
unsigned
532 return (iterator_->getCurrentIndex ());
536 template <
class Po
intT> std::size_t
539 return (iterator_->size ());
543 template <
class Po
intT>
void
550 template <
class Po
intT>
bool
553 return (iterator_->isValid ());
556 #endif // PCL_POINT_CLOUD_ITERATOR_HPP_
CloudIterator(PointCloud< PointT > &cloud)
unsigned getCurrentIndex() const
Iterator class for point clouds with or without given indices.
std::size_t size() const override
IteratorIdx(PointCloud< PointT > &cloud, const std::vector< int > &indices)
typename VectorType::const_iterator const_iterator
std::size_t size() const
Size of the range the iterator is going through.
Iterator class for point clouds with or without given indices.
unsigned getCurrentPointIndex() const
unsigned getCurrentIndex() const override
bool isValid() const override
PointT & operator*() const
unsigned getCurrentPointIndex() const
unsigned getCurrentIndex() const override
unsigned getCurrentPointIndex() const
const PointT & operator*() const
PointT & operator*() const
bool isValid() const override
ConstIteratorIdx(const PointCloud< PointT > &cloud, const std::vector< int > &indices)
std::size_t size() const override
unsigned getCurrentIndex() const
unsigned getCurrentPointIndex() const override
unsigned getCurrentPointIndex() const override
std::size_t size() const
Size of the range the iterator is going through.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
PointT * operator->() const
DefaultConstIterator(const PointCloud< PointT > &cloud)
const PointT * operator->() const
ConstIteratorIdx(const PointCloud< PointT > &cloud, const PointIndices &indices)
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
unsigned getCurrentIndex() const
A point structure representing Euclidean xyz coordinates, and the RGB color.
PointT & operator*() const
DefaultIterator(PointCloud< PointT > &cloud)
typename VectorType::iterator iterator
ConstCloudIterator(const PointCloud< PointT > &cloud)
unsigned getCurrentPointIndex() const
IteratorIdx(PointCloud< PointT > &cloud, const PointIndices &indices)
unsigned getCurrentIndex() const