itom  4.1.0
pclStructures.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 #ifndef PCLSTRUCTURES_H
29 #define PCLSTRUCTURES_H
30 
31 #include "pclDefines.h"
32 #include "../common/typeDefs.h"
33 
34 #include <vector>
35 
36 #ifdef WIN32
37 #pragma warning( disable: 4996) //supress deprecated warning of pcl (which occur very often)
38 #endif
39 #include <pcl/point_types.h>
40 #include <pcl/point_cloud.h>
41 #include <pcl/PolygonMesh.h>
42 #ifdef WIN32
43 #pragma warning( default: 4996) //show 4996 warnings again
44 #endif
45 
46 
47 
48 namespace ito
49 {
50 
51 #if PCL_VERSION_COMPARE(>,1,5,1)
52  #define PCLALPHA a
53 #else
54  #define PCLALPHA _unused
55 #endif
56 
57 //----------------------------------------------------------------------------------------------------------------------------------
73 class POINTCLOUD_EXPORT PCLPoint
74 {
75 public:
77  PCLPoint() : m_genericPoint(NULL), m_type(ito::pclInvalid) {}
78 
80  PCLPoint(ito::tPCLPointType type) : m_genericPoint(NULL), m_type(type)
81  {
82  switch(m_type)
83  {
84  case ito::pclXYZ:
85  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZ());
86  break;
87  case ito::pclXYZI:
88  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZI());
89  break;
90  case ito::pclXYZRGBA:
91  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZRGBA());
92  break;
93  case ito::pclXYZNormal:
94  m_genericPoint = reinterpret_cast<void*>(new pcl::PointNormal());
95  break;
96  case ito::pclXYZINormal:
97  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZINormal());
98  break;
100  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZRGBNormal());
101  break;
102  default:
103  //m_genericPoint = NULL;
104  break;
105  }
106  }
107 
109  void copyFromVoidPtrAndType(void* ptr, ito::tPCLPointType type);
110 
112  PCLPoint(const pcl::PointXYZ &point) : m_genericPoint(NULL), m_type(ito::pclXYZ)
113  {
114  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZ(point));
115  }
116 
118  PCLPoint(const pcl::PointXYZI &point) : m_genericPoint(NULL), m_type(ito::pclXYZI)
119  {
120  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZI(point));
121  }
122 
124  PCLPoint(const pcl::PointXYZRGBA &point) : m_genericPoint(NULL), m_type(ito::pclXYZRGBA)
125  {
126  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZRGBA(point));
127  }
128 
130  PCLPoint(const pcl::PointNormal &point) : m_genericPoint(NULL), m_type(ito::pclXYZNormal)
131  {
132  m_genericPoint = reinterpret_cast<void*>(new pcl::PointNormal(point));
133  }
134 
136  PCLPoint(const pcl::PointXYZINormal &point) : m_genericPoint(NULL), m_type(ito::pclXYZINormal)
137  {
138  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZINormal(point));
139  }
140 
142  PCLPoint(const pcl::PointXYZRGBNormal &point) : m_genericPoint(NULL), m_type(ito::pclXYZRGBNormal)
143  {
144  m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZRGBNormal(point));
145  }
146 
148  PCLPoint ( const PCLPoint & p ) : m_genericPoint(NULL), m_type(ito::pclInvalid)
149  {
150  copyFromVoidPtrAndType( p.m_genericPoint, p.m_type);
151  }
152 
154  PCLPoint & operator= ( const PCLPoint & p )
155  {
156  copyFromVoidPtrAndType( p.m_genericPoint, p.m_type);
157  return *this;
158  }
159 
162  {
163  if(m_genericPoint)
164  {
165  switch(m_type)
166  {
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;
173  default: break;
174  }
175  m_genericPoint = NULL;
176  }
177  }
178 
180  inline ito::tPCLPointType getType() const { return m_type; }
181 
183 
186  const pcl::PointXYZ & getPointXYZ() const;
187 
189 
192  const pcl::PointXYZI & getPointXYZI() const;
193 
195 
198  const pcl::PointXYZRGBA & getPointXYZRGBA() const;
199 
201 
204  const pcl::PointNormal & getPointXYZNormal() const;
205 
207 
210  const pcl::PointXYZINormal & getPointXYZINormal() const;
211 
213 
216  const pcl::PointXYZRGBNormal & getPointXYZRGBNormal() const;
217 
218  pcl::PointXYZ & getPointXYZ();
219  pcl::PointXYZI & getPointXYZI();
220  pcl::PointXYZRGBA & getPointXYZRGBA();
221  pcl::PointNormal & getPointXYZNormal();
222  pcl::PointXYZINormal & getPointXYZINormal();
223  pcl::PointXYZRGBNormal & getPointXYZRGBNormal();
224 
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);
235 
236 
237 private:
238  template<typename _Tp> friend _Tp* getPointPtrInternal(ito::PCLPoint &point);
239  template<typename _Tp> friend const _Tp* getPointPtrInternal(const ito::PCLPoint &point);
240 
243 };
244 
245 // Forward declaration of friend methods
246 #ifdef __APPLE__
247  class PCLPointCloud;
248  template<typename _Tp> pcl::PointCloud<_Tp>* getPointCloudPtrInternal(ito::PCLPointCloud &pc);
249  template<typename _Tp> const pcl::PointCloud<_Tp>* getPointCloudPtrInternal(const ito::PCLPointCloud &pc);
250 
251 #if PCL_VERSION_COMPARE(>=,1,7,0)
252  template<typename _Tp> pcl::PCLHeader GetHeaderFunc(ito::PCLPointCloud &pc);
253  template<typename _Tp> pcl::PCLHeader GetHeaderFunc(const ito::PCLPointCloud *pc);
254 #else
255  template<typename _Tp> std_msgs::Header GetHeaderFunc(ito::PCLPointCloud &pc);
256  template<typename _Tp> std_msgs::Header GetHeaderFunc(const ito::PCLPointCloud *pc);
257 #endif
258  template<typename _Tp> uint32_t GetWidthFunc(const ito::PCLPointCloud *pc);
259  template<typename _Tp> uint32_t GetHeightFunc(const ito::PCLPointCloud *pc);
260  template<typename _Tp> void SetHeightFunc(ito::PCLPointCloud *pc, uint32_t height);
261  template<typename _Tp> bool GetDenseFunc(const ito::PCLPointCloud *pc);
262  template<typename _Tp> void SetDenseFunc(ito::PCLPointCloud *pc, bool dense);
263  template<typename _Tp> void SetWidthFunc(ito::PCLPointCloud *pc, uint32_t width);
264  template<typename _Tp> void PcAddFunc(ito::PCLPointCloud *pc1, const ito::PCLPointCloud *pc2, ito::PCLPointCloud *pcRes);
265  template<typename _Tp> void SetItemFunc(ito::PCLPointCloud *pc, size_t n, ito::PCLPoint &point);
266  template<typename _Tp> void PushBackFunc(ito::PCLPointCloud * pc, const ito::PCLPoint & point);
267  template<typename _Tp> bool EmptyFunc(const ito::PCLPointCloud *pc);
268  template<typename _Tp> void ReserveResizeFunc(ito::PCLPointCloud *pc, size_t n, bool reserveNotResize);
269  template<typename _Tp> void ClearFunc(ito::PCLPointCloud *pc);
270  template<typename _Tp> void EraseFunc(ito::PCLPointCloud *pc, uint32_t startIndex, uint32_t endIndex);
271  template<typename _Tp> void InsertFunc(ito::PCLPointCloud *pc, uint32_t index, const ito::PCLPoint& point);
272  template<typename _Tp> std::string GetFieldsListFunc(const ito::PCLPointCloud *pc);
273 #endif // __APPLE__
274 
275 //----------------------------------------------------------------------------------------------------------------------------------
292 class POINTCLOUD_EXPORT PCLPointCloud
293 {
294 public:
296  PCLPointCloud() : m_type(ito::pclInvalid) {};
297 
299  PCLPointCloud(ito::tPCLPointType type) : m_type(type)
300  {
301  createEmptyPointCloud(type);
302  };
304  PCLPointCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr pclPtr) : m_pcXYZ(pclPtr), m_type(ito::pclXYZ) {};
305 
307  PCLPointCloud(pcl::PointCloud<pcl::PointXYZI>::Ptr pclPtr) : m_pcXYZI(pclPtr), m_type(ito::pclXYZI) {};
308 
310  PCLPointCloud(pcl::PointCloud<pcl::PointXYZRGBA>::Ptr pclPtr) : m_pcXYZRGBA(pclPtr), m_type(ito::pclXYZRGBA) {};
311 
313  PCLPointCloud(pcl::PointCloud<pcl::PointNormal>::Ptr pclPtr) : m_pcXYZNormal(pclPtr), m_type(ito::pclXYZNormal) {};
314 
316  PCLPointCloud(pcl::PointCloud<pcl::PointXYZINormal>::Ptr pclPtr) : m_pcXYZINormal(pclPtr), m_type(ito::pclXYZINormal) {};
317 
319  PCLPointCloud(pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr pclPtr) : m_pcXYZRGBNormal(pclPtr), m_type(ito::pclXYZRGBNormal) {};
320 
322 
325  PCLPointCloud(uint32_t width_, uint32_t height_, ito::tPCLPointType type_, const PCLPoint &value_ = PCLPoint());
326 
329 
331  PCLPointCloud(const PCLPointCloud &pc);
332 
334 
337  PCLPointCloud(const PCLPointCloud &pc, const std::vector< int > &indices);
338 
341 
343  inline ito::tPCLPointType getType() const
344  {
345  return m_type;
346  };
347 
349  inline int hasRGB() const { return m_type & (ito::pclXYZRGBNormal | ito::pclXYZRGBA); }
350 
352  inline int hasNormal() const { return m_type & (ito::pclXYZINormal | ito::pclXYZNormal | ito::pclXYZRGBNormal); }
353 
355  inline int hasIntensity() const { return m_type & ( ito::pclXYZI | ito::pclXYZINormal ); }
356 
358  inline int hasCurvature() const { return m_type & (ito::pclXYZINormal | ito::pclXYZNormal | ito::pclXYZRGBNormal); }
359 
361 
364  inline pcl::PointCloud<pcl::PointXYZ>::Ptr toPointXYZ() const
365  {
366  if(m_type == ito::pclXYZ) return m_pcXYZ;
367  throw pcl::PCLException("point cloud has not the desired type PointXYZ",__FILE__, "toPointXYZ", __LINE__);
368  };
369 
371 
374  inline pcl::PointCloud<pcl::PointXYZI>::Ptr toPointXYZI() const
375  {
376  if(m_type == ito::pclXYZI) return m_pcXYZI;
377  throw pcl::PCLException("point cloud has not the desired type PointXYZI",__FILE__, "toPointXYZI", __LINE__);
378  };
379 
381 
384  inline pcl::PointCloud<pcl::PointXYZRGBA>::Ptr toPointXYZRGBA() const
385  {
386  if(m_type == ito::pclXYZRGBA) return m_pcXYZRGBA;
387  throw pcl::PCLException("point cloud has not the desired type PointXYZRGBA",__FILE__, "toPointXYZRGBA", __LINE__);
388  };
389 
391 
394  inline pcl::PointCloud<pcl::PointNormal>::Ptr toPointXYZNormal() const
395  {
396  if(m_type == ito::pclXYZNormal) return m_pcXYZNormal;
397  throw pcl::PCLException("point cloud has not the desired type PointXYZNormal",__FILE__, "toPointXYZNormal", __LINE__);
398  };
399 
401 
404  inline pcl::PointCloud<pcl::PointXYZINormal>::Ptr toPointXYZINormal() const
405  {
406  if(m_type == ito::pclXYZINormal) return m_pcXYZINormal;
407  throw pcl::PCLException("point cloud has not the desired type PointXYZINormal",__FILE__, "toPointXYZINormal", __LINE__);
408  };
409 
411 
414  inline pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr toPointXYZRGBNormal() const
415  {
416  if(m_type == ito::pclXYZRGBNormal) return m_pcXYZRGBNormal;
417  throw pcl::PCLException("point cloud has not the desired type PointXYZRGBNormal",__FILE__, "toPointXYZRGBNormal", __LINE__);
418  };
419 
421 
424  inline pcl::PointCloud<pcl::PointXYZ>::ConstPtr toPointXYZConst() const
425  {
426  if(m_type == ito::pclXYZ) return m_pcXYZ;
427  throw pcl::PCLException("point cloud has not the desired type PointXYZ",__FILE__, "toPointXYZ", __LINE__);
428  };
429 
431 
434  inline pcl::PointCloud<pcl::PointXYZI>::ConstPtr toPointXYZIConst() const
435  {
436  if(m_type == ito::pclXYZI) return m_pcXYZI;
437  throw pcl::PCLException("point cloud has not the desired type PointXYZI",__FILE__, "toPointXYZI", __LINE__);
438  };
439 
441 
444  inline pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr toPointXYZRGBAConst() const
445  {
446  if(m_type == ito::pclXYZRGBA) return m_pcXYZRGBA;
447  throw pcl::PCLException("point cloud has not the desired type PointXYZRGBA",__FILE__, "toPointXYZRGBA", __LINE__);
448  };
449 
451 
454  inline pcl::PointCloud<pcl::PointNormal>::ConstPtr toPointXYZNormalConst() const
455  {
456  if(m_type == ito::pclXYZNormal) return m_pcXYZNormal;
457  throw pcl::PCLException("point cloud has not the desired type PointXYZNormal",__FILE__, "toPointXYZNormal", __LINE__);
458  };
459 
461 
464  inline pcl::PointCloud<pcl::PointXYZINormal>::ConstPtr toPointXYZINormalConst() const
465  {
466  if(m_type == ito::pclXYZINormal) return m_pcXYZINormal;
467  throw pcl::PCLException("point cloud has not the desired type PointXYZINormal",__FILE__, "toPointXYZINormal", __LINE__);
468  };
469 
471 
474  inline pcl::PointCloud<pcl::PointXYZRGBNormal>::ConstPtr toPointXYZRGBNormalConst() const
475  {
476  if(m_type == ito::pclXYZRGBNormal) return m_pcXYZRGBNormal;
477  throw pcl::PCLException("point cloud has not the desired type PointXYZRGBNormal",__FILE__, "toPointXYZRGBNormal", __LINE__);
478  };
479 
481 
484  PCLPointCloud & operator+= (const PCLPointCloud &rhs);
485 
487 
490  const PCLPointCloud operator+ (const PCLPointCloud &rhs);
491 
493  PCLPointCloud & operator= (const PCLPointCloud &copy);
494 
496  PCLPointCloud copy() const;
497 
499 
502  const PCLPoint operator[] (size_t n) const;
503 
505 
508  const PCLPoint at (size_t n) const;
509 
511 
514  void set_item(size_t n, PCLPoint &point);
515 
517  bool isOrganized() const;
518 
520  uint32_t width() const;
521 
523  uint32_t height() const;
524 
526  size_t size() const;
527 
529  bool is_dense() const;
530 
532  void set_width(uint32_t width);
533 
535  void set_height(uint32_t height);
536 
538  void set_dense(bool dense);
539 
541  void scaleXYZ(float32 scaleX, float32 scaleY, float32 scaleZ);
542 
544  void moveXYZ(float32 dX, float32 dY, float32 dZ);
545 
547 #if PCL_VERSION_COMPARE(>=,1,7,0)
548  pcl::PCLHeader header() const;
549 #else
550  std_msgs::Header header() const;
551 #endif
552 
554  std::string getFieldsList() const;
555 
557 #if PCL_VERSION_COMPARE(>=,1,7,0)
558  std::vector<pcl::PCLPointField> getFieldsInfo() const;
559 #else
560  std::vector<sensor_msgs::PointField> getFieldsInfo() const;
561 #endif
562 
564  unsigned char* genericPointAccess(size_t &strideBytes) const;
565 
567  void push_back(const ito::PCLPoint &pt);
568 
570  bool empty() const;
571 
573  void reserve(size_t n);
574 
576  void resize(size_t n);
577 
579  void clear();
580 
582  void erase(uint32_t startIndex, uint32_t endIndex);
583 
585  void insert(uint32_t index, const ito::PCLPoint& point);
586 
587 protected:
589  void setInvalid();
590 
592  void createEmptyPointCloud(ito::tPCLPointType type);
593 
594 private:
595 
596  inline int getFuncListIndex() const
597  {
598  switch(m_type)
599  {
600  case ito::pclXYZ: return 0;
601  case ito::pclXYZI: return 1;
602  case ito::pclXYZRGBA: return 2;
603  case ito::pclXYZNormal: return 3;
604  case ito::pclXYZINormal: return 4;
605  case ito::pclXYZRGBNormal: return 5;
606  default: return -1;
607  }
608  };
609 
610  inline int getFuncListIndex(const ito::tPCLPointType &type) const
611  {
612  switch(type)
613  {
614  case ito::pclXYZ: return 0;
615  case ito::pclXYZI: return 1;
616  case ito::pclXYZRGBA: return 2;
617  case ito::pclXYZNormal: return 3;
618  case ito::pclXYZINormal: return 4;
619  case ito::pclXYZRGBNormal: return 5;
620  default: return -1;
621  }
622  };
623 
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);
626 
627 #if PCL_VERSION_COMPARE(>=,1,7,0)
628  template<typename _Tp> friend pcl::PCLHeader GetHeaderFunc(ito::PCLPointCloud &pc);
629  template<typename _Tp> friend pcl::PCLHeader GetHeaderFunc(const ito::PCLPointCloud *pc);
630 #else
631  template<typename _Tp> friend std_msgs::Header GetHeaderFunc(ito::PCLPointCloud &pc);
632  template<typename _Tp> friend std_msgs::Header GetHeaderFunc(const ito::PCLPointCloud *pc);
633 #endif
634  template<typename _Tp> friend uint32_t GetWidthFunc(const ito::PCLPointCloud *pc);
635  template<typename _Tp> friend uint32_t GetHeightFunc(const ito::PCLPointCloud *pc);
636  template<typename _Tp> friend void SetHeightFunc(ito::PCLPointCloud *pc, uint32_t height);
637  template<typename _Tp> friend bool GetDenseFunc(const ito::PCLPointCloud *pc);
638  template<typename _Tp> friend void SetDenseFunc(ito::PCLPointCloud *pc, bool dense);
639  template<typename _Tp> friend void SetWidthFunc(ito::PCLPointCloud *pc, uint32_t width);
640  template<typename _Tp> friend void PcAddFunc(ito::PCLPointCloud *pc1, const ito::PCLPointCloud *pc2, ito::PCLPointCloud *pcRes);
641  template<typename _Tp> friend void SetItemFunc(ito::PCLPointCloud *pc, size_t n, ito::PCLPoint &point);
642  template<typename _Tp> friend void PushBackFunc(ito::PCLPointCloud * pc, const ito::PCLPoint & point);
643  template<typename _Tp> friend bool EmptyFunc(const ito::PCLPointCloud *pc);
644  template<typename _Tp> friend void ReserveResizeFunc(ito::PCLPointCloud *pc, size_t n, bool reserveNotResize);
645  template<typename _Tp> friend void ClearFunc(ito::PCLPointCloud *pc);
646  template<typename _Tp> friend void EraseFunc(ito::PCLPointCloud *pc, uint32_t startIndex, uint32_t endIndex);
647  template<typename _Tp> friend void InsertFunc(ito::PCLPointCloud *pc, uint32_t index, const ito::PCLPoint& point);
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);
650 
651 
652  pcl::PointCloud<pcl::PointXYZ>::Ptr m_pcXYZ;
653  pcl::PointCloud<pcl::PointXYZI>::Ptr m_pcXYZI;
654  pcl::PointCloud<pcl::PointXYZRGBA>::Ptr m_pcXYZRGBA;
655  pcl::PointCloud<pcl::PointNormal>::Ptr m_pcXYZNormal;
656  pcl::PointCloud<pcl::PointXYZINormal>::Ptr m_pcXYZINormal;
657  pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr m_pcXYZRGBNormal;
660 };
661 
662 //----------------------------------------------------------------------------------------------------------------------------------
667 class POINTCLOUD_EXPORT PCLPolygonMesh
668 {
669 public:
670  PCLPolygonMesh();
671  PCLPolygonMesh(pcl::PolygonMesh::Ptr polygonMesh);
673  PCLPolygonMesh(PCLPolygonMesh &mesh, const std::vector<uint32_t> &polygonIndices);
674  PCLPolygonMesh(const PCLPointCloud &cloud, const std::vector<pcl::Vertices> &polygons);
675  PCLPolygonMesh(const PCLPolygonMesh &mesh);
676  ~PCLPolygonMesh();
677 
678  inline pcl::PolygonMesh::Ptr polygonMesh() { return m_polygonMesh; }
679  inline pcl::PolygonMesh::ConstPtr polygonMesh() const { return m_polygonMesh; }
680 
681  inline void setPolygonMesh(pcl::PolygonMesh::Ptr &mesh) { m_polygonMesh = mesh; }
682  PCLPolygonMesh & operator= (const PCLPolygonMesh &copy);
683 
684  inline bool valid() const { return m_valid; }
685 
686  size_t height() const;
687  size_t width() const;
688  std::string getFieldsList() const;
689 
690  std::ostream& streamOut(std::ostream& out);
691 
692 protected:
693 
694 private:
695  bool m_valid;
696  pcl::PolygonMesh::Ptr m_polygonMesh;
697 };
698 
699 } //end namespace ito
700 
701 
702 
703 
704 #endif
pcl::PointCloud< pcl::PointXYZ >::ConstPtr toPointXYZConst() const
returns a constant shared pointer to the internal pcl::PointCloud cloud.
Definition: pclStructures.h:424
generic class that covers one single point of different possible types provided by the Point Cloud Li...
Definition: pclStructures.h:73
ito::tPCLPointType getType() const
returns type of covered point cloud or ito::pclInvalid if invalid point cloud.
Definition: pclStructures.h:343
PCLPoint()
empty constructor creates invalid point type
Definition: pclStructures.h:77
pcl::PointCloud< pcl::PointXYZ >::Ptr m_pcXYZ
Definition: pclStructures.h:652
generic class that covers one single point cloud of different possible types provided by the Point Cl...
Definition: pclStructures.h:292
int hasIntensity() const
if this cloud has the intensity component returns != 0, else 0
Definition: pclStructures.h:355
Definition: typeDefs.h:110
PCLPointCloud(pcl::PointCloud< pcl::PointNormal >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud
Definition: pclStructures.h:313
pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr toPointXYZRGBAConst() const
returns a constant shared pointer to the internal pcl::PointCloud cloud...
Definition: pclStructures.h:444
Definition: typeDefs.h:114
pcl::PointCloud< pcl::PointNormal >::ConstPtr toPointXYZNormalConst() const
returns a constant shared pointer to the internal pcl::PointCloud cloud...
Definition: pclStructures.h:454
generic class that covers a shared pointer to pcl::PolygonMesh that is a class for a polygonal mesh p...
Definition: pclStructures.h:667
Definition: typeDefs.h:111
pcl::PointCloud< pcl::PointXYZI >::Ptr toPointXYZI() const
returns a shared pointer to the internal pcl::PointCloud cloud.
Definition: pclStructures.h:374
PCLPointCloud(pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud
Definition: pclStructures.h:319
PCLPointCloud(pcl::PointCloud< pcl::PointXYZINormal >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud
Definition: pclStructures.h:316
PCLPoint(const PCLPoint &p)
copy constructor from another instance of PCLPoint
Definition: pclStructures.h:148
void * m_genericPoint
Definition: pclStructures.h:241
int hasRGB() const
if this cloud has color components returns != 0, else 0
Definition: pclStructures.h:349
~PCLPointCloud()
destructor
Definition: pclStructures.h:340
pcl::PointCloud< pcl::PointXYZI >::Ptr m_pcXYZI
Definition: pclStructures.h:653
PCLPointCloud(pcl::PointCloud< pcl::PointXYZI >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud
Definition: pclStructures.h:307
Definition: apiFunctionsGraph.cpp:39
pcl::PointCloud< pcl::PointXYZINormal >::Ptr m_pcXYZINormal
Definition: pclStructures.h:656
Definition: typeDefs.h:112
PCLPoint(const pcl::PointXYZI &point)
copy constructor from point of PCL type pcl::PointXYZI
Definition: pclStructures.h:118
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr m_pcXYZRGBNormal
Definition: pclStructures.h:657
PCLPoint(const pcl::PointXYZ &point)
copy constructor from point of PCL type pcl::PointXYZ
Definition: pclStructures.h:112
ito::tPCLPointType m_type
Definition: pclStructures.h:659
tPCLPointType
Definition: typeDefs.h:106
pcl::PointCloud< pcl::PointNormal >::Ptr m_pcXYZNormal
Definition: pclStructures.h:655
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr toPointXYZRGBA() const
returns a shared pointer to the internal pcl::PointCloud cloud.
Definition: pclStructures.h:384
PCLPointCloud(pcl::PointCloud< pcl::PointXYZRGBA >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud
Definition: pclStructures.h:310
Definition: typeDefs.h:108
pcl::PolygonMesh::Ptr m_polygonMesh
Definition: pclStructures.h:696
Definition: typeDefs.h:113
~PCLPoint()
destructor
Definition: pclStructures.h:161
PCLPoint(const pcl::PointXYZINormal &point)
copy constructor from point of PCL type pcl::PointXYZINormal
Definition: pclStructures.h:136
pcl::PointCloud< pcl::PointXYZRGBNormal >::ConstPtr toPointXYZRGBNormalConst() const
returns a constant shared pointer to the internal pcl::PointCloud cloud...
Definition: pclStructures.h:474
int hasCurvature() const
if this cloud has the curvature component returns != 0, else 0
Definition: pclStructures.h:358
PCLPoint(ito::tPCLPointType type)
constructor with desired point type. The specific point is created but not initialized with desired v...
Definition: pclStructures.h:80
pcl::PointCloud< pcl::PointNormal >::Ptr toPointXYZNormal() const
returns a shared pointer to the internal pcl::PointCloud cloud. ...
Definition: pclStructures.h:394
PCLPointCloud(ito::tPCLPointType type)
constructor for an empty point cloud of the desired type
Definition: pclStructures.h:299
int hasNormal() const
if this cloud has the normal components returns != 0, else 0
Definition: pclStructures.h:352
Definition: typeDefs.h:109
PCLPoint(const pcl::PointXYZRGBNormal &point)
copy constructor from point of PCL type pcl::PointXYZRGBNormal
Definition: pclStructures.h:142
PCLPoint(const pcl::PointXYZRGBA &point)
copy constructor from point of PCL type pcl::PointXYZRGBA
Definition: pclStructures.h:124
pcl::PointCloud< pcl::PointXYZINormal >::Ptr toPointXYZINormal() const
returns a shared pointer to the internal pcl::PointCloud cloud.
Definition: pclStructures.h:404
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr m_pcXYZRGBA
Definition: pclStructures.h:654
pcl::PointCloud< pcl::PointXYZI >::ConstPtr toPointXYZIConst() const
returns a constant shared pointer to the internal pcl::PointCloud cloud...
Definition: pclStructures.h:434
PCLPointCloud()
constructor for an empty, invalid point cloud
Definition: pclStructures.h:296
bool m_valid
Definition: pclStructures.h:695
pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr toPointXYZRGBNormal() const
returns a shared pointer to the internal pcl::PointCloud cloud.
Definition: pclStructures.h:414
PCLPoint(const pcl::PointNormal &point)
copy constructor from point of PCL type pcl::PointNormal
Definition: pclStructures.h:130
pcl::PointCloud< pcl::PointXYZ >::Ptr toPointXYZ() const
returns a shared pointer to the internal pcl::PointCloud cloud.
Definition: pclStructures.h:364
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
pcl::PointCloud< pcl::PointXYZINormal >::ConstPtr toPointXYZINormalConst() const
returns a constant shared pointer to the internal pcl::PointCloud cloud...
Definition: pclStructures.h:464
PCLPointCloud(pcl::PointCloud< pcl::PointXYZ >::Ptr pclPtr)
constructor from given shared pointer of pcl::PointCloud
Definition: pclStructures.h:304