Point Cloud Library (PCL)
1.10.1
|
46 #include <pcl/pcl_base.h>
47 #include <pcl/PointIndices.h>
48 #include <pcl/conversions.h>
49 #include <pcl/exceptions.h>
51 #include <pcl/PolygonMesh.h>
65 const auto result = std::find_if(cloud.
fields.begin (), cloud.
fields.end (),
66 [&field_name](
const auto field) {
return field.name == field_name; });
67 if (result == cloud.
fields.end ())
78 template <
typename Po
intT>
79 PCL_DEPRECATED(
"use getFieldIndex<PointT> (field_name, fields) instead")
82 std::vector<
pcl::PCLPointField> &fields);
90 template <typename
PointT> inline
int
92 std::vector<
pcl::PCLPointField> &fields);
99 template <typename
PointT> inline
int
101 const std::vector<
pcl::PCLPointField> &fields);
108 template <typename
PointT>
118 template <typename
PointT>
127 template <typename
PointT> inline std::vector<
pcl::PCLPointField>
134 template <typename
PointT> inline std::
string
144 return std::accumulate(std::next (cloud.fields.begin ()), cloud.fields.end (), cloud.fields[0].name,
145 [](
const auto& acc,
const auto& field) {
return acc +
" " + field.name; });
184 std::vector<int> &field_sizes);
194 type = std::toupper (type, std::locale::classic ());
280 template <
typename Po
intT>
331 PCL_DEPRECATED(
"use pcl::concatenate() instead, but beware of subtle difference in behavior (see documentation)")
333 concatenatePointCloud (const
pcl::PCLPointCloud2 &cloud1,
334 const
pcl::PCLPointCloud2 &cloud2,
335 pcl::PCLPointCloud2 &cloud_out);
346 const std::vector<
int> &indices,
347 pcl::PCLPointCloud2 &cloud_out);
358 const std::vector<
int,
Eigen::aligned_allocator<
int> > &indices,
359 pcl::PCLPointCloud2 &cloud_out);
368 pcl::PCLPointCloud2 &cloud_out);
371 template <typename Point1T, typename Point2T> inline
bool
374 return (
typeid (Point1T) ==
typeid (Point2T));
384 template <
typename Po
intT,
typename IndicesVectorAllocator = std::allocator<
int>>
void
386 const std::vector<int, IndicesVectorAllocator> &indices,
396 template <
typename Po
intT>
void
398 const PointIndices &indices,
408 template <
typename Po
intT>
void
410 const std::vector<pcl::PointIndices> &indices,
418 template <
typename Po
intInT,
typename Po
intOutT>
void
429 template <
typename Po
intInT,
typename Po
intOutT,
typename IndicesVectorAllocator = std::allocator<
int>>
void
431 const std::vector<int, IndicesVectorAllocator> &indices,
441 template <
typename Po
intInT,
typename Po
intOutT>
void
443 const PointIndices &indices,
453 template <
typename Po
intInT,
typename Po
intOutT>
void
455 const std::vector<pcl::PointIndices> &indices,
477 template <
typename Po
intT>
void
480 int top,
int bottom,
int left,
int right,
494 template <
typename Po
intIn1T,
typename Po
intIn2T,
typename Po
intOutT>
void
538 template <std::
size_t N>
void
544 template <>
inline void
551 template <>
inline void
557 template <>
inline void
560 std::swap (bytes[0], bytes[3]);
561 std::swap (bytes[1], bytes[2]);
567 template <>
inline void
570 std::swap (bytes[0], bytes[7]);
571 std::swap (bytes[1], bytes[6]);
572 std::swap (bytes[2], bytes[5]);
573 std::swap (bytes[3], bytes[4]);
579 template <
typename T>
void
582 pcl::io::swapByte<sizeof(T)> (reinterpret_cast<char*> (&value));
587 #include <pcl/common/impl/io.hpp>
PCL_EXPORTS bool getPointCloudAsEigen(const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out)
Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format.
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.
Defines all the PCL and non-PCL macros used.
This file defines compatibility wrappers for low level I/O functions.
float distance(const PointT &p1, const PointT &p2)
void getFields(const pcl::PointCloud< PointT > &cloud, std::vector< pcl::PCLPointField > &fields)
Get the list of available fields (i.e., dimension/channel)
bool isSamePointType()
Check if two given point types are the same or not.
void swapByte< 4 >(char *bytes)
specialization of swapByte for dimension 4
void swapByte< 2 >(char *bytes)
specialization of swapByte for dimension 2
PointCloud represents the base class in PCL for storing collections of 3D points.
A point structure representing Euclidean xyz coordinates, and the RGB color.
int getFieldIndex(const pcl::PCLPointCloud2 &cloud, const std::string &field_name)
Get the index of a specified field (i.e., dimension/channel)
static bool concatenate(pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2)
Inplace concatenate two pcl::PCLPointCloud2.
void swapByte< 1 >(char *bytes)
specialization of swapByte for dimension 1
std::vector<::pcl::PCLPointField > fields
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 "_")
int getFieldSize(const int datatype)
Obtains the size of a specific field data type in bytes.
PCL_EXPORTS bool getEigenAsPointCloud(Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out)
Copy the XYZ dimensions from an Eigen MatrixXf into a pcl::PCLPointCloud2 message.
static bool concatenate(pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2)
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 swapByte< 8 >(char *bytes)
specialization of swapByte for dimension 8
PCL_DEPRECATED("use pcl::concatenate() instead, but beware of subtle difference in behavior (see documentation)") PCL_EXPORTS bool concatenatePointCloud(const pcl PCL_EXPORTS void copyPointCloud(const pcl::PCLPointCloud2 &cloud_in, const std::vector< int > &indices, pcl::PCLPointCloud2 &cloud_out)
Concatenate two pcl::PCLPointCloud2.
PCL_EXPORTS int interpolatePointIndex(int p, int length, InterpolationType type)
std::string getFieldsList(const pcl::PointCloud< PointT > &cloud)
Get the list of all fields available in a given cloud.
#define PCL_DEPRECATED(message)
static bool concatenate(pcl::PolygonMesh &mesh1, const pcl::PolygonMesh &mesh2)
Inplace concatenate two pcl::PolygonMesh.
int getFieldType(const int size, char type)
Obtains the type of the PCLPointField from a specific size and type.
void swapByte(char *bytes)
swap bytes order of a char array of length N