itom 2.2.1
K:/git-itom/sources/itom/PointCloud/pclStructures.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2016, Institut fuer Technische Optik (ITO),
00005     Universitaet Stuttgart, Germany
00006 
00007     This file is part of itom and its software development toolkit (SDK).
00008 
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013    
00014     In addition, as a special exception, the Institut fuer Technische
00015     Optik (ITO) gives you certain additional rights.
00016     These rights are described in the ITO LGPL Exception version 1.0,
00017     which can be found in the file LGPL_EXCEPTION.txt in this package.
00018 
00019     itom is distributed in the hope that it will be useful, but
00020     WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00022     General Public Licence for more details.
00023 
00024     You should have received a copy of the GNU Library General Public License
00025     along with itom. If not, see <http://www.gnu.org/licenses/>.
00026 *********************************************************************** */
00027 
00028 #ifndef PCLSTRUCTURES_H
00029 #define PCLSTRUCTURES_H
00030 
00031 #include "pclDefines.h"
00032 #include "../common/typeDefs.h"
00033 
00034 #include <vector>
00035 
00036 #ifdef WIN32
00037 #pragma warning( disable: 4996) //supress deprecated warning of pcl (which occur very often)
00038 #endif
00039 #include <pcl/point_types.h>
00040 #include <pcl/point_cloud.h>
00041 #include <pcl/PolygonMesh.h>
00042 #ifdef WIN32
00043 #pragma warning( default: 4996) //show 4996 warnings again
00044 #endif
00045 
00046 
00047 
00048 namespace ito
00049 {
00050 
00051 #if PCL_VERSION_COMPARE(>,1,5,1)
00052     #define PCLALPHA a
00053 #else
00054     #define PCLALPHA _unused
00055 #endif
00056 
00057 //----------------------------------------------------------------------------------------------------------------------------------
00073 class POINTCLOUD_EXPORT PCLPoint
00074 {
00075 public:
00077     PCLPoint() : m_genericPoint(NULL), m_type(ito::pclInvalid) {}
00078 
00080     PCLPoint(ito::tPCLPointType type) : m_genericPoint(NULL), m_type(type)
00081     {
00082         switch(m_type)
00083         {
00084             case ito::pclXYZ:
00085                 m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZ());
00086                 break;
00087             case ito::pclXYZI:
00088                 m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZI());
00089                 break;
00090             case ito::pclXYZRGBA:
00091                 m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZRGBA());
00092                 break;
00093             case ito::pclXYZNormal:
00094                 m_genericPoint = reinterpret_cast<void*>(new pcl::PointNormal());
00095                 break;
00096             case ito::pclXYZINormal:
00097                 m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZINormal());
00098                 break;
00099             case ito::pclXYZRGBNormal:
00100                 m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZRGBNormal());
00101                 break;
00102             default:
00103                 //m_genericPoint = NULL;
00104                 break;
00105         }
00106     }
00107 
00109     void copyFromVoidPtrAndType(void* ptr, ito::tPCLPointType type);
00110 
00112     PCLPoint(const pcl::PointXYZ &point) : m_genericPoint(NULL), m_type(ito::pclXYZ) 
00113     { 
00114         m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZ(point));
00115     }
00116 
00118     PCLPoint(const pcl::PointXYZI &point) : m_genericPoint(NULL), m_type(ito::pclXYZI) 
00119     { 
00120         m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZI(point));
00121     }
00122 
00124     PCLPoint(const pcl::PointXYZRGBA &point) : m_genericPoint(NULL), m_type(ito::pclXYZRGBA) 
00125     { 
00126         m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZRGBA(point));
00127     }
00128 
00130     PCLPoint(const pcl::PointNormal &point) : m_genericPoint(NULL), m_type(ito::pclXYZNormal) 
00131     { 
00132         m_genericPoint = reinterpret_cast<void*>(new pcl::PointNormal(point));
00133     }
00134 
00136     PCLPoint(const pcl::PointXYZINormal &point) : m_genericPoint(NULL), m_type(ito::pclXYZINormal) 
00137     { 
00138         m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZINormal(point));
00139     }
00140 
00142     PCLPoint(const pcl::PointXYZRGBNormal &point) : m_genericPoint(NULL), m_type(ito::pclXYZRGBNormal) 
00143     { 
00144         m_genericPoint = reinterpret_cast<void*>(new pcl::PointXYZRGBNormal(point));
00145     }
00146 
00148     PCLPoint ( const PCLPoint & p ) : m_genericPoint(NULL), m_type(ito::pclInvalid)
00149     {
00150         copyFromVoidPtrAndType( p.m_genericPoint, p.m_type);
00151     }
00152 
00154     PCLPoint & operator= ( const PCLPoint & p )
00155     {
00156         copyFromVoidPtrAndType( p.m_genericPoint, p.m_type);
00157         return *this;
00158     }
00159 
00161     ~PCLPoint() 
00162     {
00163         if(m_genericPoint)
00164         {
00165             switch(m_type)
00166             {
00167                 case ito::pclXYZ: delete reinterpret_cast<pcl::PointXYZ*>(m_genericPoint); break;
00168                 case ito::pclXYZI: delete reinterpret_cast<pcl::PointXYZI*>(m_genericPoint); break;
00169                 case ito::pclXYZRGBA: delete reinterpret_cast<pcl::PointXYZRGBA*>(m_genericPoint); break;
00170                 case ito::pclXYZNormal: delete reinterpret_cast<pcl::PointNormal*>(m_genericPoint); break;
00171                 case ito::pclXYZINormal: delete reinterpret_cast<pcl::PointXYZINormal*>(m_genericPoint); break;
00172                 case ito::pclXYZRGBNormal: delete reinterpret_cast<pcl::PointXYZRGBNormal*>(m_genericPoint); break;
00173                 default: break;
00174             }
00175             m_genericPoint = NULL;
00176         }
00177     }
00178 
00180     inline ito::tPCLPointType getType() const { return m_type; }
00181 
00183 
00186     const pcl::PointXYZ & getPointXYZ() const;
00187 
00189 
00192     const pcl::PointXYZI & getPointXYZI() const;
00193 
00195 
00198     const pcl::PointXYZRGBA & getPointXYZRGBA() const;
00199 
00201 
00204     const pcl::PointNormal & getPointXYZNormal() const;
00205 
00207 
00210     const pcl::PointXYZINormal & getPointXYZINormal() const;
00211 
00213 
00216     const pcl::PointXYZRGBNormal & getPointXYZRGBNormal() const;
00217 
00218     pcl::PointXYZ & getPointXYZ();
00219     pcl::PointXYZI & getPointXYZI();
00220     pcl::PointXYZRGBA & getPointXYZRGBA();
00221     pcl::PointNormal & getPointXYZNormal();
00222     pcl::PointXYZINormal & getPointXYZINormal();
00223     pcl::PointXYZRGBNormal & getPointXYZRGBNormal();
00224 
00225     bool getXYZ(float &x, float &y, float &z);
00226     bool setXYZ(float x, float y, float z, int mask = 0xFFFF);
00227     bool getNormal(float &nx, float &ny, float &nz);
00228     bool setNormal(float nx, float ny, float nz, int mask = 0xFFFF);
00229     bool getRGBA(uint8_t &r, uint8_t &g, uint8_t &b, uint8_t &a);
00230     bool setRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a, int mask = 0xFFFF);
00231     bool getIntensity(float &intensity);
00232     bool setIntensity(float intensity);
00233     bool getCurvature(float &curvature);
00234     bool setCurvature(float curvature);
00235 
00236     
00237 private:
00238     template<typename _Tp> friend _Tp* getPointPtrInternal(ito::PCLPoint &point);
00239     template<typename _Tp> friend const _Tp* getPointPtrInternal(const ito::PCLPoint &point);
00240 
00241     void *m_genericPoint;      
00242     ito::tPCLPointType m_type; 
00243 };
00244 
00245 // Forward declaration of friend methods
00246 #ifdef __APPLE__
00247     class PCLPointCloud;
00248     template<typename _Tp> pcl::PointCloud<_Tp>* getPointCloudPtrInternal(ito::PCLPointCloud &pc);
00249     template<typename _Tp> const pcl::PointCloud<_Tp>* getPointCloudPtrInternal(const ito::PCLPointCloud &pc);
00250     
00251 #if PCL_VERSION_COMPARE(>=,1,7,0)
00252     template<typename _Tp> pcl::PCLHeader GetHeaderFunc(ito::PCLPointCloud &pc);
00253     template<typename _Tp> pcl::PCLHeader GetHeaderFunc(const ito::PCLPointCloud *pc);
00254 #else
00255     template<typename _Tp> std_msgs::Header GetHeaderFunc(ito::PCLPointCloud &pc);
00256     template<typename _Tp> std_msgs::Header GetHeaderFunc(const ito::PCLPointCloud *pc);
00257 #endif
00258     template<typename _Tp> uint32_t GetWidthFunc(const ito::PCLPointCloud *pc);
00259     template<typename _Tp> uint32_t GetHeightFunc(const ito::PCLPointCloud *pc);
00260     template<typename _Tp> void SetHeightFunc(ito::PCLPointCloud *pc, uint32_t height);
00261     template<typename _Tp> bool GetDenseFunc(const ito::PCLPointCloud *pc);
00262     template<typename _Tp> void SetDenseFunc(ito::PCLPointCloud *pc, bool dense);
00263     template<typename _Tp> void SetWidthFunc(ito::PCLPointCloud *pc, uint32_t width);
00264     template<typename _Tp> void PcAddFunc(ito::PCLPointCloud *pc1, const ito::PCLPointCloud *pc2, ito::PCLPointCloud *pcRes);
00265     template<typename _Tp> void SetItemFunc(ito::PCLPointCloud *pc, size_t n, ito::PCLPoint &point);
00266     template<typename _Tp> void PushBackFunc(ito::PCLPointCloud * pc, const ito::PCLPoint & point);
00267     template<typename _Tp> bool EmptyFunc(const ito::PCLPointCloud *pc);
00268     template<typename _Tp> void ReserveResizeFunc(ito::PCLPointCloud *pc, size_t n, bool reserveNotResize);
00269     template<typename _Tp> void ClearFunc(ito::PCLPointCloud *pc);
00270     template<typename _Tp> void EraseFunc(ito::PCLPointCloud *pc, uint32_t startIndex, uint32_t endIndex);
00271     template<typename _Tp> void InsertFunc(ito::PCLPointCloud *pc, uint32_t index, const ito::PCLPoint& point);
00272     template<typename _Tp> std::string GetFieldsListFunc(const ito::PCLPointCloud *pc);
00273 #endif // __APPLE__
00274 
00275 //----------------------------------------------------------------------------------------------------------------------------------
00292 class POINTCLOUD_EXPORT PCLPointCloud
00293 {
00294 public:
00296     PCLPointCloud() : m_type(ito::pclInvalid) {};
00297 
00299     PCLPointCloud(ito::tPCLPointType type) : m_type(type) 
00300     {
00301         createEmptyPointCloud(type);
00302     };
00304     PCLPointCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr pclPtr) : m_pcXYZ(pclPtr), m_type(ito::pclXYZ) {};
00305 
00307     PCLPointCloud(pcl::PointCloud<pcl::PointXYZI>::Ptr pclPtr) : m_pcXYZI(pclPtr), m_type(ito::pclXYZI) {};
00308 
00310     PCLPointCloud(pcl::PointCloud<pcl::PointXYZRGBA>::Ptr pclPtr) : m_pcXYZRGBA(pclPtr), m_type(ito::pclXYZRGBA) {};
00311 
00313     PCLPointCloud(pcl::PointCloud<pcl::PointNormal>::Ptr pclPtr) : m_pcXYZNormal(pclPtr), m_type(ito::pclXYZNormal) {};
00314 
00316     PCLPointCloud(pcl::PointCloud<pcl::PointXYZINormal>::Ptr pclPtr) : m_pcXYZINormal(pclPtr), m_type(ito::pclXYZINormal) {};
00317 
00319     PCLPointCloud(pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr pclPtr) : m_pcXYZRGBNormal(pclPtr), m_type(ito::pclXYZRGBNormal) {};
00320 
00322 
00325     PCLPointCloud(uint32_t width_, uint32_t height_, ito::tPCLPointType type_, const PCLPoint &value_ = PCLPoint());
00326     
00328     PCLPointCloud(PCLPointCloud &pc);
00329 
00331     PCLPointCloud(const PCLPointCloud &pc);
00332 
00334 
00337     PCLPointCloud(const PCLPointCloud &pc, const std::vector< int > &indices);
00338 
00340     ~PCLPointCloud(){};
00341 
00343     inline ito::tPCLPointType getType() const 
00344     { 
00345         return m_type; 
00346     };
00347 
00349     inline int hasRGB() const { return m_type & (ito::pclXYZRGBNormal | ito::pclXYZRGBA); }
00350 
00352     inline int hasNormal() const { return m_type & (ito::pclXYZINormal | ito::pclXYZNormal | ito::pclXYZRGBNormal); }
00353 
00355     inline int hasIntensity() const { return m_type & ( ito::pclXYZI | ito::pclXYZINormal ); }
00356 
00358     inline int hasCurvature() const { return m_type & (ito::pclXYZINormal | ito::pclXYZNormal | ito::pclXYZRGBNormal); }
00359 
00361 
00364     inline pcl::PointCloud<pcl::PointXYZ>::Ptr toPointXYZ() const                   
00365     { 
00366         if(m_type == ito::pclXYZ) return m_pcXYZ;
00367         throw pcl::PCLException("point cloud has not the desired type PointXYZ",__FILE__, "toPointXYZ", __LINE__);
00368     };
00369 
00371 
00374     inline pcl::PointCloud<pcl::PointXYZI>::Ptr toPointXYZI() const                 
00375     { 
00376         if(m_type == ito::pclXYZI) return m_pcXYZI;
00377         throw pcl::PCLException("point cloud has not the desired type PointXYZI",__FILE__, "toPointXYZI", __LINE__);
00378     };
00379 
00381 
00384     inline pcl::PointCloud<pcl::PointXYZRGBA>::Ptr toPointXYZRGBA() const           
00385     { 
00386         if(m_type == ito::pclXYZRGBA) return m_pcXYZRGBA;
00387         throw pcl::PCLException("point cloud has not the desired type PointXYZRGBA",__FILE__, "toPointXYZRGBA", __LINE__);
00388     };
00389 
00391 
00394     inline pcl::PointCloud<pcl::PointNormal>::Ptr toPointXYZNormal() const          
00395     { 
00396         if(m_type == ito::pclXYZNormal) return m_pcXYZNormal;
00397         throw pcl::PCLException("point cloud has not the desired type PointXYZNormal",__FILE__, "toPointXYZNormal", __LINE__);
00398     };
00399 
00401 
00404     inline pcl::PointCloud<pcl::PointXYZINormal>::Ptr toPointXYZINormal() const     
00405     { 
00406         if(m_type == ito::pclXYZINormal) return m_pcXYZINormal;
00407         throw pcl::PCLException("point cloud has not the desired type PointXYZINormal",__FILE__, "toPointXYZINormal", __LINE__);
00408     };
00409 
00411 
00414     inline pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr toPointXYZRGBNormal() const 
00415     { 
00416         if(m_type == ito::pclXYZRGBNormal) return m_pcXYZRGBNormal;
00417         throw pcl::PCLException("point cloud has not the desired type PointXYZRGBNormal",__FILE__, "toPointXYZRGBNormal", __LINE__);
00418     };
00419 
00421 
00424     inline pcl::PointCloud<pcl::PointXYZ>::ConstPtr toPointXYZConst() const                   
00425     { 
00426         if(m_type == ito::pclXYZ) return m_pcXYZ;
00427         throw pcl::PCLException("point cloud has not the desired type PointXYZ",__FILE__, "toPointXYZ", __LINE__);
00428     };
00429 
00431 
00434     inline pcl::PointCloud<pcl::PointXYZI>::ConstPtr toPointXYZIConst() const                 
00435     { 
00436         if(m_type == ito::pclXYZI) return m_pcXYZI;
00437         throw pcl::PCLException("point cloud has not the desired type PointXYZI",__FILE__, "toPointXYZI", __LINE__);
00438     };
00439 
00441 
00444     inline pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr toPointXYZRGBAConst() const           
00445     { 
00446         if(m_type == ito::pclXYZRGBA) return m_pcXYZRGBA;
00447         throw pcl::PCLException("point cloud has not the desired type PointXYZRGBA",__FILE__, "toPointXYZRGBA", __LINE__);
00448     };
00449 
00451 
00454     inline pcl::PointCloud<pcl::PointNormal>::ConstPtr toPointXYZNormalConst() const          
00455     { 
00456         if(m_type == ito::pclXYZNormal) return m_pcXYZNormal;
00457         throw pcl::PCLException("point cloud has not the desired type PointXYZNormal",__FILE__, "toPointXYZNormal", __LINE__);
00458     };
00459 
00461 
00464     inline pcl::PointCloud<pcl::PointXYZINormal>::ConstPtr toPointXYZINormalConst() const     
00465     { 
00466         if(m_type == ito::pclXYZINormal) return m_pcXYZINormal;
00467         throw pcl::PCLException("point cloud has not the desired type PointXYZINormal",__FILE__, "toPointXYZINormal", __LINE__);
00468     };
00469 
00471 
00474     inline pcl::PointCloud<pcl::PointXYZRGBNormal>::ConstPtr toPointXYZRGBNormalConst() const 
00475     { 
00476         if(m_type == ito::pclXYZRGBNormal) return m_pcXYZRGBNormal;
00477         throw pcl::PCLException("point cloud has not the desired type PointXYZRGBNormal",__FILE__, "toPointXYZRGBNormal", __LINE__);
00478     };
00479 
00481 
00484     PCLPointCloud & operator+= (const PCLPointCloud &rhs);
00485 
00487 
00490     const PCLPointCloud operator+ (const PCLPointCloud &rhs);
00491 
00493     PCLPointCloud & operator= (const PCLPointCloud &copy);
00494 
00496     PCLPointCloud copy() const; 
00497 
00499 
00502     const PCLPoint operator[] (size_t n) const;
00503 
00505 
00508     const PCLPoint at (size_t n) const;
00509     
00511 
00514     void set_item(size_t n, PCLPoint &point);
00515 
00517     bool isOrganized() const;
00518 
00520     uint32_t width() const;
00521 
00523     uint32_t height() const;
00524 
00526     size_t size() const;
00527 
00529     bool is_dense() const;
00530 
00532     void set_width(uint32_t width);
00533 
00535     void set_height(uint32_t height);
00536 
00538     void set_dense(bool dense);
00539 
00541     void scaleXYZ(float32 scaleX, float32 scaleY, float32 scaleZ);
00542 
00544 #if PCL_VERSION_COMPARE(>=,1,7,0)
00545     pcl::PCLHeader header() const;
00546 #else
00547     std_msgs::Header header() const;
00548 #endif
00549 
00551     std::string getFieldsList() const;
00552 
00554 #if PCL_VERSION_COMPARE(>=,1,7,0)
00555     std::vector<pcl::PCLPointField> getFieldsInfo() const;
00556 #else
00557         std::vector<sensor_msgs::PointField> getFieldsInfo() const;
00558 #endif
00559 
00561     unsigned char* genericPointAccess(size_t &strideBytes) const;
00562 
00564     void push_back(const ito::PCLPoint &pt);
00565 
00567     bool empty() const;
00568 
00570     void reserve(size_t n);
00571 
00573     void resize(size_t n);
00574 
00576     void clear();
00577 
00579     void erase(uint32_t startIndex, uint32_t endIndex);
00580 
00582     void insert(uint32_t index, const ito::PCLPoint& point);
00583 
00584 protected:
00586     void setInvalid();
00587 
00589     void createEmptyPointCloud(ito::tPCLPointType type);
00590     
00591 private:
00592 
00593     inline int getFuncListIndex() const
00594     {
00595         switch(m_type)
00596         {
00597         case ito::pclXYZ: return 0;
00598         case ito::pclXYZI: return 1;
00599         case ito::pclXYZRGBA: return 2;
00600         case ito::pclXYZNormal: return 3;
00601         case ito::pclXYZINormal: return 4;
00602         case ito::pclXYZRGBNormal: return 5;
00603         default: return -1;
00604         }
00605     };
00606 
00607     inline int getFuncListIndex(const ito::tPCLPointType &type) const
00608     {
00609         switch(type)
00610         {
00611         case ito::pclXYZ: return 0;
00612         case ito::pclXYZI: return 1;
00613         case ito::pclXYZRGBA: return 2;
00614         case ito::pclXYZNormal: return 3;
00615         case ito::pclXYZINormal: return 4;
00616         case ito::pclXYZRGBNormal: return 5;
00617         default: return -1;
00618         }
00619     };
00620 
00621     template<typename _Tp> friend pcl::PointCloud<_Tp>* getPointCloudPtrInternal(ito::PCLPointCloud &pc);
00622     template<typename _Tp> friend const pcl::PointCloud<_Tp>* getPointCloudPtrInternal(const ito::PCLPointCloud &pc);
00623 
00624 #if PCL_VERSION_COMPARE(>=,1,7,0)
00625     template<typename _Tp> friend pcl::PCLHeader GetHeaderFunc(ito::PCLPointCloud &pc);
00626     template<typename _Tp> friend pcl::PCLHeader GetHeaderFunc(const ito::PCLPointCloud *pc);
00627 #else
00628     template<typename _Tp> friend std_msgs::Header GetHeaderFunc(ito::PCLPointCloud &pc);
00629     template<typename _Tp> friend std_msgs::Header GetHeaderFunc(const ito::PCLPointCloud *pc);
00630 #endif
00631     template<typename _Tp> friend uint32_t GetWidthFunc(const ito::PCLPointCloud *pc);
00632     template<typename _Tp> friend uint32_t GetHeightFunc(const ito::PCLPointCloud *pc);
00633     template<typename _Tp> friend void SetHeightFunc(ito::PCLPointCloud *pc, uint32_t height);
00634     template<typename _Tp> friend bool GetDenseFunc(const ito::PCLPointCloud *pc);
00635     template<typename _Tp> friend void SetDenseFunc(ito::PCLPointCloud *pc, bool dense);
00636     template<typename _Tp> friend void SetWidthFunc(ito::PCLPointCloud *pc, uint32_t width);
00637     template<typename _Tp> friend void PcAddFunc(ito::PCLPointCloud *pc1, const ito::PCLPointCloud *pc2, ito::PCLPointCloud *pcRes);
00638     template<typename _Tp> friend void SetItemFunc(ito::PCLPointCloud *pc, size_t n, ito::PCLPoint &point);
00639     template<typename _Tp> friend void PushBackFunc(ito::PCLPointCloud * pc, const ito::PCLPoint & point);
00640     template<typename _Tp> friend bool EmptyFunc(const ito::PCLPointCloud *pc);
00641     template<typename _Tp> friend void ReserveResizeFunc(ito::PCLPointCloud *pc, size_t n, bool reserveNotResize);
00642     template<typename _Tp> friend void ClearFunc(ito::PCLPointCloud *pc);
00643     template<typename _Tp> friend void EraseFunc(ito::PCLPointCloud *pc, uint32_t startIndex, uint32_t endIndex);
00644     template<typename _Tp> friend void InsertFunc(ito::PCLPointCloud *pc, uint32_t index, const ito::PCLPoint& point);
00645     template<typename _Tp> friend void ScaleXYZFunc(ito::PCLPointCloud *pc, ito::float32 scaleX, ito::float32 scaleY, ito::float32 scaleZ);
00646     template<typename _Tp> friend std::string GetFieldsListFunc(const ito::PCLPointCloud *pc);
00647 
00648 
00649     pcl::PointCloud<pcl::PointXYZ>::Ptr m_pcXYZ;                   
00650     pcl::PointCloud<pcl::PointXYZI>::Ptr m_pcXYZI;                 
00651     pcl::PointCloud<pcl::PointXYZRGBA>::Ptr m_pcXYZRGBA;           
00652     pcl::PointCloud<pcl::PointNormal>::Ptr m_pcXYZNormal;          
00653     pcl::PointCloud<pcl::PointXYZINormal>::Ptr m_pcXYZINormal;     
00654     pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr m_pcXYZRGBNormal; 
00656     ito::tPCLPointType m_type;                                     
00657 };
00658 
00659 //----------------------------------------------------------------------------------------------------------------------------------
00664 class POINTCLOUD_EXPORT PCLPolygonMesh
00665 {
00666 public:
00667     PCLPolygonMesh();
00668     PCLPolygonMesh(pcl::PolygonMesh::Ptr polygonMesh);
00669     PCLPolygonMesh(PCLPolygonMesh &mesh);
00670     PCLPolygonMesh(PCLPolygonMesh &mesh, const std::vector<uint32_t> &polygonIndices);
00671     PCLPolygonMesh(const PCLPointCloud &cloud, const std::vector<pcl::Vertices> &polygons);
00672     PCLPolygonMesh(const PCLPolygonMesh &mesh);
00673     ~PCLPolygonMesh();
00674 
00675     inline pcl::PolygonMesh::Ptr polygonMesh() { return m_polygonMesh; }
00676     inline pcl::PolygonMesh::ConstPtr polygonMesh() const { return m_polygonMesh; }
00677 
00678     inline void setPolygonMesh(pcl::PolygonMesh::Ptr &mesh) { m_polygonMesh = mesh; }
00679     PCLPolygonMesh & operator= (const PCLPolygonMesh &copy);
00680 
00681     inline bool valid() const { return m_valid; }
00682 
00683     size_t height() const;
00684     size_t width() const;
00685     std::string getFieldsList() const;
00686 
00687     std::ostream& streamOut(std::ostream& out);
00688     
00689 protected:
00690 
00691 private:
00692     bool m_valid;                        
00693     pcl::PolygonMesh::Ptr m_polygonMesh; 
00694 };
00695 
00696 } //end namespace ito
00697 
00698 
00699 
00700 
00701 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends