Ponca  aa50bfdf187919869239c5b44b748842569114c1
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 _WFunctor, typename T>
23 class DryFit : public T
24 {
25 PONCA_FITTING_DECLARE_DEFAULT_TYPES
26
27 protected:
28 enum { check = Base::PROVIDES_PRIMITIVE_BASE };
29
30 public:
31 PONCA_EXPLICIT_CAST_OPERATORS(DryFit,dryfit)
32
33 PONCA_FITTING_APIDOC_ADDNEIGHBOR
34 PONCA_MULTIARCH inline bool addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes)
35 { return Base::addLocalNeighbor(w, localQ, attributes);}
36
37 PONCA_FITTING_APIDOC_FINALIZE
38 PONCA_MULTIARCH inline FIT_RESULT finalize() { return Base::finalize(); }
39
41 PONCA_MULTIARCH inline Scalar potential ( ) const { return Scalar(0); }
42
44 PONCA_MULTIARCH inline Scalar potential (const VectorType& /*_q*/) const { return Scalar(0); }
45
47 PONCA_MULTIARCH inline VectorType project (const VectorType& _q) const { return _q; }
48
50 PONCA_MULTIARCH inline VectorType primitiveGradient () const { return VectorType::Zero(); }
51
53 PONCA_MULTIARCH inline VectorType primitiveGradient (const VectorType&) const { return VectorType::Zero(); }
54 };
55
56} //namespace Ponca
Empty fitting object doing no computation.
Definition: dryFit.h:24
FIT_RESULT finalize()
Finalize the procedure.
Definition: dryFit.h:38
typename Base::VectorType VectorType
Alias to vector type.
Definition: dryFit.h:25
Scalar potential() const
Simulate Scalar field computation.
Definition: dryFit.h:41
VectorType project(const VectorType &_q) const
Simulate point projection.
Definition: dryFit.h:47
VectorType primitiveGradient(const VectorType &) const
Simulate gradient direction computation.
Definition: dryFit.h:53
DryFit< DataPoint, _WFunctor, T > & dryfit()
Explicit conversion to DryFit , to access methods potentially hidden by heritage.
Definition: dryFit.h:31
bool addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes)
Add a neighbor to perform the fit.
Definition: dryFit.h:34
typename DataPoint::Scalar Scalar
Alias to scalar type.
Definition: dryFit.h:25
Scalar potential(const VectorType &) const
Simulate Scalar field computation.
Definition: dryFit.h:44
VectorType primitiveGradient() const
Simulate gradient direction computation.
Definition: dryFit.h:50
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