5#include <boost/preprocessor/seq/for_each.hpp>
7#include <pcl/point_cloud.h>
8#include <pcl/point_types.h>
10#pragma GCC diagnostic push
11#pragma GCC diagnostic ignored "-Wpedantic"
12#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
13#include <CGAL/Polyhedron_3.h>
14#pragma GCC diagnostic pop
22#define _detail_unpack(r, data, elem) , elem
24 static constexpr bool is_pcl_point_type_v =
25 is_any_of_v<
T BOOST_PP_SEQ_FOR_EACH(
_detail_unpack, , PCL_XYZ_POINT_TYPES)>;
28 template <
class T,
class =
void>
46 template <
class T,
class =
void>
98 using T = CGAL::Epick::Point_3;
120 static constexpr bool is_point_type_v = point_type_traits<T>::value;
122 static_assert(is_point_type_v<pcl::PointXYZ>);
123 static_assert(is_point_type_v<Eigen::Vector3f>);
124 static_assert(is_point_type_v<Eigen::Vector3i>);
125 static_assert(is_point_type_v<Eigen::RowVector3cd>);
126 static_assert(is_point_type_v<CGAL::Epick::Point_3>);
131#include <forward_list>
134#include <unordered_set>
139#define _detail_containerlist \
140 std::vector, std::deque, std::list, std::forward_list, std::set, std::unordered_set
144 template <
class T,
class =
void>
152 std::enable_if_t<TypeTemplateTraits::IsInstanceOfAnyV<T, _detail_containerlist>>> :
194#undef _detail_containerlist
196 template <
class PType>
199 using T = pcl::PointCloud<PType>;
205 return t.points.begin();
211 return t.points.begin();
217 return t.points.end();
223 return t.points.end();
235 return t.points.size();
240 static constexpr bool is_container_type_v = container_traits<T>::value;
245 static_assert(meta::is_container_type_v<std::vector<Eigen::Vector3f>>);
246 static_assert(meta::is_container_type_v<std::vector<Eigen::Vector3d>>);
247 static_assert(meta::is_container_type_v<std::vector<Eigen::RowVector3cd>>);
248 static_assert(meta::is_container_type_v<pcl::PointCloud<pcl::PointXYZ>>);
250 template <
class T,
class =
void>
264 std::enable_if_t<meta::is_container_type_v<T> &&
265 meta::is_point_type_v<typename meta::container_traits<T>::element_t>>> :
268 template <
class F,
class F2>
274 sizeinfo(ctr::size(
c));
275 auto f = ctr::begin(
c);
276 auto l = ctr::end(
c);
279 auto&& p = ctr::deref(f);
280 perElem(tr::x(p), tr::y(p), tr::z(p));
288 std::enable_if_t<VisitPointLike<meta::pointer_type_pointee_t<T>>::value>> : std::true_type
290 template <
class F,
class F2>
302 template <
class F,
class F2>
306 sizeinfo(
c.size_of_vertices());
307 for (
auto v =
c.vertices_begin(); v !=
c.vertices_end(); ++v)
309 perElem(v->point().x(), v->point().y(), v->point().z());
325 std::allocator<Eigen::Matrix<float, 3, 1>>>>::value);
339 static_assert(handler::value,
"This type is not supported!");
340 handler::visit(cloud, perElem, sizeInfo);
#define _detail_unpack(r, data, elem)
#define _detail_containerlist
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
This file offers overloads of toIce() and fromIce() functions for STL container types.
void VisitPointLikeContainer(const auto &cloud, auto &&perElem, auto &&sizeInfo)
static void visit(const CGAL::Polyhedron_3< K > &c, F &sizeinfo, F2 &perElem)
static void visit(const T &c, F &sizeinfo, F2 &perElem)
static void visit(const T &c, F &sizeinfo, F2 &perElem)