PCLPointCloud2.h
Go to the documentation of this file.
00001 #ifndef PCL_SENSOR_MSGS_MESSAGE_POINTCLOUD2_H
00002 #define PCL_SENSOR_MSGS_MESSAGE_POINTCLOUD2_H
00003 
00004 #ifdef USE_ROS
00005    #error USE_ROS setup requires PCL to compile against ROS message headers, which is now deprecated
00006 #endif 
00007 
00008 #include <string>
00009 #include <vector>
00010 #include <ostream>
00011 #include <boost/detail/endian.hpp>
00012 
00013 // Include the correct Header path here
00014 #include <pcl/PCLHeader.h>
00015 #include <pcl/PCLPointField.h>
00016 
00017 namespace pcl
00018 {
00019 
00020   struct PCLPointCloud2
00021   {
00022     PCLPointCloud2 () : header (), height (0), width (0), fields (),
00023                      is_bigendian (false), point_step (0), row_step (0),
00024                      data (), is_dense (false)
00025     {
00026 #if defined(BOOST_BIG_ENDIAN)
00027       is_bigendian = true;
00028 #elif defined(BOOST_LITTLE_ENDIAN)
00029       is_bigendian = false;
00030 #else
00031 #error "unable to determine system endianness"
00032 #endif
00033     }
00034 
00035     ::pcl::PCLHeader header;
00036 
00037     pcl::uint32_t height;
00038     pcl::uint32_t width;
00039 
00040     std::vector< ::pcl::PCLPointField>  fields;
00041 
00042     pcl::uint8_t is_bigendian;
00043     pcl::uint32_t point_step;
00044     pcl::uint32_t row_step;
00045 
00046     std::vector<pcl::uint8_t> data;
00047 
00048     pcl::uint8_t is_dense;
00049 
00050   public:
00051     typedef boost::shared_ptr< ::pcl::PCLPointCloud2> Ptr;
00052     typedef boost::shared_ptr< ::pcl::PCLPointCloud2  const> ConstPtr;
00053   }; // struct PCLPointCloud2
00054 
00055   typedef boost::shared_ptr< ::pcl::PCLPointCloud2> PCLPointCloud2Ptr;
00056   typedef boost::shared_ptr< ::pcl::PCLPointCloud2 const> PCLPointCloud2ConstPtr;
00057 
00058   inline std::ostream& operator<<(std::ostream& s, const  ::pcl::PCLPointCloud2 &v)
00059   {
00060     s << "header: " << std::endl;
00061     s << v.header;
00062     s << "height: ";
00063     s << "  " << v.height << std::endl;
00064     s << "width: ";
00065     s << "  " << v.width << std::endl;
00066     s << "fields[]" << std::endl;
00067     for (size_t i = 0; i < v.fields.size (); ++i)
00068     {
00069       s << "  fields[" << i << "]: ";
00070       s << std::endl;
00071       s << "    " << v.fields[i] << std::endl;
00072     }
00073     s << "is_bigendian: ";
00074     s << "  " << v.is_bigendian << std::endl;
00075     s << "point_step: ";
00076     s << "  " << v.point_step << std::endl;
00077     s << "row_step: ";
00078     s << "  " << v.row_step << std::endl;
00079     s << "data[]" << std::endl;
00080     for (size_t i = 0; i < v.data.size (); ++i)
00081     {
00082       s << "  data[" << i << "]: ";
00083       s << "  " << v.data[i] << std::endl;
00084     }
00085     s << "is_dense: ";
00086     s << "  " << v.is_dense << std::endl;
00087     
00088     return (s);
00089   }
00090 
00091 } // namespace pcl
00092 
00093 #endif // PCL_SENSOR_MSGS_MESSAGE_POINTCLOUD2_H
00094 


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:28:14