38 #ifndef PCL_COMMON_IMPL_COPY_POINT_HPP_
39 #define PCL_COMMON_IMPL_COPY_POINT_HPP_
42 #include <pcl/point_traits.h>
43 #include <pcl/for_each_type.h>
44 #include <pcl/common/concatenate.h>
76 template <
typename Po
intInT,
typename Po
intOutT,
typename Enable =
void>
79 template <
typename Po
intInT,
typename Po
intOutT>
80 struct CopyPointHelper<PointInT, PointOutT, std::enable_if_t<std::is_same<PointInT, PointOutT>::value>>
82 void operator () (
const PointInT& point_in, PointOutT& point_out)
const
84 memcpy (&point_out, &point_in,
sizeof (PointInT));
88 template <
typename Po
intInT,
typename Po
intOutT>
90 std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>,
91 boost::mpl::or_<boost::mpl::not_<pcl::traits::has_color<PointInT>>,
92 boost::mpl::not_<pcl::traits::has_color<PointOutT>>,
93 boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
94 pcl::traits::has_field<PointOutT, pcl::fields::rgb>>,
95 boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgba>,
96 pcl::traits::has_field<PointOutT, pcl::fields::rgba>>>>::value>>
98 void operator () (
const PointInT& point_in, PointOutT& point_out)
const
107 template <
typename Po
intInT,
typename Po
intOutT>
109 std::enable_if_t<boost::mpl::and_<boost::mpl::not_<std::is_same<PointInT, PointOutT>>,
110 boost::mpl::or_<boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
111 pcl::traits::has_field<PointOutT, pcl::fields::rgba>>,
112 boost::mpl::and_<pcl::traits::has_field<PointInT, pcl::fields::rgba>,
113 pcl::traits::has_field<PointOutT, pcl::fields::rgb>>>>::value>>
115 void operator () (
const PointInT& point_in, PointOutT& point_out)
const
120 const std::uint32_t offset_in = boost::mpl::if_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
123 const std::uint32_t offset_out = boost::mpl::if_<pcl::traits::has_field<PointOutT, pcl::fields::rgb>,
127 memcpy (
reinterpret_cast<char*
> (&point_out) + offset_out,
128 reinterpret_cast<const char*
> (&point_in) + offset_in,
137 template <
typename Po
intInT,
typename Po
intOutT>
void
141 copy (point_in, point_out);
144 #endif //PCL_COMMON_IMPL_COPY_POINT_HPP_