Loading...
Searching...
No Matches
PCLPointField.h
#pragma once
#include <pcl/memory.h> // for shared_ptr
#include <pcl/type_traits.h> // for asEnum_v
#include <pcl/types.h> // for index_t
#include <string> // for string
#include <ostream> // for ostream
namespace pcl
{
struct PCLPointField
{
std::string name;
uindex_t offset = 0;
std::uint8_t datatype = 0;
uindex_t count = 0;
enum PointFieldTypes { BOOL = traits::asEnum_v<bool>,
INT8 = traits::asEnum_v<std::int8_t>,
UINT8 = traits::asEnum_v<std::uint8_t>,
INT16 = traits::asEnum_v<std::int16_t>,
UINT16 = traits::asEnum_v<std::uint16_t>,
INT32 = traits::asEnum_v<std::int32_t>,
UINT32 = traits::asEnum_v<std::uint32_t>,
INT64 = traits::asEnum_v<std::int64_t>,
UINT64 = traits::asEnum_v<std::uint64_t>,
FLOAT32 = traits::asEnum_v<float>,
FLOAT64 = traits::asEnum_v<double>};
public:
using Ptr = shared_ptr< ::pcl::PCLPointField>;
using ConstPtr = shared_ptr<const ::pcl::PCLPointField>;
}; // 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: ";
switch(v.datatype) {
case ::pcl::PCLPointField::PointFieldTypes::INT8: s << " INT8" << std::endl; break;
case ::pcl::PCLPointField::PointFieldTypes::UINT8: s << " UINT8" << std::endl; break;
case ::pcl::PCLPointField::PointFieldTypes::INT16: s << " INT16" << std::endl; break;
case ::pcl::PCLPointField::PointFieldTypes::UINT16: s << " UINT16" << std::endl; break;
case ::pcl::PCLPointField::PointFieldTypes::INT32: s << " INT32" << std::endl; break;
case ::pcl::PCLPointField::PointFieldTypes::UINT32: s << " UINT32" << std::endl; break;
case ::pcl::PCLPointField::PointFieldTypes::FLOAT32: s << " FLOAT32" << std::endl; break;
case ::pcl::PCLPointField::PointFieldTypes::FLOAT64: s << " FLOAT64" << std::endl; break;
default: s << " " << static_cast<int>(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<typename PointT, typename Tag>
struct FieldMatches
{
bool operator() (const PCLPointField& field)
{
return ((field.name == traits::name<PointT, Tag>::value) &&
(field.datatype == traits::datatype<PointT, Tag>::value) &&
((field.count == traits::datatype<PointT, Tag>::size) ||
(field.count == 0 && traits::datatype<PointT, Tag>::size == 1 /* see bug #821 */)));
}
};
} // namespace pcl
memory.h
Defines functions, macros and traits for allocating and using memory.
pcl
Definition convolution.h:46
pcl::PCLPointFieldConstPtr
PCLPointField::ConstPtr PCLPointFieldConstPtr
Definition PCLPointField.h:38
pcl::uindex_t
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.
Definition types.h:120
pcl::operator<<
std::ostream & operator<<(std::ostream &os, const BivariatePolynomialT< real > &p)
Definition bivariate_polynomial.hpp:238
pcl::PCLPointFieldPtr
PCLPointField::Ptr PCLPointFieldPtr
Definition PCLPointField.h:37
pcl::FieldMatches
Definition PCLPointField.h:67
pcl::FieldMatches::operator()
bool operator()(const PCLPointField &field)
Definition PCLPointField.h:68
pcl::PCLPointField
Definition PCLPointField.h:13
pcl::PCLPointField::PointFieldTypes
PointFieldTypes
Definition PCLPointField.h:20
pcl::PCLPointField::UINT16
@ UINT16
Definition PCLPointField.h:24
pcl::PCLPointField::FLOAT32
@ FLOAT32
Definition PCLPointField.h:29
pcl::PCLPointField::UINT8
@ UINT8
Definition PCLPointField.h:22
pcl::PCLPointField::INT16
@ INT16
Definition PCLPointField.h:23
pcl::PCLPointField::FLOAT64
@ FLOAT64
Definition PCLPointField.h:30
pcl::PCLPointField::UINT32
@ UINT32
Definition PCLPointField.h:26
pcl::PCLPointField::UINT64
@ UINT64
Definition PCLPointField.h:28
pcl::PCLPointField::INT8
@ INT8
Definition PCLPointField.h:21
pcl::PCLPointField::INT64
@ INT64
Definition PCLPointField.h:27
pcl::PCLPointField::INT32
@ INT32
Definition PCLPointField.h:25
pcl::PCLPointField::BOOL
@ BOOL
Definition PCLPointField.h:20
pcl::PCLPointField::offset
uindex_t offset
Definition PCLPointField.h:16
pcl::PCLPointField::name
std::string name
Definition PCLPointField.h:14
pcl::PCLPointField::ConstPtr
shared_ptr< const ::pcl::PCLPointField > ConstPtr
Definition PCLPointField.h:34
pcl::PCLPointField::datatype
std::uint8_t datatype
Definition PCLPointField.h:17
pcl::PCLPointField::count
uindex_t count
Definition PCLPointField.h:18
pcl::PCLPointField::Ptr
shared_ptr< ::pcl::PCLPointField > Ptr
Definition PCLPointField.h:33
types.h
Defines basic non-point types used by PCL.