6#if MR_COMPILING_C_BINDINGS
10#include <unordered_map>
11#include <unordered_set>
37 static constexpr std::string_view name =
"Point";
42 static constexpr std::string_view name =
"Line";
47 static constexpr std::string_view name =
"Plane";
52 static constexpr std::string_view name =
"Circle";
57 static constexpr std::string_view name =
"Sphere";
62 static constexpr std::string_view name =
"Cylinder";
67 static constexpr std::string_view name =
"Cone";
74 return[&]<
int ...I>( std::integer_sequence<int, I...> )
76 return ( func( std::integral_constant<FeaturesObjectKind, FeaturesObjectKind( I )>{} ) || ... );
77 }( std::make_integer_sequence<int, int( FeaturesObjectKind::_count )>{} );
81template <
typename ...P>
82[[nodiscard]] std::shared_ptr<VisualObject>
makeObjectFromEnum( FeaturesObjectKind kind, P&&... params )
84 std::shared_ptr<VisualObject> ret;
87 if ( thisKind.value == kind )
89 ret = std::make_shared<typename ObjKindTraits<thisKind.value>::type>( std::forward<P>( params )... );
94 assert( ok &&
"This object type isn't added to `ObjKindTraits`." );
99template <
typename ...P>
102 std::shared_ptr<VisualObject> ret;
107 ret = std::make_shared<
typename ObjKindTraits<thisKind.value>::type>( std::forward<P>( params )... );
112 assert( ok &&
"This object type isn't added to `ObjKindTraits`." );
121 } -> std::convertible_to<Vector3f>;
129 } -> std::convertible_to<Vector3f>;
_count
Definition MRFeatureObject.h:87
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRCircleObject.h:17
Definition MRConeObject.h:19
Definition MRCylinderObject.h:18
Definition MRFeatureObject.h:93
Definition MRLineObject.h:13
Definition MRPlaneObject.h:12
Definition MRPointObject.h:14
Definition MRSphereObject.h:15
Definition MRFeatureHelpers.h:125
Definition MRFeatureHelpers.h:117
MRVIEWER_API void Plane(MR::PlaneWidget &planeWidget, PlaneWidgetFlags flags={})
Definition MRCameraOrientationPlugin.h:8
MRMESH_API std::optional< Vector3f > getFeatureDirection(FeatureObject *feature)
MRMESH_API std::optional< Vector3f > getFeatureNormal(FeatureObject *feature)
MRMESH_API std::unordered_set< std::string > getFeaturesTypeWithDirections()
bool forEachObjectKind(F &&func)
Calls func, which is ( auto kind ) -> bool, for each known object kind. If it returns true,...
Definition MRFeatureHelpers.h:72
MRMESH_API std::unordered_set< std::string > getFeaturesTypeWithNormals()
std::shared_ptr< VisualObject > makeObjectFromEnum(FeaturesObjectKind kind, P &&... params)
Allocates an object of type kind, passing params... to its constructor.
Definition MRFeatureHelpers.h:82
std::shared_ptr< VisualObject > makeObjectFromClassName(std::string className, P &&... params)
Allocates an object of type kind, passing params... to its constructor.
Definition MRFeatureHelpers.h:100
Various information about different types of objects.
Definition MRFeatureHelpers.h:32