Ponca  fd5150bf9079aabdb82a6f05e419b76111c1f788
Point Cloud Analysis library
Loading...
Searching...
No Matches
factorylist.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#pragma once
7
8#include "../../../Fitting"
9#include "typelist.h"
10
11namespace Ponca
12{
13
14// List of concept that can be filtered by the factory
15// We can not template on concept. Here, we trick this
16// by creating a class that extract the boolean from the
17// given concept. We also create a not counterpart
18#define DECLARE_FACTORY_CONCEPT_FULL(_conceptname, _newname, _notnewname) \
19 template <typename T> \
20 struct _newname : std::bool_constant<_conceptname<typename T::type>> \
21 { \
22 }; \
23 template <typename T> \
24 struct _notnewname : std::bool_constant<!_conceptname<typename T::type>> \
25 { \
26 };
27
28#define DECLARE_FACTORY_CONCEPT(_name) \
29 DECLARE_FACTORY_CONCEPT_FULL(Provides##_name, _name##Provider, Not##_name##Provider)
30
40 template <StringLiteral Name>
42 {
43 template <typename T>
44 static constexpr bool value = strequal(Name.value, T::name);
45
52 template <typename T>
53 struct pred : std::bool_constant<strequal(Name.value, T::name)>
54 {
55 };
56 };
57
58 DECLARE_FACTORY_CONCEPT(Derivatives)
59 DECLARE_FACTORY_CONCEPT(ProjectionOperator)
60 DECLARE_FACTORY_CONCEPT(ImplicitPrimitive)
61 DECLARE_FACTORY_CONCEPT(AlgebraicSphere)
62 DECLARE_FACTORY_CONCEPT(MeanPosition)
63 DECLARE_FACTORY_CONCEPT(MeanNormal)
64 DECLARE_FACTORY_CONCEPT(GLSParam)
65 DECLARE_FACTORY_CONCEPT(GeomVar)
66 DECLARE_FACTORY_CONCEPT(Plane)
67 DECLARE_FACTORY_CONCEPT(Line)
68 DECLARE_FACTORY_CONCEPT(HeightField)
69 DECLARE_FACTORY_CONCEPT(MongePatch)
70 DECLARE_FACTORY_CONCEPT(PositionCovariance)
71 DECLARE_FACTORY_CONCEPT(PrincipalCurvatures)
72 DECLARE_FACTORY_CONCEPT(TangentPlaneBasis)
73 DECLARE_FACTORY_CONCEPT(MeanCurvature)
74
75 // We disable format here in order to better align lists items
76 // clang-format off
77 template<typename P, typename NF, int DerType>
78 using FactoryGenericList = std::tuple<
79 FactoryEntry<"DryFit" , Basket<P, NF, DryFit>>,
87 FactoryEntry<"Unoriented APSS" , Basket<P, NF, UnorientedSphereFit, GLSParam>>
88 >;
89
90 template<typename P, typename NF, int DerType>
91 using Factory3DList = internal::Factory::tuple_cat_t<
92 FactoryGenericList<P, NF, DerType>,
93 std::tuple<
94 FactoryEntry<"MongePatchQuadratic" , Basket<P, NF, MongePatchQuadraticFit>>,
95 FactoryEntry<"MongePatchRestrictedQuadratic", Basket<P, NF, MongePatchRestrictedQuadraticFit>>,
96 FactoryEntry<"CNCUniform" , CNC<P, Ponca::TriangleGenerationMethod::UniformGeneration>>,
97 FactoryEntry<"CNCIndependent" , CNC<P, Ponca::TriangleGenerationMethod::IndependentGeneration>>,
98 FactoryEntry<"CNCHexagram" , CNC<P, Ponca::TriangleGenerationMethod::HexagramGeneration>>,
99 FactoryEntry<"CNCAvgHexagram" , CNC<P, Ponca::TriangleGenerationMethod::AvgHexagramGeneration>>
100 >
101 >;
102
103 template<typename P, typename NF, int DerType>
104 using Factory3DSpaceDerivatives = internal::Factory::tuple_cat_t<
105 Factory3DList<P, NF, DerType>,
106 std::tuple<
110 >
111 >;
112 // clang-format on
113} // namespace Ponca
Compute the mean normal of the input points.
Definition mean.h:84
Algebraic Sphere primitive.
Aggregator class used to declare specialized structures with derivatives computations,...
Definition basket.h:230
Aggregator class used to declare specialized structures using CRTP.
Definition basket.h:294
Corrected Normal Current Fit type.
Definition cnc.h:112
Line fitting procedure that minimize the orthogonal distance between the samples and the fitted primi...
Plane fitting procedure using only points position.
Empty fitting object doing no computation.
Definition dryFit.h:27
Growing Least Squares reparametrization of the OrientedSphereFit.
Definition gls.h:51
Internal base classe for height fields.
Definition heightField.h:30
A parametrized line is defined by an origin point and a unit direction vector such that the line co...
Plane fitting procedure computing the mean position and orientation from oriented points.
Compute the barycenter of the input points.
Definition mean.h:29
Extension performing derivation of the mls surface.
Monge Patch primitive, defined as , with defined by a Base class.
Definition mongePatch.h:43
Compute a Weingarten map from the spatial derivatives of the normal field .
Definition weingarten.h:111
[OrientedSphereFit Definition]
Algebraic Sphere fitting procedure on oriented point sets.
Implicit hyperplane defined by an homogeneous vector .
Definition plane.h:39
Algebraic Sphere fitting procedure on point set without normals.
Definition sphereFit.h:63
Algebraic Sphere fitting procedure on point sets with non-oriented normals.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition concepts.h:11
constexpr bool strequal(const char *a, const char *b)
Constexpr version of string comparison.
Definition typeutils.h:32
TriangleGenerationMethod
\breif Generation method of the triangles for the Corrected Normal Current formula
Definition cnc.h:93
Factory entry.
Definition typelist.h:29
Default factory templated on Point, Filter and Derivative.
Definition factory.h:218
A type that behaves as value.
Definition factorylist.h:54
Class to check for if an entry has a corresponding Id.
Definition factorylist.h:42
Compute principal curvatures from a base class providing fundamental forms.
Definition weingarten.h:224
Compute principal curvatures from a base class providing fundamental forms.
Definition weingarten.h:215