Ponca  4a9354998d048bf882a3ee9bac8105216fa08d13
Point Cloud Analysis library
Loading...
Searching...
No Matches
utils.h
1/*
2 This Source Code Form is subject to the terms of the Mozilla Public
3 License, v. 2.0. If a copy of the MPL was not distributed with this
4 file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8#include <iostream>
9
10namespace Ponca
11{
27 template <class DataPoint, class _NFilter, typename T>
28 class MultipassStatus : public T
29 {
30 PONCA_FITTING_DECLARE_DEFAULT_TYPES
31 public:
32 MultipassStatus() : m_ready(false) {}
33
34 PONCA_MULTIARCH inline void init()
35 {
36 Base::init();
37 m_ready = false;
38 }
39
40 PONCA_MULTIARCH inline FIT_RESULT finalize()
41 {
42 FIT_RESULT res = Base::finalize();
43 m_ready = (res == STABLE);
44 res = (res == STABLE) ? NEED_OTHER_PASS : res;
45
46 return Base::m_eCurrentState = res;
47 }
48
49 PONCA_MULTIARCH inline bool ready() const { return m_ready; }
50
51 protected:
52 bool m_ready;
53 };
54} // namespace Ponca
Aggregator class used to declare specialized structures using CRTP.
Definition basket.h:294
Helper class to check for status of required extensions.
Definition utils.h:29
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition concepts.h:11
FIT_RESULT
Enum corresponding to the state of a fitting method (and what the finalize function returns)
Definition enums.h:15
@ NEED_OTHER_PASS
The fitting procedure needs to analyse the neighborhood another time.
Definition enums.h:25
@ STABLE
The fitting is stable and ready to use.
Definition enums.h:17