40 #include <pcl/field_traits.h>
41 #include <pcl/type_traits.h>
42 #include <pcl/for_each_type.h>
43 #include <pcl/common/concatenate.h>
44 #include <pcl/common/copy_point.h>
78 template <
typename Po
intInT,
typename Po
intOutT,
typename Enable =
void>
81 template <
typename Po
intInT,
typename Po
intOutT>
82 struct CopyPointHelper<PointInT, PointOutT, std::enable_if_t<std::is_same<PointInT, PointOutT>::value>>
84 void operator () (
const PointInT& point_in, PointOutT& point_out)
const
86 memcpy (&point_out, &point_in,
sizeof (PointInT));
90 template <
typename Po
intInT,
typename Po
intOutT>
92 std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>,
93 boost::mpl::or_<boost::mpl::not_<pcl::traits::has_color<PointInT>>,
94 boost::mpl::not_<pcl::traits::has_color<PointOutT>>,
95 boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
96 pcl::traits::has_field<PointOutT, pcl::fields::rgb>>,
97 boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgba>,
98 pcl::traits::has_field<PointOutT, pcl::fields::rgba>>>>::value>>
100 void operator () (
const PointInT& point_in, PointOutT& point_out)
const
102 using FieldListInT =
typename pcl::traits::fieldList<PointInT>::type;
103 using FieldListOutT =
typename pcl::traits::fieldList<PointOutT>::type;
109 template <
typename Po
intInT,
typename Po
intOutT>
111 std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>,
112 boost::mpl::or_<boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
113 pcl::traits::has_field<PointOutT, pcl::fields::rgba>>,
114 boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgba>,
115 pcl::traits::has_field<PointOutT, pcl::fields::rgb>>>>::value>>
117 void operator () (
const PointInT& point_in, PointOutT& point_out)
const
119 using FieldListInT =
typename pcl::traits::fieldList<PointInT>::type;
120 using FieldListOutT =
typename pcl::traits::fieldList<PointOutT>::type;
122 constexpr std::uint32_t offset_in = boost::mpl::if_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
123 pcl::traits::offset<PointInT, pcl::fields::rgb>,
124 pcl::traits::offset<PointInT, pcl::fields::rgba> >::type::value;
125 constexpr std::uint32_t offset_out = boost::mpl::if_<pcl::traits::has_field<PointOutT, pcl::fields::rgb>,
126 pcl::traits::offset<PointOutT, pcl::fields::rgb>,
127 pcl::traits::offset<PointOutT, pcl::fields::rgba> >::type::value;
129 memcpy (
reinterpret_cast<char*
> (&point_out) + offset_out,
130 reinterpret_cast<const char*
> (&point_in) + offset_in,
137 template <
typename Po
intInT,
typename Po
intOutT>
void
138 copyPoint (
const PointInT& point_in, PointOutT& point_out)
141 copy (point_in, point_out);
void copyPoint(const PointInT &point_in, PointOutT &point_out)
Copy the fields of a source point into a target point.
Helper functor structure for concatenate.
typename boost::mpl::remove_if< Sequence1, boost::mpl::not_< boost::mpl::contains< Sequence2, boost::mpl::_1 > > >::type type