46 #include <pcl/point_cloud.h>
47 #include <pcl/PointIndices.h>
49 #include <pcl/PolygonMesh.h>
64 const auto result = std::find_if(cloud.
fields.begin (), cloud.
fields.end (),
65 [&field_name](
const auto field) { return field.name == field_name; });
66 if (result == cloud.
fields.end ())
78 template <
typename Po
intT>
inline int
80 std::vector<pcl::PCLPointField> &fields);
87 template <
typename Po
intT>
inline int
89 const std::vector<pcl::PCLPointField> &fields);
95 template <
typename Po
intT>
inline std::vector<pcl::PCLPointField>
102 template <
typename Po
intT>
inline std::string
117 return std::accumulate(std::next (cloud.
fields.begin ()), cloud.
fields.end (), cloud.
fields[0].name,
118 [](
const auto& acc,
const auto& field) { return acc +
" " + field.name; });
163 std::vector<int> &field_sizes);
173 type = std::toupper (type, std::locale::classic ());
177 if (size ==
sizeof(
bool)) {
279 template <
typename Po
intT>
355 template <
typename Po
int1T,
typename Po
int2T> constexpr
bool
368 template <
typename Po
intT,
typename IndicesVectorAllocator = std::allocator<index_t>>
void
370 const IndicesAllocator< IndicesVectorAllocator> &indices,
380 template <
typename Po
intT>
void
382 const PointIndices &indices,
392 template <
typename Po
intT>
void
394 const std::vector<pcl::PointIndices> &indices,
402 template <
typename Po
intInT,
typename Po
intOutT>
void
413 template <
typename Po
intInT,
typename Po
intOutT,
typename IndicesVectorAllocator = std::allocator<index_t>>
void
415 const IndicesAllocator<IndicesVectorAllocator> &indices,
425 template <
typename Po
intInT,
typename Po
intOutT>
void
427 const PointIndices &indices,
437 template <
typename Po
intInT,
typename Po
intOutT>
void
439 const std::vector<pcl::PointIndices> &indices,
461 template <
typename Po
intT>
void
464 int top,
int bottom,
int left,
int right,
478 template <
typename Po
intIn1T,
typename Po
intIn2T,
typename Po
intOutT>
void
522 template <std::
size_t N>
void
528 template <>
inline void
535 template <>
inline void
536 swapByte<2> (
char* bytes) { std::swap (bytes[0], bytes[1]); }
541 template <>
inline void
544 std::swap (bytes[0], bytes[3]);
545 std::swap (bytes[1], bytes[2]);
551 template <>
inline void
554 std::swap (bytes[0], bytes[7]);
555 std::swap (bytes[1], bytes[6]);
556 std::swap (bytes[2], bytes[5]);
557 std::swap (bytes[3], bytes[4]);
563 template <
typename T>
void
566 pcl::io::swapByte<sizeof(T)> (
reinterpret_cast<char*
> (&value));
571 #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)
bool concatenate(const pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2, pcl::PointCloud< PointT > &cloud_out)
Concatenate two pcl::PointCloud<PointT>
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.
#define PCL_FALLTHROUGH
Macro to add a no-op or a fallthrough attribute based on compiler feature.
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)
constexpr bool isSamePointType() noexcept
Check if two given point types are the same or not.
std::vector< index_t, Allocator > IndicesAllocator
Type used for indices in PCL.
std::remove_cv_t< std::remove_reference_t< T > > remove_cvref_t
IndicesAllocator<> Indices
Type used for indices in PCL.
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.