6#if MR_COMPILING_C_BINDINGS
10#include <unordered_map>
11#include <unordered_set>
40 static constexpr std::string_view
name =
"Point";
45 static constexpr std::string_view
name =
"Line";
50 static constexpr std::string_view
name =
"Plane";
55 static constexpr std::string_view
name =
"Circle";
60 static constexpr std::string_view
name =
"Sphere";
65 static constexpr std::string_view
name =
"Cylinder";
70 static constexpr std::string_view
name =
"Cone";
77 return[&]<
int ...I>( std::integer_sequence<int,
I...> )
84template <
typename ...P>
87 std::shared_ptr<VisualObject> ret;
90 if ( thisKind.value == kind )
92 ret = std::make_shared<
typename ObjKindTraits<thisKind.value>::type>( std::forward<P>( params )... );
97 assert( ok &&
"This object type isn't added to `ObjKindTraits`." );
102template <
typename ...P>
105 std::shared_ptr<VisualObject> ret;
110 ret = std::make_shared<
typename ObjKindTraits<thisKind.value>::type>( std::forward<P>( params )... );
115 assert( ok &&
"This object type isn't added to `ObjKindTraits`." );
124 } -> std::convertible_to<Vector3f>;
132 } -> std::convertible_to<Vector3f>;
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRCircleObject.h:17
Definition MRConeObject.h:22
Definition MRCylinderObject.h:21
An interface class which allows feature objects to share setters and getters on their main properties...
Definition MRFeatureObject.h:96
Definition MRLineObject.h:16
Definition MRPlaneObject.h:15
Definition MRPointObject.h:17
Definition MRSphereObject.h:18
Definition MRFeatureHelpers.h:128
Definition MRFeatureHelpers.h:120
static constexpr std::string_view name
Definition MRFeatureHelpers.h:55
static constexpr std::string_view name
Definition MRFeatureHelpers.h:45
FeaturesObjectKind
Definition MRFeatureHelpers.h:22
static constexpr std::string_view name
Definition MRFeatureHelpers.h:40
std::optional< Vector3f > getFeatureNormal(FeatureObject *feature)
Using forEachObjectKind the template collects a list of features for which the method ....
bool forEachObjectKind(F &&func)
Calls func, which is ( auto kind ) -> bool, for each known object kind. If it returns true,...
Definition MRFeatureHelpers.h:75
static constexpr std::string_view name
Definition MRFeatureHelpers.h:65
std::optional< Vector3f > getFeatureDirection(FeatureObject *feature)
Using forEachObjectKind the template collects a list of features for which the method ....
static constexpr std::string_view name
Definition MRFeatureHelpers.h:60
std::unordered_set< std::string > getFeaturesTypeWithDirections()
Try to getDirection from specific feature using forEachObjectKind template. Returns nullopt is ....
PlaneObject type
Definition MRFeatureHelpers.h:49
ConeObject type
Definition MRFeatureHelpers.h:69
PointObject type
Definition MRFeatureHelpers.h:39
class MRMESH_CLASS I
Definition MRMeshFwd.h:137
CircleObject type
Definition MRFeatureHelpers.h:54
std::unordered_set< std::string > getFeaturesTypeWithNormals()
Try to getNormal from specific feature using forEachObjectKind template. Returns nullopt is ....
std::shared_ptr< VisualObject > makeObjectFromEnum(FeaturesObjectKind kind, P &&... params)
Allocates an object of type kind, passing params... to its constructor.
Definition MRFeatureHelpers.h:85
static constexpr std::string_view name
Definition MRFeatureHelpers.h:70
CylinderObject type
Definition MRFeatureHelpers.h:64
LineObject type
Definition MRFeatureHelpers.h:44
static constexpr std::string_view name
Definition MRFeatureHelpers.h:50
std::shared_ptr< VisualObject > makeObjectFromClassName(std::string className, P &&... params)
Allocates an object of type kind, passing params... to its constructor.
Definition MRFeatureHelpers.h:103
SphereObject type
Definition MRFeatureHelpers.h:59
@ Plane
Definition MRFeatureHelpers.h:25
@ Point
Definition MRFeatureHelpers.h:23
@ Cylinder
Definition MRFeatureHelpers.h:28
@ Circle
Definition MRFeatureHelpers.h:26
@ Cone
Definition MRFeatureHelpers.h:29
@ _count
Definition MRFeatureHelpers.h:30
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Various information about different types of objects.
Definition MRFeatureHelpers.h:35