iLab Neuromorphic Robotics Toolkit
0.1

#include <nrt/PointCloud2/PointCloud2.H>
A class for representing point clouds.
PointClouds are collections of data associated with geometrically defined points. This class allows for arbitrary data to be associated with a point cloud in addition to the basic geometry.
A CMAKE compilation flag, POINTCLOUD_DOUBLE, determines whether the base type of the point cloud will use single or double precision floating point numbers for the geometry. The geometry fields will define a three dimensional homogenous point (XYZ + W) that is the core of a pointcloud.
Additional fields can be added onto a point cloud allowing each geometrical point to be associated with additional data. These fields can be dense or sparse but will always be tied to an existing geometrical point in the point cloud. Point clouds cannot store information that does not directly relate to their geometry.
Dense fields will have a 1:1 correspondence with geometry while sparse fields do not need to obey this; you are allowed to have a geometrical entry without having an associated sparse entry.
Sparse fields are denoted as sparse when they are created by wrapping a type in the SparseField<> template, but apart from that point operate without the need for an explicit demarcation. Point clouds have the restriction that any field added, regardless of whether it is dense or sparse, must be unique when judged on an std::is_same basis.
In general sparse data will be slower to access or insert and should only be used when the tradeoff between size and decreased performance makes sense.
It should be noted that regardless of the data type accessed in a Point Cloud, if it is specified as a specific dense or sparse field as a template parameter, there is a small cost associated with an implementation specific lookup that must occur. This means that code that relies on calling functionality that specifies explicit fields should be be avoided in loops if possible. For example, the creation of iterator objects incurs this lookup cost, but the actual use of iterators does not  thus for maximum performance if the size/order of a point cloud will not change during iteration, it is best to avoid calculating end iterators at each iteration. The cost of this lookup is small in isolation, but used incorrectly in looping situations can result in degraded performance.
PointClouds are reference counted and utilize a copyonwrite mechanism similar to nrt::Array. This means that any function of PointCloud2 that can modify its contents in any fashion may perform a deep copy to obtain unique ownership of the underlying data. Constant accessors will never perform a deep copy. If you are the sole owner of the data, a deep copy will not occur.
Since PointClouds use reference counting to manage their memory, you should follow sensible conventions in multithreaded environments regarding passing by value or by reference: if it is not known whether a stable reference to a cloud exists, pass by value: it will increment the reference count and keep the memory safe until it has been used. Otherwise, if it is known that a stable reference to a cloud will exist throughout the lifetime of a function where it has been passed by reference, then there is no need to pass by value. Passing by value incurs a slightly higher overhead due to an atomic lookup that must occur. This information only applies to clouds that are passed as const. Non const clouds will always incur a deep copy as soon as they are modified.
Definition at line 127 of file PointCloud2.H.
Classes  
class  ConstIterator 
A constant iterator over geometry and other fields. More...  
class  ConstIterator< FirstT, OtherT...> 
Template specialization for ConstIterator with variadic template parameters. More...  
class  ConstIterator<> 
Template specialization for ConstIterator with no template parameters. More...  
class  Iterator 
An iterator over geometry and other fields. More...  
class  Iterator< FirstT, OtherT...> 
Template specialization for Iteartor with variadic templates. More...  
class  Iterator<> 
Template specialization for Iterator with no parameters. More...  
Public Types  
typedef Geometry *  geometry_iterator 
An iterator for going over only geometry.  
typedef Geometry const *  geometry_const_iterator 
An iterator for going over only constant geometry.  
Convenience typedefs  
typedef POINTCLOUD2_BASE_TYPE  BaseType 
typedef PointSSE < POINTCLOUD2_BASE_TYPE >  Geometry 
The type of the underlying geometry.  
typedef Eigen::Matrix < POINTCLOUD2_BASE_TYPE, 3, 1 >  Vector3 
A 3x1 vector.  
typedef Eigen::Matrix < POINTCLOUD2_BASE_TYPE, 4, 1 >  Vector4 
A 4x1 vector.  
typedef Eigen::Matrix < POINTCLOUD2_BASE_TYPE, Eigen::Dynamic, 1 >  VectorX 
An Nx1 vector.  
typedef Eigen::Matrix < POINTCLOUD2_BASE_TYPE, 3, 3 >  Matrix3 
A 3x3 matrix.  
typedef Eigen::Matrix < POINTCLOUD2_BASE_TYPE, 4, 4 >  Matrix4 
A 4x4 matrix.  
typedef Eigen::Matrix < POINTCLOUD2_BASE_TYPE, Eigen::Dynamic, Eigen::Dynamic >  MatrixX 
An NxN matrix.  
typedef Eigen::Transform < POINTCLOUD2_BASE_TYPE, 3, Eigen::Affine >  AffineTransform 
An affine transformation matrix.  
Public Member Functions  
Constructors and assignment operators  
PointCloud2 (size_t initialSize=0)  
Create an empty point cloud with no fields. More...  
PointCloud2 (PointCloud2 const &other)  
Create from an already existing cloud. More...  
PointCloud2 (PointCloud2 &&other)  
Move from an already existing cloud. More...  
~PointCloud2 ()  
Destructor.  
PointCloud2 &  operator= (PointCloud2 const &other) 
Assignment operator. More...  
PointCloud2 &  operator= (PointCloud2 &&other) 
R value move assignment operator. More...  
Field operations  
template<class... Fields>  
void  addField () 
Adds fields to this point cloud. More...  
template<class... Fields>  
void  removeField () 
Removes fields from the point cloud. More...  
template<class T >  
bool  hasField () const 
Checks if the point cloud contains a specific field, dense or sparse. More...  
template<class T >  
bool  hasDenseField () const 
Checks if the point cloud contains a specific dense field.  
template<class T >  
bool  hasSparseField () const 
Checks if the point cloud contains a specific sparse field. More...  
template<class T >  
bool  hasSparseData (size_t const index) const 
Checks whether a specific index in the point cloud contains data of a particular sparse type. More...  
template<class T >  
Indices  getSparseIndices () const 
Assuming the requested field is sparse, retrieves all indices that contain the field. More...  
bool  hasSameFields (PointCloud2 const other) const 
Checks if a point cloud has the same fields as another.  
size_t  size () const 
Gets the number of dense entries in the point cloud.  
template<class T >  
size_t  size () const 
Gets the number of entries for a particular field. More...  
bool  empty () const 
Gets whether the cloud is completely empty (no dense entries)  
Individual element access  
Geometry &  operator[] (size_t index) 
Returns a reference to the geometry at the specified index.  
Geometry const &  operator[] (size_t index) const 
Returns a const reference to the geometry at the specified index.  
PointCloud2DataRef  get (size_t index) 
Returns a reference to the geometry at the specified index. More...  
template<class... Fields>  
PointCloud2DataRef< typename StripSparse< Fields >::type...>  get (size_t index) 
Returns a reference to fields at the requested index. More...  
PointCloud2ConstDataRef  at (size_t index) const 
Returns a constant reference to the geometry at the specified index.  
template<class... Fields>  
PointCloud2ConstDataRef < typename StripSparse< Fields > ::type...>  at (size_t index) const 
Returns a constant reference to fields at the requested index. More...  
Iterators  
Iterator  begin () 
Get a basic iterator (includes geometry) to the beginning of the data. More...  
ConstIterator  begin () const 
Get a basic iterator (includes geometry) to the beginning of the data.  
ConstIterator  const_begin () const 
Get a basic iterator (includes geometry) to the beginning of the data.  
template<class T , class... OtherT>  
Iterator< typename StripSparse < T >::type, typename StripSparse< OtherT >::type...>  begin () 
Get an iterator to the requested fields, including geometry. More...  
template<class T , class... OtherT>  
ConstIterator< typename StripSparse< T >::type, typename StripSparse< OtherT > ::type...>  begin () const 
Get a constant iterator to the requested fields, including geometry. More...  
template<class T , class... OtherT>  
ConstIterator< typename StripSparse< T >::type, typename StripSparse< OtherT > ::type...>  const_begin () const 
Get a constant iterator to the requested fields, including geometry. More...  
Iterator  end () 
Get a basic iterator (includes geometry) to one past the end of the data. More...  
ConstIterator  end () const 
Get a basic iterator (includes geometry) to one past the end of the data.  
ConstIterator  const_end () const 
Get a basic iterator (includes geometry) to one past the end of the data.  
template<class T , class... OtherT>  
Iterator< typename StripSparse < T >::type, typename StripSparse< OtherT >::type...>  end () 
Get an iterator to the requested fields, including geometry. More...  
template<class T , class... OtherT>  
ConstIterator< typename StripSparse< T >::type, typename StripSparse< OtherT > ::type...>  end () const 
Get a constant iterator to the requested fields, including geometry. More...  
template<class T , class... OtherT>  
ConstIterator< typename StripSparse< T >::type, typename StripSparse< OtherT > ::type...>  const_end () const 
Get a constant iterator to the requested fields, including geometry. More...  
geometry_iterator  geometry_begin () 
Gets an iterator to only geometrical data (first entry)  
geometry_const_iterator  geometry_begin () const 
Gets an iterator to only geometrical data (first entry)  
geometry_const_iterator  geometry_const_begin () const 
Gets an iterator to only geometrical data (first entry)  
geometry_iterator  geometry_end () 
Gets an iterator to only geometrical data (past the last entry)  
geometry_const_iterator  geometry_end () const 
Gets an iterator to only geometrical data (past the last entry)  
geometry_const_iterator  geometry_const_end () const 
Gets an iterator to only geometrical data (past the last entry)  
Subset iterators  
The following subset iterators provide access to only specified indices of a point cloud  
Iterator  subset_begin (Indices const indices) 
Get a basic iterator (includes geometry) to the beginning of the subset. More...  
ConstIterator  subset_begin (Indices const indices) const 
Get a basic iterator (includes geometry) to the beginning of the subset. More...  
ConstIterator  subset_const_begin (Indices const indices) const 
Get a basic iterator (includes geometry) to the beginning of the subset. More...  
template<class T , class... OtherT>  
Iterator< typename StripSparse < T >::type, typename StripSparse< OtherT >::type...>  subset_begin (Indices const indices) 
Get an iterator to the requested fields in a subset, including geometry. More...  
template<class T , class... OtherT>  
ConstIterator< typename StripSparse< T >::type, typename StripSparse< OtherT > ::type...>  subset_begin (Indices const indices) const 
Get an constant iterator to the requested fields in a subset, including geometry. More...  
template<class T , class... OtherT>  
ConstIterator< typename StripSparse< T >::type, typename StripSparse< OtherT > ::type...>  subset_const_begin (Indices const indices) const 
Get an constant iterator to the requested fields in a subset, including geometry. More...  
Iterator  subset_end (Indices const indices) 
Get a basic iterator (includes geometry) to one past the end of the subset. More...  
ConstIterator  subset_end (Indices const indices) const 
Get a basic iterator (includes geometry) to one past the end of the subset. More...  
ConstIterator  subset_const_end (Indices const indices) const 
Get a basic iterator (includes geometry) to one past the end of the subset. More...  
template<class T , class... OtherT>  
Iterator< typename StripSparse < T >::type, typename StripSparse< OtherT >::type...>  subset_end (Indices const indices) 
Get an iterator to one past the end of the requested fields in a subset, including geometry. More...  
template<class T , class... OtherT>  
ConstIterator< typename StripSparse< T >::type, typename StripSparse< OtherT > ::type...>  subset_end (Indices const indices) const 
Get an constant iterator to one past the end of the requested fields in a subset, including geometry. More...  
template<class T , class... OtherT>  
ConstIterator< typename StripSparse< T >::type, typename StripSparse< OtherT > ::type...>  subset_const_end (Indices const indices) const 
Get an constant iterator to one past the end of the requested fields in a subset, including geometry. More...  
Ranges  
The following classes provide a lightweight range access to the contents of a point cloud Creating a range may cause a deep copy of the underlying data to occur if not the sole owner of the data while requesting a non constant range. Ranges wrap up a begin and end iterator and give a convenient way to access point cloud data using mechanisms such as a range based for loop. Ranges will always include a reference to the geometry and this needs not be specified during their creation.  
IteratorRange< geometry_iterator >  geometry_range () 
Gets a range that only includes raw geometry over the entire point cloud. More...  
IteratorRange < geometry_const_iterator >  geometry_range () const 
Gets a range that only includes raw constant geometry over the entire point cloud.  
IteratorRange < geometry_const_iterator >  geometry_const_range () const 
Gets a range that only includes raw constant geometry over the entire point cloud.  
IteratorRange< Iterator<> >  range () 
Gets a range that only includes geometry over the entire point cloud. More...  
IteratorRange< ConstIterator<> >  range () const 
Gets a range that only includes constant geometry over the entire point cloud.  
IteratorRange< ConstIterator<> >  const_range () const 
Gets a range that only includes constant geometry over the entire point cloud.  
IteratorRange< Iterator<> >  subset_range (Indices const indices) 
Gets a range that only includes geometry over a subset of the cloud. More...  
IteratorRange< ConstIterator<> >  subset_range (Indices const indices) const 
Gets a range that only includes constant geometry over a subset of the cloud.  
IteratorRange< ConstIterator<> >  subset_const_range (Indices const indices) const 
Gets a range that only includes constant geometry over a subset of the cloud.  
template<class T , class... OtherT>  
IteratorRange< Iterator < typename StripSparse< T > ::type, typename StripSparse < OtherT >::type...> >  range () 
Gets a range over the requested fields for the entire point cloud. More...  
template<class T , class... OtherT>  
IteratorRange< ConstIterator < typename StripSparse< T > ::type, typename StripSparse < OtherT >::type...> >  range () const 
Gets a range over the requested fields for the entire point cloud. More...  
template<class T , class... OtherT>  
IteratorRange< ConstIterator < typename StripSparse< T > ::type, typename StripSparse < OtherT >::type...> >  const_range () const 
Gets a range over the requested fields for the entire point cloud. More...  
template<class T , class... OtherT>  
IteratorRange< Iterator < typename StripSparse< T > ::type, typename StripSparse < OtherT >::type...> >  subset_range (Indices const indices) 
Gets a range over the requested fields for some subset. More...  
template<class T , class... OtherT>  
IteratorRange< ConstIterator < typename StripSparse< T > ::type, typename StripSparse < OtherT >::type...> >  subset_range (Indices const indices) const 
Gets a range over the requested fields for the entire point cloud. More...  
template<class T , class... OtherT>  
IteratorRange< ConstIterator < typename StripSparse< T > ::type, typename StripSparse < OtherT >::type...> >  subset_const_range (Indices const indices) const 
Gets a range over the requested fields for the entire point cloud. More...  
Cloud insertion and deletion  
Functionality for inserting elements, resizing the point cloud, and clearing elements or the entire cloud  
void  resize (size_t size) 
Resizes the point cloud. More...  
void  clear () 
Removes all data in every field (but does not remove fields) including geometry.  
void  insert (Geometry const &geo) 
Inserts a single geometrical point at the end of the cloud. More...  
template<class... Fields>  
void  insert (PointCloud2Data< Fields...> const &point) 
Inserts a single point at the end of the cloud. More...  
template<class... Fields>  
void  insertSparse (size_t const index, StreamableGenericBag< Fields...> const &data) 
Adds sparse data to a point. More...  
PointCloud2 &  append (PointCloud2 const other) 
Appends all data from another point cloud to this one. More...  
void  remove (size_t index) 
Remove all data (from every field) associated with a specific index.  
template<class Field >  
void  remove (size_t index) 
Remove the sparse data of a specific field associated with a point. More...  
void  quickRemove (size_t index) 
void  quickRemove (Indices const indices, bool sort=false) 
Memory manipulation and reference counting  
Functionality for comparing and manipulating the actual reference counted memory of the point cloud  
void  deepCopy () 
Performs a deep copy of the underlying data. More...  
bool  operator== (PointCloud2 const &other) const 
Check whether this cloud is equal (same internal data) as some other.  
bool  operator!= (PointCloud2 const &other) const 
Check whether this cloud is not equal (not same internal data) as some other.  
Static Public Member Functions  
template<class... Fields>  
static PointCloud2  create (size_t initialSize=0) 
Create an empty point cloud with a set of fields. More...  
Friends  
template<class... Fields>  
class  Iterator 
template<class... Fields>  
class  ConstIterator 
template<class... Fields>  
struct  subsetHelper 
Used for iterators.  
template<class... Fields>  
struct  addFieldHelper 
template<class... Fields>  
struct  removeFieldHelper 
template<size_t Index>  
struct  insertDataHelper 
template<class... T>  
struct  insertionChecker 
template<class RetT , class... T>  
struct  lookupHelper 
template<class RetT , class... T>  
struct  pointerHelper 
template<class... T>  
struct  sparseExistHelper 
template<class... T>  
struct  sparseOnlyExistHelper 
template<class... T>  
struct  sparseInsertHelper 
class  cereal::access 
template<class... T>  
struct  subsetHelper 
typedef POINTCLOUD2_BASE_TYPE nrt::PointCloud2::BaseType 
The base type for a point cloud, determined by a CMAKE compilation flag
Definition at line 136 of file PointCloud2.H.
nrt::PointCloud2::PointCloud2  (  size_t  initialSize = 0 ) 
Create an empty point cloud with no fields.
The created point cloud will have geometrical data (as all point clouds do), but no additional dense or sparse fields
initialSize  The initial size for the point cloud. Note that any geometry allocated here will be completely zero valued and thus not a valid homogenous point. It is best to consider the data as allocated but uninitialized. 
nrt::PointCloud2::PointCloud2  (  PointCloud2 const &  other) 
Create from an already existing cloud.
This will create a shallow copy of the other cloud that will only become a deep copy upon modification or an explicit call to deepCopy()
nrt::PointCloud2::PointCloud2  (  PointCloud2 &&  other) 
Move from an already existing cloud.
This will move the data from another cloud into this one and cause the other cloud to become invalid. Using an invalid cloud will result in undefined behavior

static 
Create an empty point cloud with a set of fields.
This adds fields to the point cloud, giving it the capability of storing various data types. Data types must be distinct from an std::is_same basis regardless of whether they are dense or sparse.
Data types are assumed to be dense by default and can be marked as sparse by wrapping in the template class SparseField<>. Fields marked as sparse only need to be marked as sparse during insertion and can be utilized without the SparseField<> template wrapper in all other functions.
Sparse fields will only store data for indicies that have been initialized with some information. Sparse fields are slower to access and should be used when the tradeoff between space and time makes sense.
The point cloud will also, as all clouds do, contain geometrical data for each entry.
Fields  A set of fields to add 
initialSize  The initial size for the point cloud. Note that any geometry or other fields allocated here will be completely zero valued and thus likely not valid data. It is best to consider the data (including geometry) as allocated but not initialized 
PointCloud2& nrt::PointCloud2::operator=  (  PointCloud2 const &  other) 
Assignment operator.
This will create a shallow copy of the other cloud that will only become a deep copy upon modification or an explicit call to deepCopy()
PointCloud2& nrt::PointCloud2::operator=  (  PointCloud2 &&  other) 
R value move assignment operator.
This will result in the other point cloud being made invalid; using an invalid point cloud will result in undefined behavior

inline 
Adds fields to this point cloud.
This adds a field to the point cloud, giving it the capability of storing a particular data type. Data types must be distinct from an std::is_same basis regardless of whether they are dense or sparse.
Data types are assumed to be dense by default and can be marked as sparse by wrapping in the template class SparseField<>. Fields marked as sparse only need to be marked as sparse during insertion and can be utilized without the SparseField<> template wrapper in all other functions.
Sparse fields will only store data for indicies that have been initialized with some information. Sparse fields are slower to access and should be used when the tradeoff between space and time makes sense.
Dense fields will be initialized with zero valued data which may be invalid depending on their type.
If a field already exists, calling addField with it again will do nothing.
Fields  A set of fields to add 
Definition at line 481 of file PointCloud2Impl.H.

inline 
Removes fields from the point cloud.
Removing a field will delete all data associated with it in the point cloud.
For sparse fields, there is no need to specify the type as sparse with SparseField<> as this will be automatically inferred for a sparse field. If this is specified, it will be automatically stripped.
Fields  The fields to remove 
Definition at line 488 of file PointCloud2Impl.H.

inline 
Checks if the point cloud contains a specific field, dense or sparse.
SparseField<> will be stripped if present and is not necessary.
T  The field type to check 
Definition at line 495 of file PointCloud2Impl.H.
References nrt::cloudHash().

inline 
Checks if the point cloud contains a specific sparse field.
SparseField<> will be stripped if present and is not necessary.
T  The field type to check 
Definition at line 511 of file PointCloud2Impl.H.
References nrt::cloudHash().

inline 
Checks whether a specific index in the point cloud contains data of a particular sparse type.
SparseField<> will be stripped if present and is not necessary
T  The field type to check 
index  The index to check 
Definition at line 519 of file PointCloud2Impl.H.
References nrt::cloudHash().
Indices nrt::PointCloud2::getSparseIndices  (  )  const 
Assuming the requested field is sparse, retrieves all indices that contain the field.
SparseField<> will be stripped if present and is not necessary
T  The field type to check 
size_t nrt::PointCloud2::size  (  )  const 
Gets the number of entries for a particular field.
SparseField<> will be stripped if present and is not necessary
T  The type to check the size of 

inline 
Returns a reference to the geometry at the specified index.
The data contained in the returned point will reference data stored in the cloud; modifying this structure will directly modify the data internal to the point cloud
Definition at line 577 of file PointCloud2Impl.H.
Referenced by main().
PointCloud2DataRef<typename StripSparse<Fields>::type...> nrt::PointCloud2::get  (  size_t  index) 
Returns a reference to fields at the requested index.
If the requested fields do not exist inside of the point cloud, an exception will be thrown.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
Geometry is always included regardless of fields specified.
Fields  The fields to iterate over 
PointCloud2FieldsException  If at least one field does not exist in the cloud 
PointCloud2ConstDataRef<typename StripSparse<Fields>::type...> nrt::PointCloud2::at  (  size_t  index)  const 
Returns a constant reference to fields at the requested index.
If the requested fields do not exist inside of the point cloud, an exception will be thrown.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
Geometry is always included regardless of fields specified.
Fields  The fields to iterate over 
PointCloud2FieldsException  If at least one field does not exist in the cloud 

inline 
Get a basic iterator (includes geometry) to the beginning of the data.
Will perform a deep copy if not the sole owner of underlying data
Definition at line 592 of file PointCloud2Impl.H.
Referenced by nrt::computeMinMax().
Iterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::begin  (  ) 
Get an iterator to the requested fields, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
Will perform a deep copy if not the sole owner of underlying data.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if no valid sparse intersection can be found in the case when a sparse field is specified 
ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::begin  (  )  const 
Get a constant iterator to the requested fields, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if no valid sparse intersection can be found in the case when a sparse field is specified 
ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::const_begin  (  )  const 
Get a constant iterator to the requested fields, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if no valid sparse intersection can be found in the case when a sparse field is specified 

inline 
Get a basic iterator (includes geometry) to one past the end of the data.
Will perform a deep copy if not the sole owner of underlying data.
Definition at line 621 of file PointCloud2Impl.H.
Referenced by nrt::computeMinMax().
Iterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::end  (  ) 
Get an iterator to the requested fields, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
Will perform a deep copy if not the sole owner of underlying data.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if no valid sparse intersection can be found in the case when a sparse field is specified 
ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::end  (  )  const 
Get a constant iterator to the requested fields, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if no valid sparse intersection can be found in the case when a sparse field is specified 
ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::const_end  (  )  const 
Get a constant iterator to the requested fields, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if no valid sparse intersection can be found in the case when a sparse field is specified 

inline 
Get a basic iterator (includes geometry) to the beginning of the subset.
Will perform a deep copy if not the sole owner of underlying data
indices  The indices of the subset to iterate on 
PointCloud2SubsetException  if an empty set of indices is passed 
Definition at line 649 of file PointCloud2Impl.H.

inline 
Get a basic iterator (includes geometry) to the beginning of the subset.
indices  The indices of the subset to iterate on 
PointCloud2SubsetException  if an empty set of indices is passed 
Definition at line 661 of file PointCloud2Impl.H.

inline 
Get a basic iterator (includes geometry) to the beginning of the subset.
indices  The indices of the subset to iterate on 
PointCloud2SubsetException  if an empty set of indices is passed 
Definition at line 671 of file PointCloud2Impl.H.
Iterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::subset_begin  (  Indices const  indices) 
Get an iterator to the requested fields in a subset, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
Will perform a deep copy if not the sole owner of underlying data.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
indices  The indices of the subset to iterate on 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::subset_begin  (  Indices const  indices)  const 
Get an constant iterator to the requested fields in a subset, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
indices  The indices of the subset to iterate on 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::subset_const_begin  (  Indices const  indices)  const 
Get an constant iterator to the requested fields in a subset, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
indices  The indices of the subset to iterate on 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 

inline 
Get a basic iterator (includes geometry) to one past the end of the subset.
Will perform a deep copy if not the sole owner of underlying data
indices  The indices of the subset to iterate on 
PointCloud2SubsetException  if an empty set of indices is passed 
Definition at line 677 of file PointCloud2Impl.H.

inline 
Get a basic iterator (includes geometry) to one past the end of the subset.
indices  The indices of the subset to iterate on 
PointCloud2SubsetException  if an empty set of indices is passed 
Definition at line 689 of file PointCloud2Impl.H.

inline 
Get a basic iterator (includes geometry) to one past the end of the subset.
indices  The indices of the subset to iterate on 
PointCloud2SubsetException  if an empty set of indices is passed 
Definition at line 699 of file PointCloud2Impl.H.
Iterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::subset_end  (  Indices const  indices) 
Get an iterator to one past the end of the requested fields in a subset, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
Will perform a deep copy if not the sole owner of underlying data.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
indices  The indices of the subset to iterate on 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::subset_end  (  Indices const  indices)  const 
Get an constant iterator to one past the end of the requested fields in a subset, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
indices  The indices of the subset to iterate on 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> nrt::PointCloud2::subset_const_end  (  Indices const  indices)  const 
Get an constant iterator to one past the end of the requested fields in a subset, including geometry.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Iterators with sparse fields will perform more slowly than those with dense only fields, especially during iterator creation. Iterator traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the iterator. Creation time will be longer than creating a dense iterator and scale with the size of the strictest subset and the number of fields to be iterated.
T  The first field requested to be iterated over 
OtherT  The other fields requested to be iterated over. 
indices  The indices of the subset to iterate on 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
IteratorRange<geometry_iterator> nrt::PointCloud2::geometry_range  (  ) 
Gets a range that only includes raw geometry over the entire point cloud.
Unlike regular ranges, a geometry_range will directly access geometry data and will not be wrapped in a PointCloud2DataRef<>. This means that your iteration should look something like:
Will perform a deep copy if not the owner of underlying data

inline 
Gets a range that only includes geometry over the entire point cloud.
Ranges will return PointCloud2DataRef<> rvalues which contain references to point cloud data. This means that data iterated over by a range is already by reference and can be modified directly:
Will perform a deep copy if not the sole owner of underlying data.
Definition at line 705 of file PointCloud2Impl.H.
Referenced by main().

inline 
Gets a range that only includes geometry over a subset of the cloud.
Will perform a deep copy if not the sole owner of underlying data.
Definition at line 723 of file PointCloud2Impl.H.
IteratorRange<Iterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> > nrt::PointCloud2::range  (  ) 
Gets a range over the requested fields for the entire point cloud.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Ranges with sparse fields will perform more slowly than those with dense only fields, especially during range creation. Range traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the range. Creation time will be longer than creating a dense range and scale with the size of the strictest subset and the number of fields to be ranged over.
Will perform a deep copy if not the sole owner of underlying data.
T  The first field requested in the range. 
OtherT  The other fields requested in the range 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
IteratorRange<ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> > nrt::PointCloud2::range  (  )  const 
Gets a range over the requested fields for the entire point cloud.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Ranges with sparse fields will perform more slowly than those with dense only fields, especially during range creation. Range traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the range. Creation time will be longer than creating a dense range and scale with the size of the strictest subset and the number of fields to be ranged over.
T  The first field requested in the range. 
OtherT  The other fields requested in the range 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
IteratorRange<ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> > nrt::PointCloud2::const_range  (  )  const 
Gets a range over the requested fields for the entire point cloud.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Ranges with sparse fields will perform more slowly than those with dense only fields, especially during range creation. Range traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the range. Creation time will be longer than creating a dense range and scale with the size of the strictest subset and the number of fields to be ranged over.
T  The first field requested in the range. 
OtherT  The other fields requested in the range 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
IteratorRange<Iterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> > nrt::PointCloud2::subset_range  (  Indices const  indices) 
Gets a range over the requested fields for some subset.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Ranges with sparse fields will perform more slowly than those with dense only fields, especially during range creation. Range traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the range. Creation time will be longer than creating a dense range and scale with the size of the strictest subset and the number of fields to be ranged over.
Will perform a deep copy if not the sole owner of underlying data.
T  The first field requested in the range. 
OtherT  The other fields requested in the range 
indices  The indices of the subset to range over 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
IteratorRange<ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> > nrt::PointCloud2::subset_range  (  Indices const  indices)  const 
Gets a range over the requested fields for the entire point cloud.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Ranges with sparse fields will perform more slowly than those with dense only fields, especially during range creation. Range traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the range. Creation time will be longer than creating a dense range and scale with the size of the strictest subset and the number of fields to be ranged over.
T  The first field requested in the range. 
OtherT  The other fields requested in the range 
indices  The indices of the subset to range over 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
IteratorRange<ConstIterator<typename StripSparse<T>::type, typename StripSparse<OtherT>::type...> > nrt::PointCloud2::subset_const_range  (  Indices const  indices)  const 
Gets a range over the requested fields for the entire point cloud.
If the requested fields do not exist inside of the point cloud, an exception will be thrown. Ranges with sparse fields will perform more slowly than those with dense only fields, especially during range creation. Range traversal time should be similar in both cases.
Sparse fields do not (and should not) need to be explicitly specified as sparse using SparseField<>. This will be stripped if present.
If at least one requested field is sparse, the strictest intersection of the sparse indices will be iterated over by the range. Creation time will be longer than creating a dense range and scale with the size of the strictest subset and the number of fields to be ranged over.
T  The first field requested in the range. 
OtherT  The other fields requested in the range 
indices  The indices of the subset to range over 
PointCloud2FieldsException  If at least one field does not exist in the cloud or if at least one sparse field is specified that does not have data for a provided index 
void nrt::PointCloud2::resize  (  size_t  size) 
Resizes the point cloud.
If the new size is greater than the old size, dense data will be created to fill the new indices. The newly created dense data is not guaranteed to be valid.
If the size causes a reduction in the size of the point cloud, any dense data exceeding the new size will be removed. This will also cause any sparse data data associated with indices that no longer exist to be removed. This removal of sparse data takes time linear in the difference of cloud size and logarithmic in the number of elements in a sparse field.
size  The new size for the point cloud 
void nrt::PointCloud2::insert  (  Geometry const &  geo) 
Inserts a single geometrical point at the end of the cloud.
Any dense fields currently contained in the point cloud will be given zero valued data to correspond with the dense entry created by this insertion. Depending on the data type, this may result in invalid data for those dense fields. It is suggested to fully specify all types in the cloud, if possible, when calling the templated version of insert to prevent any invalid data from existing.

inline 
Inserts a single point at the end of the cloud.
If any dense fields currently contained in the point cloud are not specified in the input data, they will be given zero valued data to correspond with the dense entry created by this insertion. Depending on the data type, this may result in invalid data. Therefor it is suggested to always fully specify dense types during an insertion if possible.
Fields  The fields to insert, which may include any fields (dense or sparse) in the point cloud. Sparse fields should not be wrapped in SparseField<>. 
PointCloud2FieldsException  If any single field listed does not exist 
Definition at line 741 of file PointCloud2Impl.H.
References nrt::PointCloud2Data< Types >::geometry().

inline 
Adds sparse data to a point.
This function adds sparse data entries to some point that was previously only associated with dense data. The sparse fields must exist in the point cloud prior to calling this function. If the assigned index already contains the sparse data passed in, it will be overwritten.
After calling this, the data at the specified index will be associated with the provided sparse data as well as any data it was previously associated with.
Fields  The sparse fields to be inserted. Do not wrap with SparseField<>. If any field does not exist in the point cloud, an exception will be thrown. 
index  The index to insert sparse data at. If this index does not exist in the point cloud, an exception will be thrown. 
data  The sparse data to be inserted. If the data already exists, it will be overwritten 
Definition at line 765 of file PointCloud2Impl.H.
PointCloud2& nrt::PointCloud2::append  (  PointCloud2 const  other) 
Appends all data from another point cloud to this one.
This will add all of the data from another point cloud to the end of the data in this point cloud, increasing its size by the size of the other point cloud.
This is intended to combine two same configured point clouds together and is not meant for use with mixed types, since the behavior in that situation can be ambiguous.
If the two point clouds do not have identical configurations, an exception will be thrown.
Dense data will merely be appended to the current data. Sparse data in the other point cloud will have its index adjusted by the new starting index of data from the other point cloud. For example, if our current cloud is size 100 and we merge a size 50 cloud, a sparse field from the other cloud that was at index 2 is now at index 102.
PointCloud2FieldsException  If the two clouds do not have exactly the same set of fields 
void nrt::PointCloud2::remove  (  size_t  index) 
Remove the sparse data of a specific field associated with a point.
It is not necessary to wrap the template parameter with SparseField<>. If specified, it will be stripped automatically.
PointCloud2FieldsException  If the requested field does not exist in the cloud 
void nrt::PointCloud2::quickRemove  (  size_t  index) 
Remove all data (from every field) associated with a specific index, not preserving ordering
This is generally a faster operation than remove() but will not preserve the ordering of points within the cloud
void nrt::PointCloud2::quickRemove  (  Indices const  indices, 
bool  sort = false 

) 
Remove all data (from every field) associated with every index in a subset not preserving ordering
This is generally a faster operation than calling remove() or quickRemove() on several indices to remove.
Because quickRemove does not preserve ordering, the input must be sorted or the sort flag should be specified so that this function handles the sorting.
indices  The subset to remove 
sort  Whether we need to sort the input 
void nrt::PointCloud2::deepCopy  (  ) 
Performs a deep copy of the underlying data.
After calling deepcopy, a deep copy of all underlying data will occur and this PointCloud2 will have unique ownership of its data until another reference is created.
The reference count will be one after this operation and any existing references will be decremented.