40 #include <boost/mpl/assert.hpp>
45 #include <Eigen/src/StlSupport/details.h>
49 #include <type_traits>
85 template<
typename T>
struct asEnum {};
106 template<>
struct asType<detail::PointFieldTypes::FLOAT32> {
using type = float; };
107 template<>
struct asType<detail::PointFieldTypes::FLOAT64> {
using type = double; };
116 using type = std::remove_all_extents_t<T>;
121 template<
typename Po
intT>
137 template<
typename Po
intT>
138 struct POD<
Eigen::internal::workaround_msvc_stl_support<PointT> >
155 template<
class Po
intT,
typename Tag,
int dummy = 0>
156 struct name :
name<typename POD<PointT>::type, Tag, dummy>
163 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
167 template<
class Po
intT,
typename Tag>
175 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
179 template<
class Po
intT,
typename Tag>
189 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
193 template<
typename Po
intT>
201 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
218 template <
typename Po
intInT,
typename OutT>
230 const std::string &field,
233 : pt_ (reinterpret_cast<const
Pod&>(pt)), name_ (field), exists_ (exists), value_ (value)
244 const std::string &field,
246 : pt_ (reinterpret_cast<const
Pod&>(pt)), name_ (field), exists_ (exists_tmp_), value_ (value)
251 template <
typename Key>
inline void
259 value_ =
static_cast<OutT
> (*
reinterpret_cast<const T*
>(data_ptr));
265 const std::string &name_;
283 template <
typename Po
intOutT,
typename InT>
294 const std::string &field,
296 : pt_ (reinterpret_cast<
Pod&>(pt)), name_ (field), value_ (value)
301 template <
typename Key>
inline void
308 *
reinterpret_cast<T*
>(data_ptr) =
static_cast<T
> (value_);
314 const std::string &name_;
323 template <
typename Po
intT,
typename ValT>
inline void
327 *
reinterpret_cast<ValT*
>(data_ptr) = value;
335 template <
typename Po
intT,
typename ValT>
inline void
339 value = *
reinterpret_cast<const ValT*
>(data_ptr);
342 template <
typename ...>
using void_t = void;
typename asType< index >::type asType_t
static constexpr std::uint8_t asEnum_v
void setFieldValue(PointT &pt, std::size_t field_offset, const ValT &value)
Set the value at a specified field in a point.
void getFieldValue(const PointT &pt, std::size_t field_offset, ValT &value)
Get the value at a specified field in a point.
A helper functor that can copy a specific value if the given field exists.
CopyIfFieldExists(const PointInT &pt, const std::string &field, OutT &value)
Constructor.
CopyIfFieldExists(const PointInT &pt, const std::string &field, bool &exists, OutT &value)
Constructor.
void operator()()
Operator.
typename traits::POD< PointInT >::type Pod
A point structure representing Euclidean xyz coordinates, and the RGB color.
A helper functor that can set a specific value in a field if the field exists.
SetIfFieldExists(PointOutT &pt, const std::string &field, const InT &value)
Constructor.
typename traits::POD< PointOutT >::type Pod
void operator()()
Operator.
Tests at compile time if type T has a custom allocator.
BOOST_MPL_ASSERT_MSG((!std::is_same< PointT, typename POD< PointT >::type >::value), POINT_TYPE_NOT_PROPERLY_REGISTERED,(PointT &))
static const std::uint32_t value
std::remove_all_extents_t< T > type
Enumeration for different numerical types.
static const std::uint8_t INT16
static const std::uint8_t FLOAT64
static const std::uint8_t UINT8
static const std::uint8_t UINT32
static const std::uint8_t FLOAT32
static const std::uint8_t INT32
static const std::uint8_t UINT16
static const std::uint8_t INT8
BOOST_MPL_ASSERT_MSG((!std::is_same< PointT, typename POD< PointT >::type >::value), POINT_TYPE_NOT_PROPERLY_REGISTERED,(PointT &))
BOOST_MPL_ASSERT_MSG((!std::is_same< PointT, typename POD< PointT >::type >::value), POINT_TYPE_NOT_PROPERLY_REGISTERED,(PointT &))
BOOST_MPL_ASSERT_MSG((!std::is_same< PointT, typename POD< PointT >::type >::value), POINT_TYPE_NOT_PROPERLY_REGISTERED,(PointT &))