Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PCLPointCloudObject.h
Go to the documentation of this file.
00001 /********************************************************************
00002 **                Image Component Library (ICL)                    **
00003 **                                                                 **
00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld          **
00005 **                         Neuroinformatics Group                  **
00006 ** Website: www.iclcv.org and                                      **
00007 **          http://opensource.cit-ec.de/projects/icl               **
00008 **                                                                 **
00009 ** File   : ICLGeom/src/ICLGeom/PCLPointCloudObject.h              **
00010 ** Module : ICLGeom                                                **
00011 ** Authors: Christof Elbrechter, Patrick Nobou                     **
00012 **                                                                 **
00013 **                                                                 **
00014 ** GNU LESSER GENERAL PUBLIC LICENSE                               **
00015 ** This file may be used under the terms of the GNU Lesser General **
00016 ** Public License version 3.0 as published by the                  **
00017 **                                                                 **
00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
00019 ** included in the packaging of this file.  Please review the      **
00020 ** following information to ensure the license requirements will   **
00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt                **
00022 **                                                                 **
00023 ** The development of this software was supported by the           **
00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology.    **
00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche       **
00026 ** Forschungsgemeinschaft (DFG) in the context of the German       **
00027 ** Excellence Initiative.                                          **
00028 **                                                                 **
00029 ********************************************************************/
00030 
00031 #pragma once
00032 
00033 #ifndef ICL_HAVE_PCL
00034 #warning "this header must not be included without ICL_HAVE_PCL defined"
00035 #endif
00036 
00037 #include <ICLGeom/PointCloudObjectBase.h>
00038 #include <ICLGeom/PCLIncludes.h>
00039 
00041 namespace pcl{
00042   template<class PCLPointType> class PointCloud;
00043 }
00046 namespace icl{
00047   namespace geom{
00048   
00050 
00061     template<class PCLPointType>
00062     class PCLPointCloudObject : public PointCloudObjectBase{
00063       pcl::PointCloud<PCLPointType> *m_pcl; 
00064       bool m_ownPCL;                        
00065       
00067       typedef PCLPointType Entry;
00068   
00070 
00071       int offset(FeatureType) const;
00072   
00074       inline icl8u* data();
00075   
00077       inline const icl8u* data() const;
00078   
00080       template<class T, int N, FeatureType t>
00081       inline core::DataSegment<T,N> createSegment();
00082       
00084       void deletePCL();
00085   
00086       public:
00087       
00088 #if 0
00089       // this is right now deactivated due to an extra dependency to libpcl_io
00090       // which always depends on openni
00091       
00093 
00095       PCLPointCloudObject(const std::string &filename="");
00096 #endif 
00097 
00098 
00100       PCLPointCloudObject(int width, int height = -1, const PCLPointType &init=PCLPointType());
00101   
00103       PCLPointCloudObject(const PCLPointCloudObject<PCLPointType> &other);
00104   
00106 
00109       PCLPointCloudObject<PCLPointType> &operator=(const PCLPointCloudObject<PCLPointType> &other);
00110     
00112       PCLPointCloudObject(const pcl::PointCloud<PCLPointType> &cloud);
00113   
00115       PCLPointCloudObject(pcl::PointCloud<PCLPointType> &cloud, bool deepCopy=true);
00116   
00118       ~PCLPointCloudObject();
00119       
00121       pcl::PointCloud<PCLPointType> &pcl() throw (utils::ICLException);
00122   
00124       const pcl::PointCloud<PCLPointType> &pcl() const throw (utils::ICLException);
00125       
00127       void setPCL(const pcl::PointCloud<PCLPointType> &pcl);
00128   
00130       void setPCL(pcl::PointCloud<PCLPointType> &pcl, bool deepCopy = true);
00131   
00133       virtual bool supports(FeatureType t) const;
00134   
00136       virtual bool isOrganized() const;
00137   
00139       virtual utils::Size getSize() const throw (utils::ICLException);
00140       
00142       virtual int getDim() const;
00143   
00145 
00146       virtual void setSize(const utils::Size &size);
00147   
00148       bool isNull() const;
00149   
00150       // well known fields
00151       virtual core::DataSegment<float,1> selectIntensity();
00152       virtual core::DataSegment<icl32s,1> selectLabel();
00153       virtual core::DataSegment<icl8u,3> selectBGR();
00154       virtual core::DataSegment<icl8u,4> selectBGRA();
00155       virtual core::DataSegment<icl32s,1> selectBGRA32s();
00156   
00157       virtual core::DataSegment<float,3> selectXYZ();
00158       virtual core::DataSegment<float,4> selectXYZH();
00159       virtual core::DataSegment<float,4> selectNormal();
00160       virtual core::DataSegment<float,4> selectRGBA32f();
00161   
00163 
00166       virtual core::DataSegmentBase select(const std::string &featureName);
00167   
00169       virtual PCLPointCloudObject<PCLPointType> *copy() const;
00170   
00171     };
00172   
00173   } // namespace geom
00174 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines