39 #ifndef PCL_POINT_TRAITS_H_ 40 #define PCL_POINT_TRAITS_H_ 43 #pragma GCC system_header 46 #include "pcl/pcl_macros.h" 48 #include <pcl/PCLPointField.h> 49 #include <boost/type_traits/remove_all_extents.hpp> 50 #include <boost/type_traits/is_same.hpp> 51 #include <boost/mpl/assert.hpp> 52 #if PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) == PCL_LINEAR_VERSION(4,4,3) 53 #include <boost/mpl/bool.hpp> 59 #include <Eigen/src/StlSupport/details.h> 73 template<
typename T>
struct asEnum {};
98 typedef typename boost::remove_all_extents<T>::type
type;
99 static const uint32_t
value =
sizeof (T) /
sizeof (
type);
103 template<
typename Po
intT>
119 template<
typename Po
intT>
120 struct POD<
Eigen::internal::workaround_msvc_stl_support<PointT> >
137 template<
class Po
intT,
typename Tag,
int dummy = 0>
138 struct name :
name<typename POD<PointT>::type, Tag, dummy>
145 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
149 template<
class Po
intT,
typename Tag>
157 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
161 template<
class Po
intT,
typename Tag>
171 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
175 template<
typename Po
intT>
183 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
185 #if PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) == PCL_LINEAR_VERSION(4,4,3) 200 template<
typename Po
intT,
typename Tag>
225 template <
typename Po
intInT,
typename OutT>
237 const std::string &field,
240 : pt_ (reinterpret_cast<const
Pod&>(pt)), name_ (field), exists_ (exists), value_ (value)
251 const std::string &field,
253 : pt_ (reinterpret_cast<const
Pod&>(pt)), name_ (field), exists_ (exists_tmp_), value_ (value)
258 template <
typename Key>
inline void 266 value_ = static_cast<OutT> (*reinterpret_cast<const T*>(data_ptr));
272 const std::string &name_;
290 template <
typename Po
intOutT,
typename InT>
301 const std::string &field,
303 : pt_ (reinterpret_cast<
Pod&>(pt)), name_ (field), value_ (value)
308 template <
typename Key>
inline void 315 *reinterpret_cast<T*>(data_ptr) = static_cast<T> (value_);
321 const std::string &name_;
330 template <
typename Po
intT,
typename ValT>
inline void 333 uint8_t* data_ptr = reinterpret_cast<uint8_t*>(&pt) + field_offset;
334 *reinterpret_cast<ValT*>(data_ptr) = value;
342 template <
typename Po
intT,
typename ValT>
inline void 345 const uint8_t* data_ptr = reinterpret_cast<const uint8_t*>(&pt) + field_offset;
346 value = *reinterpret_cast<const ValT*>(data_ptr);
350 #endif //#ifndef PCL_POINT_TRAITS_H_
A helper functor that can set a specific value in a field if the field exists.
boost::remove_all_extents< T >::type type
SetIfFieldExists(PointOutT &pt, const std::string &field, const InT &value)
Constructor.
BOOST_MPL_ASSERT_MSG((!boost::is_same< PointT, typename POD< PointT >::type >::value), POINT_TYPE_NOT_PROPERLY_REGISTERED,(PointT &))
BOOST_MPL_ASSERT_MSG((!boost::is_same< PointT, typename POD< PointT >::type >::value), POINT_TYPE_NOT_PROPERLY_REGISTERED,(PointT &))
void setFieldValue(PointT &pt, size_t field_offset, const ValT &value)
Set the value at a specified field in a point.
void operator()()
Operator.
void getFieldValue(const PointT &pt, size_t field_offset, ValT &value)
Get the value at a specified field in a point.
static const uint32_t value
CopyIfFieldExists(const PointInT &pt, const std::string &field, bool &exists, OutT &value)
Constructor.
CopyIfFieldExists(const PointInT &pt, const std::string &field, OutT &value)
Constructor.
BOOST_MPL_ASSERT_MSG((!boost::is_same< PointT, typename POD< PointT >::type >::value), POINT_TYPE_NOT_PROPERLY_REGISTERED,(PointT &))
void operator()()
Operator.
bool operator()(const pcl::PCLPointField &field)
BOOST_MPL_ASSERT_MSG((!boost::is_same< PointT, typename POD< PointT >::type >::value), POINT_TYPE_NOT_PROPERLY_REGISTERED,(PointT &))
traits::POD< PointOutT >::type Pod
A point structure representing Euclidean xyz coordinates, and the RGB color.
BOOST_MPL_ASSERT_MSG((!bool(boost::mpl::bool_< false >::value)), WTF_GCC443,(bool))
A helper functor that can copy a specific value if the given field exists.
traits::POD< PointInT >::type Pod