42 #include <boost/mpl/assert.hpp>
43 #include <boost/mpl/identity.hpp>
45 #include <boost/mpl/vector.hpp>
46 #include <boost/preprocessor/seq/enum.hpp>
47 #include <boost/preprocessor/tuple/elem.hpp>
48 #include <boost/preprocessor/stringize.hpp>
54 #include <Eigen/src/StlSupport/details.h>
59 #include <type_traits>
67 template<
typename T>
struct asEnum;
71 template<
typename T>
struct decomposeArray
73 using type = std::remove_all_extents_t<T>;
74 static const std::uint32_t value =
sizeof (T) /
sizeof (type);
78 template<
typename Po
intT>
93 template<
typename Po
intT>
94 struct POD<
Eigen::internal::workaround_msvc_stl_support<PointT> >
110 template<
class Po
intT,
typename Tag,
int dummy = 0>
111 struct name : name<typename POD<PointT>::type, Tag, dummy>
117 BOOST_MPL_ASSERT_MSG((!std::is_same<
PointT,
typename POD<PointT>::type>::value),
118 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
123 #define POINT_CLOUD_REGISTER_FIELD_NAME(r, point, elem) \
124 template<int dummy> \
125 struct name<point, pcl::fields::BOOST_PP_TUPLE_ELEM(3, 2, elem), dummy> \
127 static const char value[]; \
130 template<int dummy> \
131 const char name<point, \
132 pcl::fields::BOOST_PP_TUPLE_ELEM(3, 2, elem), \
134 BOOST_PP_STRINGIZE(BOOST_PP_TUPLE_ELEM(3, 2, elem)); \
142 template<
class Po
intT,
typename Tag>
143 struct offset : offset<typename POD<PointT>::type, Tag>
149 BOOST_MPL_ASSERT_MSG((!std::is_same<
PointT,
typename POD<PointT>::type>::value),
150 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
155 #define POINT_CLOUD_REGISTER_FIELD_OFFSET(r, name, elem) \
156 template<> struct offset<name, pcl::fields::BOOST_PP_TUPLE_ELEM(3, 2, elem)> \
158 static const std::size_t value = offsetof(name, BOOST_PP_TUPLE_ELEM(3, 1, elem)); \
167 template<
class Po
intT,
typename Tag>
168 struct datatype : datatype<typename POD<PointT>::type, Tag>
176 BOOST_MPL_ASSERT_MSG((!std::is_same<
PointT,
typename POD<PointT>::type>::value),
177 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
182 #define POINT_CLOUD_REGISTER_FIELD_DATATYPE(r, name, elem) \
183 template<> struct datatype<name, pcl::fields::BOOST_PP_TUPLE_ELEM(3, 2, elem)> \
185 using type = boost::mpl::identity<BOOST_PP_TUPLE_ELEM(3, 0, elem)>::type; \
186 using decomposed = decomposeArray<type>; \
187 static const std::uint8_t value = asEnum<decomposed::type>::value; \
188 static const std::uint32_t size = decomposed::value; \
197 template<
typename Po
intT>
198 struct fieldList : fieldList<typename POD<PointT>::type>
204 BOOST_MPL_ASSERT_MSG((!std::is_same<
PointT,
typename POD<PointT>::type>::value),
205 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
210 #define POINT_CLOUD_REGISTER_POINT_FIELD_LIST(name, seq) \
211 template<> struct fieldList<name> \
213 using type = boost::mpl::vector<BOOST_PP_SEQ_ENUM(seq)>; \
A point structure representing Euclidean xyz coordinates, and the RGB color.