Ponca  aa50bfdf187919869239c5b44b748842569114c1
Point Cloud Analysis library
Loading...
Searching...
No Matches
defines.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
8#pragma once
9
18#include "../Common/defines.h"
19
20#define PONCA_EXPLICIT_CAST_OPERATORS(CLASSNAME,CONVERTER) \
21 \
22PONCA_MULTIARCH inline \
23CLASSNAME<DataPoint, _WFunctor, T>& CONVERTER() \
24{ return * static_cast<CLASSNAME<DataPoint, _WFunctor, T>*>(this); } \
25 \
26PONCA_MULTIARCH inline \
27const CLASSNAME<DataPoint, _WFunctor, T>& CONVERTER() const \
28{ return * static_cast<const CLASSNAME<DataPoint, _WFunctor, T>*>(this); }
29
30// CAST OPERATORS
31
32#define PONCA_EXPLICIT_CAST_OPERATORS_DER(CLASSNAME,CONVERTER) \
33 \
34PONCA_MULTIARCH inline \
35CLASSNAME<DataPoint, _WFunctor, DiffType, T>& CONVERTER() \
36{ return * static_cast<CLASSNAME<DataPoint, _WFunctor, DiffType, T>*>(this); } \
37 \
38PONCA_MULTIARCH inline \
39const CLASSNAME<DataPoint, _WFunctor, DiffType, T>& CONVERTER() const \
40{ return * static_cast<const CLASSNAME<DataPoint, _WFunctor, DiffType, T>*>(this); }
41
42
43// FIT DEFAULT TYPES
44
46#define PONCA_FITTING_DECLARE_DEFAULT_TYPES \
47protected: \
48using Base = T; \
49public: \
50using Scalar = typename DataPoint::Scalar; \
51using VectorType = typename Base::VectorType; \
52using WFunctor = typename Base::WFunctor;
55#define PONCA_FITTING_DECLARE_MATRIX_TYPE \
56public: \
57using MatrixType = typename DataPoint::MatrixType; \
58
60#define PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES \
61public: \
62using ScalarArray = typename Base::ScalarArray; \
63using VectorArray = typename Base::VectorArray;
65// FIT API DOCUMENTATION
66#define PONCA_FITTING_APIDOC_SETWFUNC \
67
68#define PONCA_FITTING_APIDOC_INIT \
69
70#define PONCA_FITTING_APIDOC_ADDNEIGHBOR \
71
72#define PONCA_FITTING_APIDOC_ADDNEIGHBOR_DER \
73
74#define PONCA_FITTING_APIDOC_FINALIZE \
75
77// FIT API DECLARATION
78
80#define PONCA_FITTING_IS_SIGNED(IS_SIGNED) \
81 \
82PONCA_MULTIARCH inline \
83constexpr bool isSigned() { return IS_SIGNED; }
84
86#define PONCA_FITTING_DECLARE_INIT \
87PONCA_FITTING_APIDOC_INIT \
88PONCA_MULTIARCH inline void init (const VectorType& _evalPos);
89
91#define PONCA_FITTING_DECLARE_ADDNEIGHBOR \
92PONCA_FITTING_APIDOC_ADDNEIGHBOR \
93PONCA_MULTIARCH inline bool addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes);
94
96#define PONCA_FITTING_DECLARE_ADDNEIGHBOR_DER \
97PONCA_FITTING_APIDOC_ADDNEIGHBOR_DER \
98PONCA_MULTIARCH inline bool \
99addLocalNeighbor(Scalar w, const VectorType &localQ, const DataPoint &attributes, ScalarArray &dw);
100
102#define PONCA_FITTING_DECLARE_FINALIZE \
103PONCA_FITTING_APIDOC_FINALIZE \
104PONCA_MULTIARCH inline FIT_RESULT finalize();
105
106#define PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE \
107PONCA_FITTING_DECLARE_INIT \
108PONCA_FITTING_DECLARE_ADDNEIGHBOR \
109PONCA_FITTING_DECLARE_FINALIZE
110
111#define PONCA_FITTING_DECLARE_INIT_ADDDER_FINALIZE \
112PONCA_FITTING_DECLARE_INIT \
113PONCA_FITTING_DECLARE_ADDNEIGHBOR_DER \
114PONCA_FITTING_DECLARE_FINALIZE