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(1, 12,
"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(1, 12,
"use pcl::concatenate() instead, but beware of subtle difference in behavior (see documentation)")
334 const
pcl::PCLPointCloud2 &cloud2,
335 pcl::PCLPointCloud2 &cloud_out);
347 pcl::PCLPointCloud2 &cloud_out);
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 IndicesAllocator< 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 IndicesAllocator<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>
std::vector<::pcl::PCLPointField > fields
std::string getFieldsList(const pcl::PointCloud< PointT > &)
Get the list of all fields available in a given cloud.
static bool concatenate(pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2)
Inplace concatenate two pcl::PCLPointCloud2.
void swapByte< 8 >(char *bytes)
specialization of swapByte for dimension 8
bool isSamePointType()
Check if two given point types are the same or not.
void swapByte(char *bytes)
swap bytes order of a char array of length N
int getFieldType(const int size, char type)
Obtains the type of the PCLPointField from a specific size and type.
int getFieldIndex(const pcl::PointCloud< PointT > &, const std::string &field_name, std::vector< pcl::PCLPointField > &fields)
Get the index of a specified field (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.
PCL_EXPORTS bool getPointCloudAsEigen(const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out)
Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format.
float distance(const PointT &p1, const PointT &p2)
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 "_")
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< 1 >(char *bytes)
specialization of swapByte for dimension 1
std::vector< index_t, Allocator > IndicesAllocator
Type used for indices in PCL.
IndicesAllocator<> Indices
Type used for indices in PCL.
int getFieldSize(const int datatype)
Obtains the size of a specific field data type in bytes.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
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 int interpolatePointIndex(int p, int length, InterpolationType type)
void swapByte< 2 >(char *bytes)
specialization of swapByte for dimension 2
PCL_EXPORTS bool concatenatePointCloud(const pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2, pcl::PCLPointCloud2 &cloud_out)
Concatenate two pcl::PCLPointCloud2.
static bool concatenate(pcl::PolygonMesh &mesh1, const pcl::PolygonMesh &mesh2)
Inplace concatenate two pcl::PolygonMesh.
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major...
A point structure representing Euclidean xyz coordinates, and the RGB color.
void swapByte< 4 >(char *bytes)
specialization of swapByte for dimension 4
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.
void getFields(const pcl::PointCloud< PointT > &, std::vector< pcl::PCLPointField > &fields)
Get the list of available fields (i.e., dimension/channel)
Defines all the PCL and non-PCL macros used.