28#ifndef PCLSTRUCTURES_H
29#define PCLSTRUCTURES_H
31#include "pclDefines.h"
32#include "../common/typeDefs.h"
37#pragma warning( disable: 4996)
39#include <pcl/point_types.h>
40#include <pcl/point_cloud.h>
41#include <pcl/PolygonMesh.h>
43#pragma warning( default: 4996)
51#if PCL_VERSION_COMPARE(>,1,5,1)
54 #define PCLALPHA _unused
85 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZ());
88 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZI());
91 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZRGBA());
94 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointNormal());
97 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZINormal());
100 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZRGBNormal());
114 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZ(point));
120 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZI(point));
126 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZRGBA(point));
132 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointNormal(point));
138 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZINormal(point));
144 m_genericPoint =
reinterpret_cast<void*
>(
new pcl::PointXYZRGBNormal(point));
167 case ito::pclXYZ:
delete reinterpret_cast<pcl::PointXYZ*
>(m_genericPoint);
break;
168 case ito::pclXYZI:
delete reinterpret_cast<pcl::PointXYZI*
>(m_genericPoint);
break;
169 case ito::pclXYZRGBA:
delete reinterpret_cast<pcl::PointXYZRGBA*
>(m_genericPoint);
break;
170 case ito::pclXYZNormal:
delete reinterpret_cast<pcl::PointNormal*
>(m_genericPoint);
break;
171 case ito::pclXYZINormal:
delete reinterpret_cast<pcl::PointXYZINormal*
>(m_genericPoint);
break;
172 case ito::pclXYZRGBNormal:
delete reinterpret_cast<pcl::PointXYZRGBNormal*
>(m_genericPoint);
break;
175 m_genericPoint = NULL;
186 const pcl::PointXYZ & getPointXYZ()
const;
192 const pcl::PointXYZI & getPointXYZI()
const;
198 const pcl::PointXYZRGBA & getPointXYZRGBA()
const;
204 const pcl::PointNormal & getPointXYZNormal()
const;
210 const pcl::PointXYZINormal & getPointXYZINormal()
const;
216 const pcl::PointXYZRGBNormal & getPointXYZRGBNormal()
const;
218 pcl::PointXYZ & getPointXYZ();
219 pcl::PointXYZI & getPointXYZI();
220 pcl::PointXYZRGBA & getPointXYZRGBA();
221 pcl::PointNormal & getPointXYZNormal();
222 pcl::PointXYZINormal & getPointXYZINormal();
223 pcl::PointXYZRGBNormal & getPointXYZRGBNormal();
225 bool getXYZ(
float &x,
float &y,
float &z);
226 bool setXYZ(
float x,
float y,
float z,
int mask = 0xFFFF);
227 bool getNormal(
float &nx,
float &ny,
float &nz);
228 bool setNormal(
float nx,
float ny,
float nz,
int mask = 0xFFFF);
229 bool getRGBA(uint8_t &r, uint8_t &g, uint8_t &b, uint8_t &a);
230 bool setRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a,
int mask = 0xFFFF);
231 bool getIntensity(
float &intensity);
232 bool setIntensity(
float intensity);
233 bool getCurvature(
float &curvature);
234 bool setCurvature(
float curvature);
238 template<
typename _Tp>
friend _Tp* getPointPtrInternal(
ito::PCLPoint &point);
239 template<
typename _Tp>
friend const _Tp* getPointPtrInternal(
const ito::PCLPoint &point);
248 template<
typename _Tp> pcl::PointCloud<_Tp>* getPointCloudPtrInternal(
ito::PCLPointCloud &pc);
249 template<
typename _Tp>
const pcl::PointCloud<_Tp>* getPointCloudPtrInternal(
const ito::PCLPointCloud &pc);
251#if PCL_VERSION_COMPARE(>=,1,7,0)
268 template<
typename _Tp>
void ReserveResizeFunc(
ito::PCLPointCloud *pc,
size_t n,
bool reserveNotResize);
270 template<
typename _Tp>
void EraseFunc(
ito::PCLPointCloud *pc, uint32_t startIndex, uint32_t endIndex);
301 createEmptyPointCloud(type);
364 inline pcl::PointCloud<pcl::PointXYZ>::Ptr
toPointXYZ()
const
367 throw pcl::PCLException(
"point cloud has not the desired type PointXYZ",__FILE__,
"toPointXYZ", __LINE__);
377 throw pcl::PCLException(
"point cloud has not the desired type PointXYZI",__FILE__,
"toPointXYZI", __LINE__);
387 throw pcl::PCLException(
"point cloud has not the desired type PointXYZRGBA",__FILE__,
"toPointXYZRGBA", __LINE__);
397 throw pcl::PCLException(
"point cloud has not the desired type PointXYZNormal",__FILE__,
"toPointXYZNormal", __LINE__);
407 throw pcl::PCLException(
"point cloud has not the desired type PointXYZINormal",__FILE__,
"toPointXYZINormal", __LINE__);
417 throw pcl::PCLException(
"point cloud has not the desired type PointXYZRGBNormal",__FILE__,
"toPointXYZRGBNormal", __LINE__);
427 throw pcl::PCLException(
"point cloud has not the desired type PointXYZ",__FILE__,
"toPointXYZ", __LINE__);
437 throw pcl::PCLException(
"point cloud has not the desired type PointXYZI",__FILE__,
"toPointXYZI", __LINE__);
447 throw pcl::PCLException(
"point cloud has not the desired type PointXYZRGBA",__FILE__,
"toPointXYZRGBA", __LINE__);
457 throw pcl::PCLException(
"point cloud has not the desired type PointXYZNormal",__FILE__,
"toPointXYZNormal", __LINE__);
467 throw pcl::PCLException(
"point cloud has not the desired type PointXYZINormal",__FILE__,
"toPointXYZINormal", __LINE__);
477 throw pcl::PCLException(
"point cloud has not the desired type PointXYZRGBNormal",__FILE__,
"toPointXYZRGBNormal", __LINE__);
502 const PCLPoint operator[] (
size_t n)
const;
514 void set_item(
size_t n,
PCLPoint &point);
517 bool isOrganized()
const;
520 uint32_t width()
const;
523 uint32_t height()
const;
529 bool is_dense()
const;
532 void set_width(uint32_t width);
535 void set_height(uint32_t height);
538 void set_dense(
bool dense);
541 void scaleXYZ(float32 scaleX, float32 scaleY, float32 scaleZ);
544 void moveXYZ(float32 dX, float32 dY, float32 dZ);
547#if PCL_VERSION_COMPARE(>=,1,7,0)
548 pcl::PCLHeader header()
const;
550 std_msgs::Header header()
const;
554 std::string getFieldsList()
const;
557#if PCL_VERSION_COMPARE(>=,1,7,0)
558 std::vector<pcl::PCLPointField> getFieldsInfo()
const;
560 std::vector<sensor_msgs::PointField> getFieldsInfo()
const;
564 unsigned char* genericPointAccess(
size_t &strideBytes)
const;
573 void reserve(
size_t n);
576 void resize(
size_t n);
582 void erase(uint32_t startIndex, uint32_t endIndex);
596 inline int getFuncListIndex()
const
624 template<
typename _Tp>
friend pcl::PointCloud<_Tp>* getPointCloudPtrInternal(
ito::PCLPointCloud &pc);
625 template<
typename _Tp>
friend const pcl::PointCloud<_Tp>* getPointCloudPtrInternal(
const ito::PCLPointCloud &pc);
627#if PCL_VERSION_COMPARE(>=,1,7,0)
629 template<
typename _Tp>
friend pcl::PCLHeader GetHeaderFunc(
const ito::PCLPointCloud *pc);
632 template<
typename _Tp>
friend std_msgs::Header GetHeaderFunc(
const ito::PCLPointCloud *pc);
636 template<
typename _Tp>
friend void SetHeightFunc(
ito::PCLPointCloud *pc, uint32_t height);
639 template<
typename _Tp>
friend void SetWidthFunc(
ito::PCLPointCloud *pc, uint32_t width);
644 template<
typename _Tp>
friend void ReserveResizeFunc(
ito::PCLPointCloud *pc,
size_t n,
bool reserveNotResize);
646 template<
typename _Tp>
friend void EraseFunc(
ito::PCLPointCloud *pc, uint32_t startIndex, uint32_t endIndex);
648 template<
typename _Tp>
friend void ScaleXYZFunc(
ito::PCLPointCloud *pc, ito::float32 scaleX, ito::float32 scaleY, ito::float32 scaleZ);
649 template<
typename _Tp>
friend std::string GetFieldsListFunc(
const ito::PCLPointCloud *pc);
678 inline pcl::PolygonMesh::Ptr polygonMesh() {
return m_polygonMesh; }
679 inline pcl::PolygonMesh::ConstPtr polygonMesh()
const {
return m_polygonMesh; }
681 inline void setPolygonMesh(pcl::PolygonMesh::Ptr &mesh) { m_polygonMesh = mesh; }
684 inline bool valid()
const {
return m_valid; }
686 size_t height()
const;
687 size_t width()
const;
688 std::string getFieldsList()
const;
690 std::ostream& streamOut(std::ostream& out);
generic class that covers one single point cloud of different possible types provided by the Point Cl...
Definition pclStructures.h:293
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr toPointXYZRGBNormal() const
returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBNormal> cloud.
Definition pclStructures.h:414
pcl::PointCloud< pcl::PointXYZ >::ConstPtr toPointXYZConst() const
returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZ> cloud.
Definition pclStructures.h:424
pcl::PointCloud< pcl::PointXYZ >::Ptr m_pcXYZ
Definition pclStructures.h:652
pcl::PointCloud< pcl::PointXYZRGBNormal >::ConstPtr toPointXYZRGBNormalConst() const
returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBNormal> cloud.
Definition pclStructures.h:474
int hasIntensity() const
if this cloud has the intensity component returns != 0, else 0
Definition pclStructures.h:355
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr m_pcXYZRGBA
Definition pclStructures.h:654
PCLPointCloud(pcl::PointCloud< pcl::PointXYZI >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZI>
Definition pclStructures.h:307
pcl::PointCloud< pcl::PointNormal >::Ptr m_pcXYZNormal
Definition pclStructures.h:655
pcl::PointCloud< pcl::PointXYZI >::Ptr m_pcXYZI
Definition pclStructures.h:653
pcl::PointCloud< pcl::PointXYZINormal >::Ptr m_pcXYZINormal
Definition pclStructures.h:656
PCLPointCloud(pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZRGBNormal>
Definition pclStructures.h:319
ito::tPCLPointType getType() const
returns type of covered point cloud or ito::pclInvalid if invalid point cloud.
Definition pclStructures.h:343
~PCLPointCloud()
destructor
Definition pclStructures.h:340
pcl::PointCloud< pcl::PointNormal >::Ptr toPointXYZNormal() const
returns a shared pointer to the internal pcl::PointCloud<pcl::PointNormal> cloud.
Definition pclStructures.h:394
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr m_pcXYZRGBNormal
Definition pclStructures.h:657
pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr toPointXYZRGBAConst() const
returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBA> cloud.
Definition pclStructures.h:444
PCLPointCloud(pcl::PointCloud< pcl::PointXYZINormal >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZINormal>
Definition pclStructures.h:316
PCLPointCloud(ito::tPCLPointType type)
constructor for an empty point cloud of the desired type
Definition pclStructures.h:299
pcl::PointCloud< pcl::PointXYZI >::ConstPtr toPointXYZIConst() const
returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZI> cloud.
Definition pclStructures.h:434
ito::tPCLPointType m_type
Definition pclStructures.h:659
pcl::PointCloud< pcl::PointXYZINormal >::ConstPtr toPointXYZINormalConst() const
returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointXYZINormal> cloud.
Definition pclStructures.h:464
pcl::PointCloud< pcl::PointNormal >::ConstPtr toPointXYZNormalConst() const
returns a constant shared pointer to the internal pcl::PointCloud<pcl::PointNormal> cloud.
Definition pclStructures.h:454
PCLPointCloud()
constructor for an empty, invalid point cloud
Definition pclStructures.h:296
int hasRGB() const
if this cloud has color components returns != 0, else 0
Definition pclStructures.h:349
pcl::PointCloud< pcl::PointXYZINormal >::Ptr toPointXYZINormal() const
returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZINormal> cloud.
Definition pclStructures.h:404
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr toPointXYZRGBA() const
returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZRGBA> cloud.
Definition pclStructures.h:384
pcl::PointCloud< pcl::PointXYZ >::Ptr toPointXYZ() const
returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZ> cloud.
Definition pclStructures.h:364
PCLPointCloud(pcl::PointCloud< pcl::PointXYZRGBA >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZRGBA>
Definition pclStructures.h:310
PCLPointCloud(pcl::PointCloud< pcl::PointNormal >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud<pcl::PointNormal>
Definition pclStructures.h:313
int hasNormal() const
if this cloud has the normal components returns != 0, else 0
Definition pclStructures.h:352
pcl::PointCloud< pcl::PointXYZI >::Ptr toPointXYZI() const
returns a shared pointer to the internal pcl::PointCloud<pcl::PointXYZI> cloud.
Definition pclStructures.h:374
PCLPointCloud(pcl::PointCloud< pcl::PointXYZ >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud<pcl::PointXYZ>
Definition pclStructures.h:304
int hasCurvature() const
if this cloud has the curvature component returns != 0, else 0
Definition pclStructures.h:358
generic class that covers one single point of different possible types provided by the Point Cloud Li...
Definition pclStructures.h:74
PCLPoint(const pcl::PointXYZ &point)
copy constructor from point of PCL type pcl::PointXYZ
Definition pclStructures.h:112
PCLPoint(const pcl::PointXYZRGBA &point)
copy constructor from point of PCL type pcl::PointXYZRGBA
Definition pclStructures.h:124
void * m_genericPoint
Definition pclStructures.h:241
PCLPoint(ito::tPCLPointType type)
constructor with desired point type. The specific point is created but not initialized with desired v...
Definition pclStructures.h:80
~PCLPoint()
destructor
Definition pclStructures.h:161
PCLPoint()
empty constructor creates invalid point type
Definition pclStructures.h:77
ito::tPCLPointType m_type
Definition pclStructures.h:242
ito::tPCLPointType getType() const
returns type of covered point type or ito::pclInvalid if invalid point.
Definition pclStructures.h:180
PCLPoint(const pcl::PointXYZI &point)
copy constructor from point of PCL type pcl::PointXYZI
Definition pclStructures.h:118
PCLPoint(const pcl::PointXYZINormal &point)
copy constructor from point of PCL type pcl::PointXYZINormal
Definition pclStructures.h:136
PCLPoint(const PCLPoint &p)
copy constructor from another instance of PCLPoint
Definition pclStructures.h:148
PCLPoint(const pcl::PointXYZRGBNormal &point)
copy constructor from point of PCL type pcl::PointXYZRGBNormal
Definition pclStructures.h:142
PCLPoint(const pcl::PointNormal &point)
copy constructor from point of PCL type pcl::PointNormal
Definition pclStructures.h:130
generic class that covers a shared pointer to pcl::PolygonMesh that is a class for a polygonal mesh p...
Definition pclStructures.h:668
pcl::PolygonMesh::Ptr m_polygonMesh
Definition pclStructures.h:696
bool m_valid
Definition pclStructures.h:695
Definition apiFunctionsGraph.cpp:40
tPCLPointType
Definition typeDefs.h:109
@ pclXYZNormal
Definition typeDefs.h:114
@ pclXYZ
Definition typeDefs.h:111
@ pclXYZI
Definition typeDefs.h:112
@ pclXYZRGBNormal
Definition typeDefs.h:116
@ pclXYZINormal
Definition typeDefs.h:115
@ pclInvalid
Definition typeDefs.h:110
@ pclXYZRGBA
Definition typeDefs.h:113