40 #include <boost/mpl/assert.hpp>
41 #include <boost/mpl/identity.hpp>
43 #include <boost/mpl/vector.hpp>
44 #include <boost/preprocessor/seq/enum.hpp>
45 #include <boost/preprocessor/tuple/elem.hpp>
46 #include <boost/preprocessor/stringize.hpp>
51 #include <Eigen/src/StlSupport/details.h>
56 #include <type_traits>
64 template<
typename T>
struct asEnum;
68 template<
typename T>
struct decomposeArray
70 using type = std::remove_all_extents_t<T>;
71 static const std::uint32_t value =
sizeof (T) /
sizeof (type);
75 template<
typename Po
intT>
90 template<
typename Po
intT>
91 struct POD<
Eigen::internal::workaround_msvc_stl_support<PointT> >
107 template<
class Po
intT,
typename Tag,
int dummy = 0>
108 struct name : name<typename POD<PointT>::type, Tag, dummy>
114 BOOST_MPL_ASSERT_MSG((!std::is_same<
PointT,
typename POD<PointT>::type>::value),
115 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
120 #define POINT_CLOUD_REGISTER_FIELD_NAME(r, point, elem) \
121 template<int dummy> \
122 struct name<point, pcl::fields::BOOST_PP_TUPLE_ELEM(3, 2, elem), dummy> \
124 static const char value[]; \
127 template<int dummy> \
128 const char name<point, \
129 pcl::fields::BOOST_PP_TUPLE_ELEM(3, 2, elem), \
131 BOOST_PP_STRINGIZE(BOOST_PP_TUPLE_ELEM(3, 2, elem)); \
139 template<
class Po
intT,
typename Tag>
140 struct offset : offset<typename POD<PointT>::type, Tag>
146 BOOST_MPL_ASSERT_MSG((!std::is_same<
PointT,
typename POD<PointT>::type>::value),
147 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
152 #define POINT_CLOUD_REGISTER_FIELD_OFFSET(r, name, elem) \
153 template<> struct offset<name, pcl::fields::BOOST_PP_TUPLE_ELEM(3, 2, elem)> \
155 static const std::size_t value = offsetof(name, BOOST_PP_TUPLE_ELEM(3, 1, elem)); \
164 template<
class Po
intT,
typename Tag>
165 struct datatype : datatype<typename POD<PointT>::type, Tag>
173 BOOST_MPL_ASSERT_MSG((!std::is_same<
PointT,
typename POD<PointT>::type>::value),
174 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
179 #define POINT_CLOUD_REGISTER_FIELD_DATATYPE(r, name, elem) \
180 template<> struct datatype<name, pcl::fields::BOOST_PP_TUPLE_ELEM(3, 2, elem)> \
182 using type = boost::mpl::identity<BOOST_PP_TUPLE_ELEM(3, 0, elem)>::type; \
183 using decomposed = decomposeArray<type>; \
184 static const std::uint8_t value = asEnum<decomposed::type>::value; \
185 static const std::uint32_t size = decomposed::value; \
194 template<
typename Po
intT>
195 struct fieldList : fieldList<typename POD<PointT>::type>
201 BOOST_MPL_ASSERT_MSG((!std::is_same<
PointT,
typename POD<PointT>::type>::value),
202 POINT_TYPE_NOT_PROPERLY_REGISTERED, (
PointT&));
207 #define POINT_CLOUD_REGISTER_POINT_FIELD_LIST(name, seq) \
208 template<> struct fieldList<name> \
210 using type = boost::mpl::vector<BOOST_PP_SEQ_ENUM(seq)>; \
A point structure representing Euclidean xyz coordinates, and the RGB color.