Ponca  aa50bfdf187919869239c5b44b748842569114c1
Point Cloud Analysis library
Loading...
Searching...
No Matches
mean.hpp
1/*
2 Copyright (C) 2014 Nicolas Mellado <nmellado0@gmail.com>
3 Copyright (C) 2015 Gael Guennebaud <gael.guennebaud@inria.fr>
4
5 This Source Code Form is subject to the terms of the Mozilla Public
6 License, v. 2.0. If a copy of the MPL was not distributed with this
7 file, You can obtain one at http://mozilla.org/MPL/2.0/.
8*/
9
10template<class DataPoint, class _WFunctor, typename T>
11void
13 Base::init(_evalPos);
14 m_sumP = VectorType::Zero();
15}
16
17template<class DataPoint, class _WFunctor, typename T>
18bool
20 const VectorType &localQ,
21 const DataPoint &attributes) {
22 if( Base::addLocalNeighbor(w, localQ, attributes) ) {
23 m_sumP += w * localQ;
24 return true;
25 }
26 return false;
27}
28
29template < class DataPoint, class _WFunctor, typename T>
30void
32{
33 Base::init(_evalPos);
34 m_sumN = VectorType::Zero();
35}
36
37
38template<class DataPoint, class _WFunctor, typename T>
39bool
41 const VectorType &localQ,
42 const DataPoint &attributes) {
43 if( Base::addLocalNeighbor(w, localQ, attributes) ) {
44 m_sumN += w * attributes.normal();
45 return true;
46 }
47 return false;
48}
49
50template<class DataPoint, class _WFunctor, int DiffType, typename T>
51void
53 Base::init(_evalPos);
54 m_dSumP.setZero();
55}
56
57
58template<class DataPoint, class _WFunctor, int DiffType, typename T>
59bool
61 const VectorType &localQ,
62 const DataPoint &attributes,
63 ScalarArray &dw) {
64 if (Base::addLocalNeighbor(w, localQ, attributes, dw)) {
65 m_dSumP += localQ * dw;
66 return true;
67 }
68
69 return false;
70}
71
72
73template<class DataPoint, class _WFunctor, int DiffType, typename T>
74void
76 Base::init(_evalPos);
77 m_dSumN.setZero();
78}
79
80template<class DataPoint, class _WFunctor, int DiffType, typename T>
81bool
83 const VectorType &localQ,
84 const DataPoint &attributes,
85 ScalarArray &dw) {
86 if (Base::addLocalNeighbor(w, localQ, attributes, dw)) {
87 m_dSumN += attributes.normal() * dw;
88 return true;
89 }
90
91 return false;
92}
typename Base::ScalarArray ScalarArray
Alias to scalar derivatives array.
Definition: mean.h:151
typename Base::VectorType VectorType
Alias to vector type.
Definition: mean.h:150
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition: mean.h:150
Compute the barycenter of the input points + their normals.
Definition: mean.h:79
typename Base::VectorType VectorType
Alias to vector type.
Definition: mean.h:80
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition: mean.h:80
typename Base::ScalarArray ScalarArray
Alias to scalar derivatives array.
Definition: mean.h:104
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition: mean.h:103
typename Base::VectorType VectorType
Alias to vector type.
Definition: mean.h:103
Compute the barycenter of the input points.
Definition: mean.h:24
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition: mean.h:25
typename Base::VectorType VectorType
Alias to vector type.
Definition: mean.h:25