43#include <pcl/conversions.h>
44#include <pcl/common/concatenate.h>
45#include <pcl/common/copy_point.h>
46#include <pcl/common/io.h>
53template <
typename Po
intT>
int
56 std::vector<pcl::PCLPointField> &fields)
62template <
typename Po
intT>
int
64 std::vector<pcl::PCLPointField> &fields)
67 const auto&
ref = fields;
72template <
typename Po
intT>
int
74 const std::vector<pcl::PCLPointField> &fields)
76 const auto result = std::find_if(fields.begin (), fields.end (),
78 if (
result == fields.end ())
80 return std::distance(fields.begin (),
result);
84template <
typename Po
intT>
void
91template <
typename Po
intT>
void
98template <
typename Po
intT> std::vector<pcl::PCLPointField>
101 std::vector<pcl::PCLPointField> fields;
108template <
typename Po
intT> std::string
114 for (std::size_t i = 0; i < fields.size () - 1; ++i)
115 result += fields[i].name +
" ";
116 result += fields[fields.size () - 1].name;
123 template <
typename Po
intInT,
typename Po
intOutT>
void
133 template <
typename Po
intT>
void
143template <
typename Po
intInT,
typename Po
intOutT>
void
161template <
typename Po
intT,
typename IndicesVectorAllocator>
void
184 for (
const auto& index : indices)
189template <
typename Po
intInT,
typename Po
intOutT,
typename IndicesVectorAllocator>
void
204 for (std::size_t i = 0; i < indices.
size (); ++i)
209template <
typename Po
intT>
void
218template <
typename Po
intInT,
typename Po
intOutT>
void
227template <
typename Po
intT>
void
229 const std::vector<pcl::PointIndices> &indices,
232 std::size_t
nr_p = 0;
233 for (
const auto &index : indices)
266template <
typename Po
intInT,
typename Po
intOutT>
void
268 const std::vector<pcl::PointIndices> &indices,
271 const auto nr_p = std::accumulate(indices.begin (), indices.end (), 0,
272 [](
const auto&
acc,
const auto& index) { return index.indices.size() + acc; });
304template <
typename Po
intIn1T,
typename Po
intIn2T,
typename Po
intOutT>
void
309 using FieldList1 =
typename pcl::traits::fieldList<PointIn1T>::type;
310 using FieldList2 =
typename pcl::traits::fieldList<PointIn2T>::type;
314 PCL_ERROR (
"[pcl::concatenateFields] The number of points in the two input datasets differs!\n");
338template <
typename Po
intT>
void
342 if (top < 0 || left < 0 || bottom < 0 || right < 0)
344 std::string
faulty = (top < 0) ?
"top" : (left < 0) ?
"left" : (bottom < 0) ?
"bottom" :
"right";
349 if (top == 0 && left == 0 && bottom == 0 && right == 0)
385 for (
int i = 0; i < left; i++)
388 for (
int i = 0; i < right; i++)
400 for (
int j = 0; j < left; j++)
403 for (
int j = 0; j < right; j++)
407 for (
int i = 0; i < top; i++)
415 for (
int i = 0; i < bottom; i++)
425 PCL_ERROR (
"[pcl::copyPointCloud] Unhandled interpolation type %d!\n",
border_type);
447 for (
int i = 0; i < top; i++)
452 for (
int i = 0; i < bottom; i++)
An exception that is thrown when the arguments number or type is wrong/unhandled.
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
Defines all the PCL implemented PointT point type structures.
std::string getFieldsList(const pcl::PointCloud< PointT > &)
Get the list of all fields available in a given cloud.
void copyPoint(const PointInT &point_in, PointOutT &point_out)
Copy the fields of a source point into a target point.
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.
std::vector< pcl::PCLPointField > getFields()
Get the list of available fields (i.e., dimension/channel)
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.
void copyPointCloudMemcpy(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
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)
A point structure representing Euclidean xyz coordinates, and the RGB color.