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.GPL  **
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 HAVE_OPENGL
00034 #warning "this header must not be included without HAVE_PCL defined"
00035 #else
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 DataSegment<T,N> createSegment();
00082       
00084       void deletePCL();
00085   
00086       public:
00087       
00089 
00091       PCLPointCloudObject(const std::string &filename="");
00092       
00094 
00096       PCLPointCloudObject(int width, int height = -1, const PCLPointType &init=PCLPointType());
00097   
00099       PCLPointCloudObject(const PCLPointCloudObject<PCLPointType> &other);
00100   
00102 
00105       PCLPointCloudObject<PCLPointType> &operator=(const PCLPointCloudObject<PCLPointType> &other);
00106     
00108       PCLPointCloudObject(const pcl::PointCloud<PCLPointType> &cloud);
00109   
00111       PCLPointCloudObject(pcl::PointCloud<PCLPointType> &cloud, bool deepCopy=true);
00112   
00114       ~PCLPointCloudObject();
00115       
00117       pcl::PointCloud<PCLPointType> &pcl() throw (utils::ICLException);
00118   
00120       const pcl::PointCloud<PCLPointType> &pcl() const throw (utils::ICLException);
00121       
00123       void setPCL(const pcl::PointCloud<PCLPointType> &pcl);
00124   
00126       void setPCL(pcl::PointCloud<PCLPointType> &pcl, bool deepCopy = true);
00127   
00129       virtual bool supports(FeatureType t) const;
00130   
00132       virtual bool isOrganized() const;
00133   
00135       virtual utils::Size getSize() const throw (utils::ICLException);
00136       
00138       virtual int getDim() const;
00139   
00141 
00142       virtual void setSize(const utils::Size &size);
00143   
00144       bool isNull() const;
00145   
00146       // well known fields
00147       virtual DataSegment<float,1> selectIntensity();
00148       virtual DataSegment<icl32s,1> selectLabel();
00149       virtual DataSegment<icl8u,3> selectBGR();
00150       virtual DataSegment<icl8u,4> selectBGRA();
00151       virtual DataSegment<icl32s,1> selectBGRA32s();
00152   
00153       virtual DataSegment<float,3> selectXYZ();
00154       virtual DataSegment<float,4> selectXYZH();
00155       virtual DataSegment<float,4> selectNormal();
00156       virtual DataSegment<float,4> selectRGBA32f();
00157   
00159 
00162       virtual DataSegmentBase select(const std::string &featureName);
00163   
00165       virtual PCLPointCloudObject<PCLPointType> *copy() const;
00166   
00167     };
00168   
00169   } // namespace geom
00170 }
00171 
00172 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines