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 ()));
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 ()));
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 (
typename Correspondences::const_iterator indexIt = corrs.begin (); indexIt != corrs.end (); ++indexIt)
362 indices.push_back (indexIt->index_query);
366 for (
typename Correspondences::const_iterator indexIt = corrs.begin (); indexIt != corrs.end (); ++indexIt)
367 indices.push_back (indexIt->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>
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 (
typename Correspondences::const_iterator indexIt = corrs.begin (); indexIt != corrs.end (); ++indexIt)
476 indices.push_back (indexIt->index_query);
480 for (
typename Correspondences::const_iterator indexIt = corrs.begin (); indexIt != corrs.end (); ++indexIt)
481 indices.push_back (indexIt->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>
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
const PointT & operator*() const
Iterator class for point clouds with or without given indices.
unsigned getCurrentPointIndex() const
unsigned getCurrentPointIndex() const
IteratorIdx(PointCloud< PointT > &cloud, const std::vector< int > &indices)
Iterator class for point clouds with or without given indices.
unsigned getCurrentIndex() const
const PointT * operator->() const
PointT & operator*() const
size_t size() const
Size of the range the iterator is going through.
unsigned getCurrentPointIndex() const
unsigned getCurrentPointIndex() const
VectorType::iterator iterator
PointT & operator*() const
unsigned getCurrentIndex() const
PointT & operator*() const
unsigned getCurrentIndex() const
PointT * operator->() const
unsigned getCurrentIndex() const
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
ConstIteratorIdx(const PointCloud< PointT > &cloud, const std::vector< int > &indices)
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.
virtual ~ConstIteratorIdx()
unsigned getCurrentPointIndex() const
DefaultConstIterator(const PointCloud< PointT > &cloud)
ConstIteratorIdx(const PointCloud< PointT > &cloud, const PointIndices &indices)
A point structure representing Euclidean xyz coordinates, and the RGB color.
DefaultIterator(PointCloud< PointT > &cloud)
ConstCloudIterator(const PointCloud< PointT > &cloud)
IteratorIdx(PointCloud< PointT > &cloud, const PointIndices &indices)
unsigned getCurrentIndex() const
unsigned getCurrentPointIndex() const
VectorType::const_iterator const_iterator