46 #include <pcl/point_cloud.h>
47 #include <pcl/PointIndices.h>
49 #include <pcl/PolygonMesh.h>
63 const auto result = std::find_if(cloud.
fields.begin (), cloud.
fields.end (),
64 [&field_name](
const auto field) { return field.name == field_name; });
65 if (result == cloud.
fields.end ())
76 template <
typename Po
intT>
inline int
78 std::vector<pcl::PCLPointField> &fields);
85 template <
typename Po
intT>
inline int
87 const std::vector<pcl::PCLPointField> &fields);
93 template <
typename Po
intT>
inline std::vector<pcl::PCLPointField>
100 template <
typename Po
intT>
inline std::string
110 return std::accumulate(std::next (cloud.
fields.begin ()), cloud.
fields.end (), cloud.
fields[0].name,
111 [](
const auto& acc,
const auto& field) { return acc +
" " + field.name; });
150 std::vector<int> &field_sizes);
160 type = std::toupper (type, std::locale::classic ());
246 template <
typename Po
intT>
322 template <
typename Po
int1T,
typename Po
int2T>
inline bool
325 return (
typeid (Point1T) ==
typeid (Point2T));
335 template <
typename Po
intT,
typename IndicesVectorAllocator = std::allocator<index_t>>
void
337 const IndicesAllocator< IndicesVectorAllocator> &indices,
347 template <
typename Po
intT>
void
349 const PointIndices &indices,
359 template <
typename Po
intT>
void
361 const std::vector<pcl::PointIndices> &indices,
369 template <
typename Po
intInT,
typename Po
intOutT>
void
380 template <
typename Po
intInT,
typename Po
intOutT,
typename IndicesVectorAllocator = std::allocator<index_t>>
void
382 const IndicesAllocator<IndicesVectorAllocator> &indices,
392 template <
typename Po
intInT,
typename Po
intOutT>
void
394 const PointIndices &indices,
404 template <
typename Po
intInT,
typename Po
intOutT>
void
406 const std::vector<pcl::PointIndices> &indices,
428 template <
typename Po
intT>
void
431 int top,
int bottom,
int left,
int right,
445 template <
typename Po
intIn1T,
typename Po
intIn2T,
typename Po
intOutT>
void
489 template <std::
size_t N>
void
495 template <>
inline void
502 template <>
inline void
503 swapByte<2> (
char* bytes) { std::swap (bytes[0], bytes[1]); }
508 template <>
inline void
511 std::swap (bytes[0], bytes[3]);
512 std::swap (bytes[1], bytes[2]);
518 template <>
inline void
521 std::swap (bytes[0], bytes[7]);
522 std::swap (bytes[1], bytes[6]);
523 std::swap (bytes[2], bytes[5]);
524 std::swap (bytes[3], bytes[4]);
530 template <
typename T>
void
533 pcl::io::swapByte<sizeof(T)> (
reinterpret_cast<char*
> (&value));
538 #include <pcl/common/impl/io.hpp>
PointCloud represents the base class in PCL for storing collections of 3D points.
static bool concatenate(pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2)
void swapByte(char *bytes)
swap bytes order of a char array of length N
PCL_EXPORTS bool getPointCloudAsEigen(const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out)
Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format.
PCL_EXPORTS bool getEigenAsPointCloud(Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out)
Copy the XYZ dimensions from an Eigen MatrixXf into a pcl::PCLPointCloud2 message.
int getFieldSize(const int datatype)
Obtains the size of a specific field data type in bytes.
std::string getFieldsList(const pcl::PointCloud< PointT > &)
Get the list of all fields available in a given cloud.
int getFieldType(const int size, char type)
Obtains the type of the PCLPointField from a specific size and type.
void concatenateFields(const pcl::PointCloud< PointIn1T > &cloud1_in, const pcl::PointCloud< PointIn2T > &cloud2_in, pcl::PointCloud< PointOutT > &cloud_out)
Concatenate two datasets representing different fields.
PCL_EXPORTS bool concatenate(const pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2, pcl::PointCloud< PointT > &cloud_out)
Concatenate two pcl::PointCloud<PointT>
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.
float distance(const PointT &p1, const PointT &p2)
void swapByte< 1 >(char *bytes)
specialization of swapByte for dimension 1
void swapByte< 4 >(char *bytes)
specialization of swapByte for dimension 4
void swapByte< 2 >(char *bytes)
specialization of swapByte for dimension 2
void swapByte< 8 >(char *bytes)
specialization of swapByte for dimension 8
int getFieldIndex(const pcl::PointCloud< PointT > &, const std::string &field_name, std::vector< pcl::PCLPointField > &fields)
PCL_EXPORTS int interpolatePointIndex(int p, int length, InterpolationType type)
std::vector< index_t, Allocator > IndicesAllocator
Type used for indices in PCL.
IndicesAllocator<> Indices
Type used for indices in PCL.
bool isSamePointType()
Check if two given point types are the same or not.
PCL_EXPORTS void getFieldsSizes(const std::vector< pcl::PCLPointField > &fields, std::vector< int > &field_sizes)
Obtain a vector with the sizes of all valid fields (e.g., not "_")
void getFields(const pcl::PointCloud< PointT > &, std::vector< pcl::PCLPointField > &fields)
Defines all the PCL and non-PCL macros used.
std::vector<::pcl::PCLPointField > fields
static bool concatenate(pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2)
Inplace concatenate two pcl::PCLPointCloud2.
A point structure representing Euclidean xyz coordinates, and the RGB color.
static bool concatenate(pcl::PolygonMesh &mesh1, const pcl::PolygonMesh &mesh2)
Inplace concatenate two pcl::PolygonMesh.