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, typename
boost::enable_if<boost::is_same<PointInT, PointOutT> >::type>
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 typename
boost::enable_if<boost::mpl::and_<boost::mpl::not_<boost::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> > > > >::type>
98 void operator () (
const PointInT& point_in, PointOutT& point_out)
const 107 template <
typename Po
intInT,
typename Po
intOutT>
109 typename
boost::enable_if<boost::mpl::and_<boost::mpl::not_<boost::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> > > > >::type>
115 void operator () (
const PointInT& point_in, PointOutT& point_out)
const 120 const uint32_t offset_in = boost::mpl::if_<pcl::traits::has_field<PointInT, pcl::fields::rgb>,
123 const 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_
This file defines compatibility wrappers for low level I/O functions.
Defines all the PCL implemented PointT point type structures.
boost::mpl::remove_if< Sequence1, boost::mpl::not_< boost::mpl::contains< Sequence2, boost::mpl::_1 > > >::type type
Helper functor structure for concatenate.
void copyPoint(const PointInT &point_in, PointOutT &point_out)
Copy the fields of a source point into a target point.