Image Component Library (ICL)
PCLPointCloudObject.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLGeom/src/ICLGeom/PCLPointCloudObject.h **
10 ** Module : ICLGeom **
11 ** Authors: Christof Elbrechter, Patrick Nobou **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #ifndef ICL_HAVE_PCL
34 #warning "this header must not be included without ICL_HAVE_PCL defined"
35 #endif
36 
38 #include <ICLGeom/PCLIncludes.h>
39 
41 namespace pcl{
42  template<class PCLPointType> class PointCloud;
43 }
46 namespace icl{
47  namespace geom{
48 
50 
62  template<class PCLPointType>
64  pcl::PointCloud<PCLPointType> *m_pcl;
65  bool m_ownPCL;
66 
68  typedef PCLPointType Entry;
69 
71 
72  int offset(FeatureType) const;
73 
75  inline icl8u* data();
76 
78  inline const icl8u* data() const;
79 
81  template<class T, int N, FeatureType t>
83 
85  void deletePCL();
86 
87  public:
88 
89 #if 0
90  // this is right now deactivated due to an extra dependency to libpcl_io
91  // which always depends on openni
92 
94 
96  PCLPointCloudObject(const std::string &filename="");
97 #endif
98 
101  PCLPointCloudObject(int width, int height = -1, const PCLPointType &init=PCLPointType());
102 
105 
107 
111 
113  PCLPointCloudObject(const pcl::PointCloud<PCLPointType> &cloud);
114 
116  PCLPointCloudObject(pcl::PointCloud<PCLPointType> &cloud, bool deepCopy=true);
117 
120 
122  pcl::PointCloud<PCLPointType> &pcl() ;
123 
125  const pcl::PointCloud<PCLPointType> &pcl() const ;
126 
128  void setPCL(const pcl::PointCloud<PCLPointType> &pcl);
129 
131  void setPCL(pcl::PointCloud<PCLPointType> &pcl, bool deepCopy = true);
132 
134  virtual bool supports(FeatureType t) const;
135 
137  virtual bool isOrganized() const;
138 
140  virtual utils::Size getSize() const ;
141 
143  virtual int getDim() const;
144 
146 
147  virtual void setSize(const utils::Size &size);
148 
149  bool isNull() const;
150 
151  // well known fields
157 
162 
164 
167  virtual core::DataSegmentBase select(const std::string &featureName);
168 
170  virtual PCLPointCloudObject<PCLPointType> *copy() const;
171 
172  };
173 
174  } // namespace geom
175 }
void deletePCL()
savely delets the pcl_image
virtual int getDim() const
return the linearily ordered number of point in the point cloud
virtual core::DataSegment< float, 4 > selectRGBA32f()
well known feature RGBA (4 float values, ordred RGBA)
pcl::PointCloud< PCLPointType > * m_pcl
internal pcl::PointCloud data pointer
Definition: PCLPointCloudObject.h:64
undocument this line if you encounter any issues!
Definition: Any.h:37
Ipp8u icl8u
8Bit unsigned integer type for the ICL
Definition: BasicTypes.h:64
Base class for point cloud data types.
Definition: PointCloudObjectBase.h:98
virtual core::DataSegment< icl32s, 1 > selectLabel()
well known feature Intensity (single 32bit int values)
virtual core::DataSegment< icl32s, 1 > selectBGRA32s()
well known feature Intensity (single int value encoding byte-wise BGRA)
icl8u * data()
returns the data orignin pointer
bool m_ownPCL
ownership flag
Definition: PCLPointCloudObject.h:65
virtual core::DataSegment< float, 4 > selectXYZH()
common way to store XYZ-data (4th float define homogeneous part)
virtual core::DataSegment< icl8u, 4 > selectBGRA()
well known feature Intensity (four byte vectors ordered BGRA)
PCLPointCloudObject(int width, int height=-1, const PCLPointType &init=PCLPointType())
creates a PCLPointCloudObject with given width height and intial value
virtual utils::Size getSize() const
returns the 2D size of the pointcloud (throws exception if not ordered)
pcl::PointCloud< PCLPointType > & pcl()
grants access to the underlying pcl-point-cloud
Abstract data segment class.
Definition: DataSegmentBase.h:99
PCLPointType Entry
internally used typedef
Definition: PCLPointCloudObject.h:68
virtual core::DataSegmentBase select(const std::string &featureName)
selects a dynamic feature
PointCloudObject implementation for the PCLPointCloud types.
Definition: PCLPointCloudObject.h:63
virtual void setSize(const utils::Size &size)
adapts the point cloud size
void setPCL(const pcl::PointCloud< PCLPointType > &pcl)
sets wrapped PCL point cloud (const, always deeply copied)
FeatureType
List of well known features.
Definition: PointCloudObjectBase.h:150
Size class of the ICL.
Definition: Size.h:61
virtual core::DataSegment< icl8u, 3 > selectBGR()
well known feature Intensity (three byte vectors ordered BGR)
virtual bool supports(FeatureType t) const
generic version, that trys to get an offset (can be optimized with specialization)
virtual core::DataSegment< float, 3 > selectXYZ()
well know features XYZ (three floats, this feature must usually be available)
virtual void deepCopy(PointCloudObjectBase &dst) const
deeply copies all well-known features that are shared by this and dst
virtual core::DataSegment< float, 1 > selectIntensity()
well known feature Intensity (single float values)
virtual PCLPointCloudObject< PCLPointType > * copy() const
deep copy interface
int offset(FeatureType) const
this is actually specialized for the different types
PCLPointCloudObject< PCLPointType > & operator=(const PCLPointCloudObject< PCLPointType > &other)
deeply copying assignment operator
core::DataSegment< T, N > createSegment()
creates a data segment for a given feature type
virtual core::DataSegment< float, 4 > selectNormal()
well known feature Normal (4 float values)
The DataSegment class defines a strided data segment (or 1D or 2D ordred array of vectors)
Definition: DataSegment.h:147
virtual bool isOrganized() const
returns whether pointcloud is 2D organized