#pragma once #include // for shared_ptr #include // for asEnum_v #include // for index_t #include // for string #include // for ostream namespace pcl { struct PCLPointField { std::string name; uindex_t offset = 0; std::uint8_t datatype = 0; uindex_t count = 0; enum PointFieldTypes { INT8 = traits::asEnum_v, UINT8 = traits::asEnum_v, INT16 = traits::asEnum_v, UINT16 = traits::asEnum_v, INT32 = traits::asEnum_v, UINT32 = traits::asEnum_v, FLOAT32 = traits::asEnum_v, FLOAT64 = traits::asEnum_v}; public: using Ptr = shared_ptr< ::pcl::PCLPointField>; using ConstPtr = shared_ptr; }; // struct PCLPointField using PCLPointFieldPtr = PCLPointField::Ptr; using PCLPointFieldConstPtr = PCLPointField::ConstPtr; inline std::ostream& operator<<(std::ostream& s, const ::pcl::PCLPointField & v) { s << "name: "; s << " " << v.name << std::endl; s << "offset: "; s << " " << v.offset << std::endl; s << "datatype: "; s << " " << v.datatype << std::endl; s << "count: "; s << " " << v.count << std::endl; return (s); } // Return true if the PCLPointField matches the expected name and data type. // Written as a struct to allow partially specializing on Tag. template struct FieldMatches { bool operator() (const PCLPointField& field) { return ((field.name == traits::name::value) && (field.datatype == traits::datatype::value) && ((field.count == traits::datatype::size) || (field.count == 0 && traits::datatype::size == 1 /* see bug #821 */))); } }; } // namespace pcl