MeshLib C++ Docs
Loading...
Searching...
No Matches
MRFeatureHelpers.h File Reference
#include "MRMeshFwd.h"
#include "MRFeatureObject.h"
#include <unordered_map>
#include <unordered_set>

Go to the source code of this file.

Classes

struct  MR::ObjKindTraits< X >
 Various information about different types of objects. More...
 
struct  MR::ObjKindTraits< FeaturesObjectKind::Point >
 
struct  MR::ObjKindTraits< FeaturesObjectKind::Line >
 
struct  MR::ObjKindTraits< FeaturesObjectKind::Plane >
 
struct  MR::ObjKindTraits< FeaturesObjectKind::Circle >
 
struct  MR::ObjKindTraits< FeaturesObjectKind::Sphere >
 
struct  MR::ObjKindTraits< FeaturesObjectKind::Cylinder >
 
struct  MR::ObjKindTraits< FeaturesObjectKind::Cone >
 

Namespaces

namespace  MR
 only for bindings generation
 

Concepts

concept  MR::HasGetNormalMethod
 
concept  MR::HasGetDirectionMethod
 

Enumerations

enum class  MR::FeaturesObjectKind {
  MR::FeaturesObjectKind::Point , MR::FeaturesObjectKind::Line , MR::FeaturesObjectKind::Plane , MR::FeaturesObjectKind::Circle ,
  MR::FeaturesObjectKind::Sphere , MR::FeaturesObjectKind::Cylinder , MR::FeaturesObjectKind::Cone , MR::FeaturesObjectKind::_count
}
 

Functions

template<typename F >
bool MR::forEachObjectKind (F &&func)
 Calls func, which is ( auto kind ) -> bool, for each known object kind. If it returns true, stops immediately and also returns true.
 
template<typename ... P>
std::shared_ptr< VisualObjectMR::makeObjectFromEnum (FeaturesObjectKind kind, P &&... params)
 Allocates an object of type kind, passing params... to its constructor.
 
template<typename ... P>
std::shared_ptr< VisualObjectMR::makeObjectFromClassName (std::string className, P &&... params)
 Allocates an object of type kind, passing params... to its constructor.
 
MRMESH_API std::optional< Vector3f > MR::getFeatureNormal (FeatureObject *feature)
 Using forEachObjectKind the template collects a list of features for which the method ...->getNormal() is available.
 
MRMESH_API std::optional< Vector3f > MR::getFeatureDirection (FeatureObject *feature)
 Using forEachObjectKind the template collects a list of features for which the method ...->getDirection() is available.
 
MRMESH_API std::unordered_set< std::string > MR::getFeaturesTypeWithNormals ()
 Try to getNormal from specific feature using forEachObjectKind template. Returns nullopt is ...->getNormal() is not available for given feature type.
 
MRMESH_API std::unordered_set< std::string > MR::getFeaturesTypeWithDirections ()
 Try to getDirection from specific feature using forEachObjectKind template. Returns nullopt is ...->getDirection() is not available for given feature type.