MeshLib C++ Docs
Loading...
Searching...
No Matches
MRFeatures.h File Reference
#include "MRMesh/MRAffineXf.h"
#include "MRMesh/MRCone3.h"
#include "MRMesh/MRCylinder3.h"
#include "MRMesh/MRPlane3.h"
#include "MRMesh/MRSphere.h"
#include "MRMesh/MRVector3.h"
#include <cassert>
#include <optional>
#include <variant>

Go to the source code of this file.

Classes

struct  MR::Features::Primitives::Plane
 
struct  MR::Features::Primitives::ConeSegment
 
struct  MR::Features::MeasureResult
 Stores the results of measuring two objects relative to one another. More...
 
struct  MR::Features::MeasureResult::BasicPart
 
struct  MR::Features::MeasureResult::Distance
 
struct  MR::Features::MeasureResult::Angle
 
struct  MR::Features::Traits::Unary< T >
 
struct  MR::Features::Traits::Unary< Primitives::Sphere >
 
struct  MR::Features::Traits::Unary< Primitives::ConeSegment >
 
struct  MR::Features::Traits::Unary< Primitives::Plane >
 
struct  MR::Features::Traits::Binary< A, B >
 
struct  MR::Features::Traits::Binary< Primitives::Sphere, Primitives::Sphere >
 ?? <-> Sphere More...
 
struct  MR::Features::Traits::Binary< Primitives::ConeSegment, Primitives::Sphere >
 
struct  MR::Features::Traits::Binary< Primitives::Plane, Primitives::Sphere >
 
struct  MR::Features::Traits::Binary< Primitives::ConeSegment, Primitives::ConeSegment >
 ?? <-> Cone More...
 
struct  MR::Features::Traits::Binary< Primitives::Plane, Primitives::ConeSegment >
 
struct  MR::Features::Traits::Binary< Primitives::Plane, Primitives::Plane >
 ?? <-> Plane More...
 

Namespaces

namespace  MR
 only for bindings generation
 
namespace  MR::Features
 
namespace  MR::Features::Primitives
 
namespace  MR::Features::Traits
 Traits that determine how the primitives are related.
 

Concepts

concept  MR::Features::Traits::MeasureSupportedOneWay
 
concept  MR::Features::MeasureSupported
 Whether you can measure two primitives relative to one another.
 

Typedefs

using MR::Features::Primitives::Sphere = Sphere3<float>
 Doubles as a point when the radius is zero.
 
using MR::Features::Primitives::Variant = std::variant<Sphere, ConeSegment, Plane>
 

Functions

Primitives::Sphere MR::Features::toPrimitive (const Vector3f &point)
 Those map various MR types to our primitives. Some of those are identity functions.
 
Primitives::Sphere MR::Features::toPrimitive (const Sphere3f &sphere)
 
MRMESH_API Primitives::ConeSegment MR::Features::toPrimitive (const Line3f &line)
 
MRMESH_API Primitives::ConeSegment MR::Features::toPrimitive (const LineSegm3f &segm)
 
Primitives::ConeSegment MR::Features::toPrimitive (const Cylinder3f &cyl)
 
Primitives::ConeSegment MR::Features::toPrimitive (const Cone3f &cone)
 
MRMESH_API Primitives::ConeSegment MR::Features::primitiveCircle (const Vector3f &point, const Vector3f &normal, float rad)
 normal doesn't need to be normalized.
 
MRMESH_API Primitives::ConeSegment MR::Features::primitiveCylinder (const Vector3f &a, const Vector3f &b, float rad)
 a and b are centers of the sides.
 
MRMESH_API Primitives::ConeSegment MR::Features::primitiveCone (const Vector3f &a, const Vector3f &b, float rad)
 a is the center of the base, b is the pointy end.
 
MRMESH_API std::optional< Primitives::VariantMR::Features::primitiveFromObject (const Object &object)
 Returns null if the object type is unknown. This overload ignores the parent xf.
 
MRMESH_API std::optional< Primitives::VariantMR::Features::primitiveFromObjectWithWorldXf (const Object &object)
 Returns null if the object type is unknown. This overload respects the parent's worldXf().
 
MRMESH_API std::shared_ptr< FeatureObjectMR::Features::primitiveToObject (const Primitives::Variant &primitive, float infiniteExtent)
 
MRMESH_API Primitives::Sphere MR::Features::transformPrimitive (const AffineXf3f &xf, const Primitives::Sphere &primitive)
 
MRMESH_API Primitives::Plane MR::Features::transformPrimitive (const AffineXf3f &xf, const Primitives::Plane &primitive)
 
MRMESH_API Primitives::ConeSegment MR::Features::transformPrimitive (const AffineXf3f &xf, const Primitives::ConeSegment &primitive)
 
MRMESH_API Primitives::Variant MR::Features::transformPrimitive (const AffineXf3f &xf, const Primitives::Variant &primitive)
 
MRMESH_API std::string_view MR::Features::toString (MeasureResult::Status status)
 MeasureResult::Status enum to string.
 
template<typename T >
std::string MR::Features::name (const T &primitive)
 Get name of a Primitives::... class (can depend on its parameters).
 
MRMESH_API std::string MR::Features::name (const Primitives::Variant &var)
 Same but for a variant.
 
template<typename A , typename B >
requires MeasureSupported<A, B>
MeasureResult MR::Features::measure (const A &a, const B &b)
 Measures stuff between two primitives. (Two types from Primitives::....)
 
template<typename B >
MeasureResult MR::Features::measure (const Primitives::Variant &a, const B &b)
 Same, but with a variant as the first argument.
 
template<typename A >
MeasureResult MR::Features::measure (const A &a, const Primitives::Variant &b)
 Same, but with a variant as the second argument.
 
MRMESH_API MeasureResult MR::Features::measure (const Primitives::Variant &a, const Primitives::Variant &b)
 Same, but with variants as both argument.