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
112 return std::accumulate(std::next (cloud.
fields.begin ()), cloud.
fields.end (), cloud.
fields[0].name,
113 [](
const auto& acc,
const auto& field) { return acc +
" " + field.name; });
157 std::vector<int> &field_sizes);
167 type = std::toupper (type, std::locale::classic ());
171 if (size ==
sizeof(
bool)) {
273 template <
typename Po
intT>
349 template <
typename Po
int1T,
typename Po
int2T> constexpr
bool
362 template <
typename Po
intT,
typename IndicesVectorAllocator = std::allocator<index_t>>
void
364 const IndicesAllocator< IndicesVectorAllocator> &indices,
374 template <
typename Po
intT>
void
376 const PointIndices &indices,
386 template <
typename Po
intT>
void
388 const std::vector<pcl::PointIndices> &indices,
396 template <
typename Po
intInT,
typename Po
intOutT>
void
407 template <
typename Po
intInT,
typename Po
intOutT,
typename IndicesVectorAllocator = std::allocator<index_t>>
void
409 const IndicesAllocator<IndicesVectorAllocator> &indices,
419 template <
typename Po
intInT,
typename Po
intOutT>
void
421 const PointIndices &indices,
431 template <
typename Po
intInT,
typename Po
intOutT>
void
433 const std::vector<pcl::PointIndices> &indices,
455 template <
typename Po
intT>
void
458 int top,
int bottom,
int left,
int right,
472 template <
typename Po
intIn1T,
typename Po
intIn2T,
typename Po
intOutT>
void
516 template <std::
size_t N>
void
522 template <>
inline void
529 template <>
inline void
530 swapByte<2> (
char* bytes) { std::swap (bytes[0], bytes[1]); }
535 template <>
inline void
538 std::swap (bytes[0], bytes[3]);
539 std::swap (bytes[1], bytes[2]);
545 template <>
inline void
548 std::swap (bytes[0], bytes[7]);
549 std::swap (bytes[1], bytes[6]);
550 std::swap (bytes[2], bytes[5]);
551 std::swap (bytes[3], bytes[4]);
557 template <
typename T>
void
560 pcl::io::swapByte<sizeof(T)> (
reinterpret_cast<char*
> (&value));
565 #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>
#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.