38 #ifndef PCL_COMMON_IMPL_DETAIL_ACCUMULATORS_HPP
39 #define PCL_COMMON_IMPL_DETAIL_ACCUMULATORS_HPP
43 #include <boost/mpl/filter_view.hpp>
44 #include <boost/fusion/include/mpl.hpp>
45 #include <boost/fusion/include/for_each.hpp>
46 #include <boost/fusion/include/as_vector.hpp>
76 template <
typename Po
intT>
void
79 template <
typename Po
intT>
void
82 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
99 template <
typename Po
intT>
void
102 template <
typename Po
intT>
void
105 #if EIGEN_VERSION_AT_LEAST (3, 3, 0)
106 t.getNormalVector4fMap () =
normal.normalized ();
108 if (
normal.squaredNorm() > 0)
109 t.getNormalVector4fMap () =
normal.normalized ();
111 t.getNormalVector4fMap () = Eigen::Vector4f::Zero ();
115 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
130 template <
typename Po
intT>
void
133 template <
typename Po
intT>
void
149 template <
typename Po
intT>
void
152 r +=
static_cast<float> (t.r);
153 g +=
static_cast<float> (t.g);
154 b +=
static_cast<float> (t.b);
155 a +=
static_cast<float> (t.a);
158 template <
typename Po
intT>
void
161 t.rgba =
static_cast<uint32_t
> (
a / n) << 24 |
162 static_cast<uint32_t
> (
r / n) << 16 |
163 static_cast<uint32_t
> (
g / n) << 8 |
164 static_cast<uint32_t
> (
b / n);
180 template <
typename Po
intT>
void
183 template <
typename Po
intT>
void
200 template <
typename Po
intT>
void
203 std::map<uint32_t, size_t>::iterator itr =
labels.find (t.label);
205 labels.insert (std::make_pair (t.label, 1));
210 template <
typename Po
intT>
void
214 std::map<uint32_t, size_t>::const_iterator itr;
215 for (itr =
labels.begin (); itr !=
labels.end (); ++itr)
216 if (itr->second > max)
219 t.label = itr->first;
228 template <
typename Po
int1T,
typename Po
int2T = Po
int1T>
233 template <
typename AccumulatorT,
typename Po
intT>
234 struct IsCompatible : boost::mpl::apply<typename AccumulatorT::IsCompatible, PointT> { };
239 typename boost::fusion::result_of::as_vector<
240 typename boost::mpl::filter_view<
261 template <
typename Po
intT>
269 template <
typename AccumulatorT>
void
280 template <
typename Po
intT>
289 template <
typename AccumulatorT>
void
292 accumulator.get (
p,
n);