Point Cloud Library (PCL)  1.11.1-dev
List of all members | Public Types | Public Member Functions
pcl::SetIfFieldExists< PointOutT, InT > Struct Template Reference

A helper functor that can set a specific value in a field if the field exists. More...

#include <pcl/type_traits.h>

Public Types

using Pod = typename traits::POD< PointOutT >::type
 

Public Member Functions

 SetIfFieldExists (PointOutT &pt, const std::string &field, const InT &value)
 Constructor. More...
 
template<typename Key >
void operator() ()
 Operator. More...
 

Detailed Description

template<typename PointOutT, typename InT>
struct pcl::SetIfFieldExists< PointOutT, InT >

A helper functor that can set a specific value in a field if the field exists.

Note
In order to actually set the value an instance of this functor should be passed to a pcl::for_each_type loop. See the example below.
using FieldList = typename pcl::traits::fieldList<PointT>::type;
pcl::for_each_type<FieldList> (pcl::SetIfFieldExists<PointT, float> (p, "intensity", 42.0f));

Definition at line 189 of file type_traits.h.

Member Typedef Documentation

◆ Pod

template<typename PointOutT , typename InT >
using pcl::SetIfFieldExists< PointOutT, InT >::Pod = typename traits::POD<PointOutT>::type

Definition at line 191 of file type_traits.h.

Constructor & Destructor Documentation

◆ SetIfFieldExists()

template<typename PointOutT , typename InT >
pcl::SetIfFieldExists< PointOutT, InT >::SetIfFieldExists ( PointOutT &  pt,
const std::string &  field,
const InT &  value 
)
inline

Constructor.

Parameters
[in]ptthe input point
[in]fieldthe name of the field
[out]valuethe value to set

Definition at line 198 of file type_traits.h.

Member Function Documentation

◆ operator()()

template<typename PointOutT , typename InT >
template<typename Key >
void pcl::SetIfFieldExists< PointOutT, InT >::operator() ( )
inline

Operator.

Data copy happens here.

Definition at line 207 of file type_traits.h.


The documentation for this struct was generated from the following file:
pcl::PointXYZRGB
A point structure representing Euclidean xyz coordinates, and the RGB color.
Definition: point_types.hpp:628
pcl::SetIfFieldExists
A helper functor that can set a specific value in a field if the field exists.
Definition: type_traits.h:189