Ponca  bab7704293a2c36e5bed9dea40def7ba839bfe08
Point Cloud Analysis library
Loading...
Searching...
No Matches
dryFit.h
1/*
2 Copyright (C) 2021 Nicolas Mellado <nmellado0@gmail.com>
3
4 This Source Code Form is subject to the terms of the Mozilla Public
5 License, v. 2.0. If a copy of the MPL was not distributed with this
6 file, You can obtain one at http://mozilla.org/MPL/2.0/.
7*/
8
9#pragma once
10#include "./defines.h"
11#include "./primitive.h"
12
13#include <Eigen/Dense>
14
15namespace Ponca
16{
17
22 template <class DataPoint, class _NFilter, typename T>
23 class DryFit : public T
24 {
25 PONCA_FITTING_DECLARE_DEFAULT_TYPES
26
27 protected:
28 enum
29 {
30 check = Base::PROVIDES_PRIMITIVE_BASE
31 };
32
33 public:
34 PONCA_EXPLICIT_CAST_OPERATORS(DryFit, dryfit)
35
36 PONCA_FITTING_APIDOC_ADDNEIGHBOR
37 PONCA_MULTIARCH inline void addLocalNeighbor(Scalar w, const VectorType& localQ, const DataPoint& attributes)
38 {
39 Base::addLocalNeighbor(w, localQ, attributes);
40 }
41
42 PONCA_FITTING_APIDOC_FINALIZE
43 PONCA_MULTIARCH [[nodiscard]] inline FIT_RESULT finalize() { return Base::finalize(); }
44
46 PONCA_MULTIARCH [[nodiscard]] inline Scalar potential() const { return Scalar(0); }
47
49 PONCA_MULTIARCH [[nodiscard]] inline Scalar potential(const VectorType& /*_q*/) const { return Scalar(0); }
50
52 PONCA_MULTIARCH [[nodiscard]] inline VectorType project(const VectorType& _q) const { return _q; }
53
55 PONCA_MULTIARCH [[nodiscard]] inline VectorType primitiveGradient() const { return VectorType::Zero(); }
56
58 PONCA_MULTIARCH [[nodiscard]] inline VectorType primitiveGradient(const VectorType&) const
59 {
60 return VectorType::Zero();
61 }
62
63 protected:
65 PONCA_MULTIARCH [[nodiscard]] inline Scalar potentialLocal(const VectorType& /*_lq*/) const
66 {
67 return Scalar(0);
68 }
70 PONCA_MULTIARCH [[nodiscard]] inline VectorType primitiveGradientLocal(const VectorType& /*_lq*/) const
71 {
72 return VectorType::Zero();
73 }
74 };
75
76} // namespace Ponca
Empty fitting object doing no computation.
Definition dryFit.h:24
typename Base::VectorType VectorType
Alias to vector type.
Definition dryFit.h:25
VectorType project(const VectorType &_q) const
Simulate point projection.
Definition dryFit.h:52
FIT_RESULT finalize()
Finalize the procedure.
Definition dryFit.h:43
Scalar potential() const
Simulate Scalar field computation.
Definition dryFit.h:46
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition dryFit.h:25
Scalar potential(const VectorType &) const
Simulate Scalar field computation.
Definition dryFit.h:49
VectorType primitiveGradient() const
Simulate gradient direction computation.
Definition dryFit.h:55
VectorType primitiveGradient(const VectorType &) const
Simulate gradient direction computation.
Definition dryFit.h:58
DryFit< DataPoint, _NFilter, T > & dryfit()
Explicit conversion to DryFit , to access methods potentially hidden by heritage.
Definition dryFit.h:34
void addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes)
Add a neighbor to perform the fit.
Definition dryFit.h:37
Scalar potentialLocal(const VectorType &) const
Simulate Scalar field computation.
Definition dryFit.h:65
VectorType primitiveGradientLocal(const VectorType &) const
Simulate gradient direction computation.
Definition dryFit.h:70
This Source Code Form is subject to the terms of the Mozilla Public License, v.
FIT_RESULT
Enum corresponding to the state of a fitting method (and what the finalize function returns)
Definition enums.h:15