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> 80 template<
typename T>
struct asEnum {};
105 typedef typename boost::remove_all_extents<T>::type
type;
106 static const uint32_t value =
sizeof (T) /
sizeof (type);
110 template<
typename Po
intT>
126 template<
typename Po
intT>
127 struct POD<
Eigen::internal::workaround_msvc_stl_support<PointT> >
144 template<
class Po
intT,
typename Tag,
int dummy = 0>
145 struct name :
name<typename POD<PointT>::type, Tag, dummy>
152 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
156 template<
class Po
intT,
typename Tag>
164 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
168 template<
class Po
intT,
typename Tag>
178 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
182 template<
typename Po
intT>
190 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
192 #if PCL_LINEAR_VERSION(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) == PCL_LINEAR_VERSION(4,4,3) 207 template<
typename Po
intT,
typename Tag>
232 template <
typename Po
intInT,
typename OutT>
244 const std::string &field,
247 : pt_ (reinterpret_cast<const Pod&>(pt)), name_ (field), exists_ (exists), value_ (value)
258 const std::string &field,
260 : pt_ (reinterpret_cast<const Pod&>(pt)), name_ (field), exists_ (exists_tmp_), value_ (value)
265 template <
typename Key>
inline void 273 value_ =
static_cast<OutT
> (*
reinterpret_cast<const T*
>(data_ptr));
279 const std::string &name_;
297 template <
typename Po
intOutT,
typename InT>
308 const std::string &field,
310 : pt_ (reinterpret_cast<Pod&>(pt)), name_ (field), value_ (value)
315 template <
typename Key>
inline void 322 *
reinterpret_cast<T*
>(data_ptr) = static_cast<T> (value_);
328 const std::string &name_;
337 template <
typename Po
intT,
typename ValT>
inline void 340 uint8_t* data_ptr =
reinterpret_cast<uint8_t*
>(&pt) + field_offset;
341 *
reinterpret_cast<ValT*
>(data_ptr) = value;
349 template <
typename Po
intT,
typename ValT>
inline void 352 const uint8_t* data_ptr =
reinterpret_cast<const uint8_t*
>(&pt) + field_offset;
353 value = *
reinterpret_cast<const ValT*
>(data_ptr);
357 #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
This file defines compatibility wrappers for low level I/O functions.
SetIfFieldExists(PointOutT &pt, const std::string &field, const InT &value)
Constructor.
void setFieldValue(PointT &pt, size_t field_offset, const ValT &value)
Set the value at a specified field in a point.
void getFieldValue(const PointT &pt, size_t field_offset, ValT &value)
Get the value at a specified field in a point.
CopyIfFieldExists(const PointInT &pt, const std::string &field, bool &exists, OutT &value)
Constructor.
CopyIfFieldExists(const PointInT &pt, const std::string &field, OutT &value)
Constructor.
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