6#include <unordered_map>
7#include <unordered_set>
33 static constexpr std::string_view name =
"Point";
38 static constexpr std::string_view name =
"Line";
43 static constexpr std::string_view name =
"Plane";
48 static constexpr std::string_view name =
"Circle";
53 static constexpr std::string_view name =
"Sphere";
58 static constexpr std::string_view name =
"Cylinder";
63 static constexpr std::string_view name =
"Cone";
70 return[&]<
int ...I>( std::integer_sequence<int,
I...> )
77template <
typename ...P>
80 std::shared_ptr<VisualObject> ret;
83 if ( thisKind.value == kind )
85 ret = std::make_shared<typename ObjKindTraits<thisKind.value>::type>( std::forward<P>( params )... );
90 assert( ok &&
"This object type isn't added to `ObjKindTraits`." );
95template <
typename ...P>
98 std::shared_ptr<VisualObject> ret;
103 ret = std::make_shared<
typename ObjKindTraits<thisKind.value>::type>( std::forward<P>( params )... );
108 assert( ok &&
"This object type isn't added to `ObjKindTraits`." );
117 } -> std::convertible_to<Vector3f>;
125 } -> std::convertible_to<Vector3f>;
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRCircleObject.h:17
Definition MRConeObject.h:19
Definition MRCylinderObject.h:18
An interface class which allows feature objects to share setters and getters on their main properties...
Definition MRFeatureObject.h:93
Definition MRLineObject.h:12
Definition MRPlaneObject.h:12
Definition MRPointObject.h:13
Definition MRSphereObject.h:15
Definition MRFeatureHelpers.h:121
Definition MRFeatureHelpers.h:113
Definition MRCameraOrientationPlugin.h:8
MRMESH_API std::optional< Vector3f > getFeatureDirection(FeatureObject *feature)
FeaturesObjectKind
Definition MRFeatureHelpers.h:15
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:68
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:78
I
Definition MRMesh/MRMeshFwd.h:88
std::shared_ptr< VisualObject > makeObjectFromClassName(std::string className, P &&... params)
Allocates an object of type kind, passing params... to its constructor.
Definition MRFeatureHelpers.h:96
Various information about different types of objects.
Definition MRFeatureHelpers.h:28