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>
77 template <
typename Po
intInT,
typename Po
intOutT,
typename Enable =
void>
80 template <
typename Po
intInT,
typename Po
intOutT>
81 struct CopyPointHelper<PointInT, PointOutT, std::enable_if_t<std::is_same<PointInT, PointOutT>::value>>
83 void operator () (
const PointInT& point_in, PointOutT& point_out)
const
85 memcpy (&point_out, &point_in,
sizeof (PointInT));
89 template <
typename Po
intInT,
typename Po
intOutT>
91 std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>,
92 boost::mpl::or_<boost::mpl::not_<pcl::traits::has_color<PointInT>>,
93 boost::mpl::not_<pcl::traits::has_color<PointOutT>>,
94 boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
95 pcl::traits::has_field<PointOutT, pcl::fields::rgb>>,
96 boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgba>,
97 pcl::traits::has_field<PointOutT, pcl::fields::rgba>>>>::value>>
99 void operator () (
const PointInT& point_in, PointOutT& point_out)
const
101 using FieldListInT =
typename pcl::traits::fieldList<PointInT>::type;
102 using FieldListOutT =
typename pcl::traits::fieldList<PointOutT>::type;
108 template <
typename Po
intInT,
typename Po
intOutT>
110 std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>,
111 boost::mpl::or_<boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
112 pcl::traits::has_field<PointOutT, pcl::fields::rgba>>,
113 boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgba>,
114 pcl::traits::has_field<PointOutT, pcl::fields::rgb>>>>::value>>
116 void operator () (
const PointInT& point_in, PointOutT& point_out)
const
118 using FieldListInT =
typename pcl::traits::fieldList<PointInT>::type;
119 using FieldListOutT =
typename pcl::traits::fieldList<PointOutT>::type;
121 constexpr std::uint32_t offset_in = boost::mpl::if_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
122 pcl::traits::offset<PointInT, pcl::fields::rgb>,
123 pcl::traits::offset<PointInT, pcl::fields::rgba> >::type::value;
124 constexpr std::uint32_t offset_out = boost::mpl::if_<pcl::traits::has_field<PointOutT, pcl::fields::rgb>,
125 pcl::traits::offset<PointOutT, pcl::fields::rgb>,
126 pcl::traits::offset<PointOutT, pcl::fields::rgba> >::type::value;
128 memcpy (
reinterpret_cast<char*
> (&point_out) + offset_out,
129 reinterpret_cast<const char*
> (&point_in) + offset_in,
136 template <
typename Po
intInT,
typename Po
intOutT>
void
137 copyPoint (
const PointInT& point_in, PointOutT& point_out)
140 copy (point_in, point_out);
Defines all the PCL implemented PointT point type structures.
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