Ponca  eb7239a9c07e156fb1edc6faac7fe89e2b256bda
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>>,
80 FactoryEntry<"MeanPosition" , Basket<P, NF, MeanPosition>>,
81 FactoryEntry<"MeanNormal" , Basket<P, NF, MeanPosition>>,
82 FactoryEntry<"CovarianceLineFit" , Basket<P, NF, CovarianceLineFit>>,
83 FactoryEntry<"CovariancePlaneFit", Basket<P, NF, CovariancePlaneFit>>,
84 FactoryEntry<"SphereFit" , Basket<P, NF, SphereFit>>,
85 FactoryEntry<"MeanPlaneFit" , Basket<P, NF, MeanPlaneFit>>,
87#ifndef __CUDACC__
89#endif
90 >;
91
92 template<typename P, typename NF, int DerType>
93 using Factory3DList = internal::Factory::tuple_cat_t<
94 FactoryGenericList<P, NF, DerType>,
95 std::tuple<
97 FactoryEntry<"MongePatchRestrictedQuadratic", Basket<P, NF, MongePatchRestrictedQuadraticFit>>,
102 >
103 >;
104
105 template<typename P, typename NF, int DerType>
106 using Factory3DSpaceDerivatives = internal::Factory::tuple_cat_t<
107 Factory3DList<P, NF, DerType>,
108 std::tuple<
112 >
113 >;
114 // clang-format on
115} // 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
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...
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
Implicit hyperplane defined by an homogeneous vector .
Definition plane.h:39
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
CovariancePlaneFitImpl< DataPoint, _NFilter, CovarianceBase< DataPoint, _NFilter, MeanPosition< DataPoint, _NFilter, Plane< DataPoint, _NFilter, T > > > > CovariancePlaneFit
Helper alias for Plane fitting on 3D points using CovariancePlaneFitImpl [CovariancePlaneFit Definiti...
OrientedSphereFitImpl< DataPoint, _NFilter, MeanPosition< DataPoint, _NFilter, MeanNormal< DataPoint, _NFilter, AlgebraicSphere< DataPoint, _NFilter, T > > > > OrientedSphereFit
Helper alias for Oriented Sphere fitting on 3D points using OrientedSphereFitImpl [OrientedSphereFit ...
CovarianceLineFitImpl< DataPoint, _NFilter, CovarianceBase< DataPoint, _NFilter, MeanPosition< DataPoint, _NFilter, Line< DataPoint, _NFilter, T > > > > CovarianceLineFit
Helper alias for Line fitting on 3D points using CovarianceLineFitImpl.
SphereFitImpl< DataPoint, _NFilter, AlgebraicSphere< DataPoint, _NFilter, T > > SphereFit
Helper alias for Sphere fitting on 3D points using SphereFitImpl.
Definition sphereFit.h:89
OrientedSphereDerImpl< DataPoint, _NFilter, DiffType, MeanPositionDer< DataPoint, _NFilter, DiffType, T > > OrientedSphereDer
Helper alias for Oriented Sphere fitting on 3D points using OrientedSphereDerImpl.
MeanPlaneFitImpl< DataPoint, _NFilter, MeanNormal< DataPoint, _NFilter, MeanPosition< DataPoint, _NFilter, Plane< DataPoint, _NFilter, T > > > > MeanPlaneFit
Helper alias for Plane fitting on points using MeanPlaneFitImpl [MeanPlaneFit Definition].
Factory entry.
Definition typelist.h:29
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