Point Cloud Library (PCL)  1.10.1-dev
PCLPointField.h
1 #pragma once
2 
3 #include <pcl/memory.h> // for shared_ptr
4 #include <pcl/type_traits.h> // for asEnum_v
5 
6 #include <string> // for string
7 #include <ostream> // for ostream
8 
9 namespace pcl
10 {
12  {
13  std::string name;
14 
15  std::uint32_t offset = 0;
16  std::uint8_t datatype = 0;
17  std::uint32_t count = 0;
18 
19  enum PointFieldTypes { INT8 = traits::asEnum_v<std::int8_t>,
20  UINT8 = traits::asEnum_v<std::uint8_t>,
21  INT16 = traits::asEnum_v<std::int16_t>,
22  UINT16 = traits::asEnum_v<std::uint16_t>,
23  INT32 = traits::asEnum_v<std::int32_t>,
24  UINT32 = traits::asEnum_v<std::uint32_t>,
25  FLOAT32 = traits::asEnum_v<float>,
26  FLOAT64 = traits::asEnum_v<double>};
27 
28  public:
31  }; // struct PCLPointField
32 
35 
36  inline std::ostream& operator<<(std::ostream& s, const ::pcl::PCLPointField & v)
37  {
38  s << "name: ";
39  s << " " << v.name << std::endl;
40  s << "offset: ";
41  s << " " << v.offset << std::endl;
42  s << "datatype: ";
43  s << " " << v.datatype << std::endl;
44  s << "count: ";
45  s << " " << v.count << std::endl;
46  return (s);
47  }
48 
49  // Return true if the PCLPointField matches the expected name and data type.
50  // Written as a struct to allow partially specializing on Tag.
51  template<typename PointT, typename Tag>
52  struct FieldMatches
53  {
54  bool operator() (const PCLPointField& field)
55  {
56  return ((field.name == traits::name<PointT, Tag>::value) &&
59  (field.count == 0 && traits::datatype<PointT, Tag>::size == 1 /* see bug #821 */)));
60  }
61  };
62 
63 } // namespace pcl
64 
PCLPointField::Ptr PCLPointFieldPtr
Definition: PCLPointField.h:33
Defines functions, macros and traits for allocating and using memory.
PCLPointField::ConstPtr PCLPointFieldConstPtr
Definition: PCLPointField.h:34
shared_ptr< const ::pcl::PCLPointField > ConstPtr
Definition: PCLPointField.h:30
std::uint32_t offset
Definition: PCLPointField.h:15
std::ostream & operator<<(std::ostream &os, const BivariatePolynomialT< real > &p)
std::uint32_t count
Definition: PCLPointField.h:17
shared_ptr< ::pcl::PCLPointField > Ptr
Definition: PCLPointField.h:29
std::string name
Definition: PCLPointField.h:13
std::uint8_t datatype
Definition: PCLPointField.h:16
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
Definition: memory.h:81