Point Cloud Library (PCL)  1.9.1-dev
PCLPointCloud2.h
1 #pragma once
2 
3 #ifdef USE_ROS
4  #error USE_ROS setup requires PCL to compile against ROS message headers, which is now deprecated
5 #endif
6 
7 #include <string>
8 #include <vector>
9 #include <ostream>
10 #include <boost/predef/other/endian.h>
11 
12 // Include the correct Header path here
13 #include <pcl/PCLHeader.h>
14 #include <pcl/PCLPointField.h>
15 
16 namespace pcl
17 {
18 
20  {
21  PCLPointCloud2 () : height (0), width (0),
22  is_bigendian (false), point_step (0), row_step (0),
23  is_dense (false)
24  {
25 #if BOOST_ENDIAN_BIG_BYTE
26  is_bigendian = true;
27 #elif BOOST_ENDIAN_LITTLE_BYTE
28  is_bigendian = false;
29 #else
30 #error "unable to determine system endianness"
31 #endif
32  }
33 
35 
36  pcl::uint32_t height;
37  pcl::uint32_t width;
38 
39  std::vector< ::pcl::PCLPointField> fields;
40 
41  pcl::uint8_t is_bigendian;
42  pcl::uint32_t point_step;
43  pcl::uint32_t row_step;
44 
45  std::vector<pcl::uint8_t> data;
46 
47  pcl::uint8_t is_dense;
48 
49  public:
50  using Ptr = boost::shared_ptr< ::pcl::PCLPointCloud2>;
51  using ConstPtr = boost::shared_ptr<const ::pcl::PCLPointCloud2>;
52  }; // struct PCLPointCloud2
53 
54  using PCLPointCloud2Ptr = boost::shared_ptr< ::pcl::PCLPointCloud2>;
55  using PCLPointCloud2ConstPtr = boost::shared_ptr<const ::pcl::PCLPointCloud2>;
56 
57  inline std::ostream& operator<<(std::ostream& s, const ::pcl::PCLPointCloud2 &v)
58  {
59  s << "header: " << std::endl;
60  s << v.header;
61  s << "height: ";
62  s << " " << v.height << std::endl;
63  s << "width: ";
64  s << " " << v.width << std::endl;
65  s << "fields[]" << std::endl;
66  for (size_t i = 0; i < v.fields.size (); ++i)
67  {
68  s << " fields[" << i << "]: ";
69  s << std::endl;
70  s << " " << v.fields[i] << std::endl;
71  }
72  s << "is_bigendian: ";
73  s << " " << v.is_bigendian << std::endl;
74  s << "point_step: ";
75  s << " " << v.point_step << std::endl;
76  s << "row_step: ";
77  s << " " << v.row_step << std::endl;
78  s << "data[]" << std::endl;
79  for (size_t i = 0; i < v.data.size (); ++i)
80  {
81  s << " data[" << i << "]: ";
82  s << " " << v.data[i] << std::endl;
83  }
84  s << "is_dense: ";
85  s << " " << v.is_dense << std::endl;
86 
87  return (s);
88  }
89 
90 } // namespace pcl
pcl::uint8_t is_bigendian
pcl::uint32_t point_step
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
::pcl::PCLHeader header
pcl::uint8_t is_dense
std::ostream & operator<<(std::ostream &os, const BivariatePolynomialT< real > &p)
pcl::uint32_t row_step
pcl::uint32_t width
boost::shared_ptr< ::pcl::PCLPointCloud2 > Ptr
boost::shared_ptr< ::pcl::PCLPointCloud2 > PCLPointCloud2Ptr
boost::shared_ptr< const ::pcl::PCLPointCloud2 > PCLPointCloud2ConstPtr
std::vector< ::pcl::PCLPointField > fields
pcl::uint32_t height
boost::shared_ptr< const ::pcl::PCLPointCloud2 > ConstPtr
std::vector< pcl::uint8_t > data