itom 2.2.1
ito::PCLPointCloud Class Reference

generic class that covers one single point cloud of different possible types provided by the Point Cloud Library (PCL). More...

#include <pclStructures.h>

List of all members.

Public Member Functions

 PCLPointCloud ()
 constructor for an empty, invalid point cloud
 PCLPointCloud (ito::tPCLPointType type)
 constructor for an empty point cloud of the desired type
 PCLPointCloud (pcl::PointCloud< pcl::PointXYZ >::Ptr pclPtr)
 constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZ>
 PCLPointCloud (pcl::PointCloud< pcl::PointXYZI >::Ptr pclPtr)
 constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZI>
 PCLPointCloud (pcl::PointCloud< pcl::PointXYZRGBA >::Ptr pclPtr)
 constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZRGBA>
 PCLPointCloud (pcl::PointCloud< pcl::PointNormal >::Ptr pclPtr)
 constructor from given shared pointer of pcl::PointCloud<pcl::PointNormal>
 PCLPointCloud (pcl::PointCloud< pcl::PointXYZINormal >::Ptr pclPtr)
 constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZINormal>
 PCLPointCloud (pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr pclPtr)
 constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZRGBNormal>
 PCLPointCloud (uint32_t width_, uint32_t height_, ito::tPCLPointType type_, const PCLPoint &value_=PCLPoint())
 creates a point cloud with given width_, height_ and type_ and sets all points to the given value_.
 PCLPointCloud (PCLPointCloud &pc)
 copy constructor
 PCLPointCloud (const PCLPointCloud &pc)
 copy constructor
 PCLPointCloud (const PCLPointCloud &pc, const std::vector< int > &indices)
 copy constructor that creates the point cloud from a given point cloud and a vector of point indices that should be copied only.
 ~PCLPointCloud ()
 destructor
ito::tPCLPointType getType () const
 returns type of covered point cloud or ito::pclInvalid if invalid point cloud.
int hasRGB () const
 if this cloud has color components returns != 0, else 0
int hasNormal () const
 if this cloud has the normal components returns != 0, else 0
int hasIntensity () const
 if this cloud has the intensity component returns != 0, else 0
int hasCurvature () const
 if this cloud has the curvature component returns != 0, else 0
pcl::PointCloud< pcl::PointXYZ >
::Ptr 
toPointXYZ () const
 returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZ> cloud.
pcl::PointCloud
< pcl::PointXYZI >::Ptr 
toPointXYZI () const
 returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZI> cloud.
pcl::PointCloud
< pcl::PointXYZRGBA >::Ptr 
toPointXYZRGBA () const
 returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBA> cloud.
pcl::PointCloud
< pcl::PointNormal >::Ptr 
toPointXYZNormal () const
 returns a shared pointer to the internal pcl::PointCloud<pcl::PointNormal> cloud.
pcl::PointCloud
< pcl::PointXYZINormal >::Ptr 
toPointXYZINormal () const
 returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZINormal> cloud.
pcl::PointCloud
< pcl::PointXYZRGBNormal >
::Ptr 
toPointXYZRGBNormal () const
 returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBNormal> cloud.
pcl::PointCloud< pcl::PointXYZ >
::ConstPtr 
toPointXYZConst () const
 returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZ> cloud.
pcl::PointCloud
< pcl::PointXYZI >::ConstPtr 
toPointXYZIConst () const
 returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZI> cloud.
pcl::PointCloud
< pcl::PointXYZRGBA >
::ConstPtr 
toPointXYZRGBAConst () const
 returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBA> cloud.
pcl::PointCloud
< pcl::PointNormal >::ConstPtr 
toPointXYZNormalConst () const
 returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointNormal> cloud.
pcl::PointCloud
< pcl::PointXYZINormal >
::ConstPtr 
toPointXYZINormalConst () const
 returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZINormal> cloud.
pcl::PointCloud
< pcl::PointXYZRGBNormal >
::ConstPtr 
toPointXYZRGBNormalConst () const
 returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBNormal> cloud.
PCLPointCloudoperator+= (const PCLPointCloud &rhs)
 appends another point cloud to this point cloud
const PCLPointCloud operator+ (const PCLPointCloud &rhs)
 returns a point cloud consisting of points of this and another point cloud.
PCLPointCloudoperator= (const PCLPointCloud &copy)
 assigment operator
PCLPointCloud copy () const
 make a deep copy of this point cloud
const PCLPoint operator[] (size_t n) const
 returns point at given position n.
const PCLPoint at (size_t n) const
 returns point at given position n.
void set_item (size_t n, PCLPoint &point)
 sets the point at position n to the value given by point.
bool isOrganized () const
 returns true if this point cloud is organized, hence its height is > 1. In organized clouds adjacent points are pretended to be neighbours in the world, too.
uint32_t width () const
 returns width of this point cloud
uint32_t height () const
 returns height of this point cloud (1 if not organized, else > 1)
size_t size () const
 returns the number of points in this point cloud (width() * height())
bool is_dense () const
 returns true if this point cloud only contains points with valid components, else at least one point with nan or inf component is present
void set_width (uint32_t width)
 setter to set the width of the point cloud
void set_height (uint32_t height)
 setter to set the height of the point cloud
void set_dense (bool dense)
 setter to set the dense property of this point cloud
void scaleXYZ (float32 scaleX, float32 scaleY, float32 scaleZ)
 setter to set the dense property of this point cloud
std_msgs::Header header () const
 returns the header structure of this point cloud for a conversion to the old pcl::PCLPointCloud2 structure used in the pcl::PolygonMesh.
std::string getFieldsList () const
 returns a space separated string with the names of all components in the point cloud, e.g. "x y z"
std::vector
< sensor_msgs::PointField > 
getFieldsInfo () const
 returns vector with information about all fields contained in the specific point cloud (each info struct contains the name, offset, datatype, ... of any field)
unsigned char * genericPointAccess (size_t &strideBytes) const
 returns the pointer to the first point in the current cloud or NULL if the cloud is invalid, strideBytes is the number of bytes to jump from one point to the next one.
void push_back (const ito::PCLPoint &pt)
 adds a new point to this cloud
bool empty () const
 returns true if point cloud is empty, else false
void reserve (size_t n)
 reserves a space of n elements for the point cloud without resizing it
void resize (size_t n)
 resizes the point cloud to n points. Each point is arbitrarily initialized
void clear ()
 clears all points in the point cloud
void erase (uint32_t startIndex, uint32_t endIndex)
 clears the points from [startIndex, endIndex]
void insert (uint32_t index, const ito::PCLPoint &point)
 inserts point at given index

Protected Member Functions

void setInvalid ()
 clears this point cloud and sets the type to ito::pclInvalid. An existing point cloud is implicitely deleted.
void createEmptyPointCloud (ito::tPCLPointType type)
 creates an empty point cloud of given type. An existing point cloud is implicitely deleted.

Private Member Functions

int getFuncListIndex () const
int getFuncListIndex (const ito::tPCLPointType &type) const

Private Attributes

pcl::PointCloud< pcl::PointXYZ >
::Ptr 
m_pcXYZ
pcl::PointCloud
< pcl::PointXYZI >::Ptr 
m_pcXYZI
pcl::PointCloud
< pcl::PointXYZRGBA >::Ptr 
m_pcXYZRGBA
pcl::PointCloud
< pcl::PointNormal >::Ptr 
m_pcXYZNormal
pcl::PointCloud
< pcl::PointXYZINormal >::Ptr 
m_pcXYZINormal
pcl::PointCloud
< pcl::PointXYZRGBNormal >
::Ptr 
m_pcXYZRGBNormal
ito::tPCLPointType m_type

Friends

template<typename _Tp >
pcl::PointCloud< _Tp > * getPointCloudPtrInternal (ito::PCLPointCloud &pc)
template<typename _Tp >
const pcl::PointCloud< _Tp > * getPointCloudPtrInternal (const ito::PCLPointCloud &pc)
template<typename _Tp >
std_msgs::Header GetHeaderFunc (ito::PCLPointCloud &pc)
template<typename _Tp >
std_msgs::Header GetHeaderFunc (const ito::PCLPointCloud *pc)
template<typename _Tp >
uint32_t GetWidthFunc (const ito::PCLPointCloud *pc)
template<typename _Tp >
uint32_t GetHeightFunc (const ito::PCLPointCloud *pc)
template<typename _Tp >
void SetHeightFunc (ito::PCLPointCloud *pc, uint32_t height)
template<typename _Tp >
bool GetDenseFunc (const ito::PCLPointCloud *pc)
template<typename _Tp >
void SetDenseFunc (ito::PCLPointCloud *pc, bool dense)
template<typename _Tp >
void SetWidthFunc (ito::PCLPointCloud *pc, uint32_t width)
template<typename _Tp >
void PcAddFunc (ito::PCLPointCloud *pc1, const ito::PCLPointCloud *pc2, ito::PCLPointCloud *pcRes)
template<typename _Tp >
void SetItemFunc (ito::PCLPointCloud *pc, size_t n, ito::PCLPoint &point)
template<typename _Tp >
void PushBackFunc (ito::PCLPointCloud *pc, const ito::PCLPoint &point)
template<typename _Tp >
bool EmptyFunc (const ito::PCLPointCloud *pc)
template<typename _Tp >
void ReserveResizeFunc (ito::PCLPointCloud *pc, size_t n, bool reserveNotResize)
template<typename _Tp >
void ClearFunc (ito::PCLPointCloud *pc)
template<typename _Tp >
void EraseFunc (ito::PCLPointCloud *pc, uint32_t startIndex, uint32_t endIndex)
template<typename _Tp >
void InsertFunc (ito::PCLPointCloud *pc, uint32_t index, const ito::PCLPoint &point)
template<typename _Tp >
void ScaleXYZFunc (ito::PCLPointCloud *pc, ito::float32 scaleX, ito::float32 scaleY, ito::float32 scaleZ)
template<typename _Tp >
std::string GetFieldsListFunc (const ito::PCLPointCloud *pc)

Detailed Description

generic class that covers one single point cloud of different possible types provided by the Point Cloud Library (PCL).

The possible types are compatible to PCLPoint and described in ito::tPCLPointType:

ito::pclXYZ: x, y, z ito::pclXYZI: x, y, z, intensity ito::pclXYZRGBA: x, y, z, color (red, green, blue, alpha) ito::pclXYZNormal: x, y, z, normal_x, normal_y, normal_z, curvature ito::pclXYZINormal ito::pclXYZRGBNormal

The specific type is saved in the member m_type whereas different members are available each one holding a shared pointer to the point cloud of one specific type. Only one of those shared pointers can contain a valid point cloud.


Constructor & Destructor Documentation

ito::PCLPointCloud::PCLPointCloud ( uint32_t  width_,
uint32_t  height_,
ito::tPCLPointType  type_,
const PCLPoint value_ = PCLPoint() 
)

creates a point cloud with given width_, height_ and type_ and sets all points to the given value_.

Exceptions:
pcl::PCLExceptionif type of value_ is not invalid but does not fit to desired type_
ito::PCLPointCloud::PCLPointCloud ( const PCLPointCloud pc,
const std::vector< int > &  indices 
)

copy constructor that creates the point cloud from a given point cloud and a vector of point indices that should be copied only.

Exceptions:
pcl::PCLExceptionif indices contain invalid values or are longer than the number of points in pc.

Member Function Documentation

const ito::PCLPoint ito::PCLPointCloud::at ( size_t  n) const

returns point at given position n.

Exceptions:
pcl::PCLExceptionif cloud is invalid or n is out of bounds
const PCLPointCloud ito::PCLPointCloud::operator+ ( const PCLPointCloud rhs)

returns a point cloud consisting of points of this and another point cloud.

Exceptions:
pcl::PCLExceptionif both point clouds have different types or one of both clouds is invalid.
PCLPointCloud & ito::PCLPointCloud::operator+= ( const PCLPointCloud rhs)

appends another point cloud to this point cloud

Exceptions:
pcl::PCLExceptionif both point clouds have different types or one of both clouds is invalid.
const ito::PCLPoint ito::PCLPointCloud::operator[] ( size_t  n) const

returns point at given position n.

Exceptions:
pcl::PCLExceptionif cloud is invalid or n is out of bounds
void ito::PCLPointCloud::set_item ( size_t  n,
PCLPoint point 
)

sets the point at position n to the value given by point.

Exceptions:
pcl::PCLExceptionif cloud is invalid, n is out of bounds or the type of point does not fit to this point cloud.
pcl::PointCloud<pcl::PointXYZ>::Ptr ito::PCLPointCloud::toPointXYZ ( ) const [inline]

returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZ> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointXYZ>::ConstPtr ito::PCLPointCloud::toPointXYZConst ( ) const [inline]

returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZ> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointXYZI>::Ptr ito::PCLPointCloud::toPointXYZI ( ) const [inline]

returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZI> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointXYZI>::ConstPtr ito::PCLPointCloud::toPointXYZIConst ( ) const [inline]

returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZI> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointXYZINormal>::Ptr ito::PCLPointCloud::toPointXYZINormal ( ) const [inline]

returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZINormal> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointXYZINormal>::ConstPtr ito::PCLPointCloud::toPointXYZINormalConst ( ) const [inline]

returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZINormal> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointNormal>::Ptr ito::PCLPointCloud::toPointXYZNormal ( ) const [inline]

returns a shared pointer to the internal pcl::PointCloud<pcl::PointNormal> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointNormal>::ConstPtr ito::PCLPointCloud::toPointXYZNormalConst ( ) const [inline]

returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointNormal> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr ito::PCLPointCloud::toPointXYZRGBA ( ) const [inline]

returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBA> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr ito::PCLPointCloud::toPointXYZRGBAConst ( ) const [inline]

returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBA> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr ito::PCLPointCloud::toPointXYZRGBNormal ( ) const [inline]

returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBNormal> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.
pcl::PointCloud<pcl::PointXYZRGBNormal>::ConstPtr ito::PCLPointCloud::toPointXYZRGBNormalConst ( ) const [inline]

returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBNormal> cloud.

Exceptions:
pcl::PCLExceptionif this point cloud does not contain the cloud of the desired type.

Member Data Documentation

pcl::PointCloud<pcl::PointXYZ>::Ptr ito::PCLPointCloud::m_pcXYZ [private]

shared pointer to point cloud of type pcl::PointXYZ. Contains valid data if m_type is ito::pclXYZ.

pcl::PointCloud<pcl::PointXYZI>::Ptr ito::PCLPointCloud::m_pcXYZI [private]

shared pointer to point cloud of type pcl::PointXYZI. Contains valid data if m_type is ito::pclXYZI.

pcl::PointCloud<pcl::PointXYZINormal>::Ptr ito::PCLPointCloud::m_pcXYZINormal [private]

shared pointer to point cloud of type pcl::PointXYZINormal. Contains valid data if m_type is ito::pclXYZINormal.

pcl::PointCloud<pcl::PointNormal>::Ptr ito::PCLPointCloud::m_pcXYZNormal [private]

shared pointer to point cloud of type pcl::PointNormal. Contains valid data if m_type is ito::pclXYZNormal.

pcl::PointCloud<pcl::PointXYZRGBA>::Ptr ito::PCLPointCloud::m_pcXYZRGBA [private]

shared pointer to point cloud of type pcl::PointXYZRGBA. Contains valid data if m_type is ito::pclXYZRGBA.

pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr ito::PCLPointCloud::m_pcXYZRGBNormal [private]

shared pointer to point cloud of type pcl::PointXYZRGBNormal. Contains valid data if m_type is ito::pclXYZRGBNormal.

type of point cloud covered by this instance


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends