2#include "MRPch/MRBindingMacros.h"
21 MRMESH_API
LineObject(
const std::vector<Vector3f>& pointsToApprox );
26 constexpr static const
char* StaticTypeName() noexcept {
return "LineObject"; }
27 virtual const char*
typeName()
const override {
return StaticTypeName(); }
30 virtual std::string
className()
const override {
return StaticClassName(); }
33 virtual std::string
classNameInPlural()
const override {
return StaticClassNameInPlural(); }
39 MRMESH_API
virtual std::shared_ptr<Object>
clone()
const override;
40 MRMESH_API
virtual std::shared_ptr<Object>
shallowClone()
const override;
62 [[deprecated(
"This confusingly sets half-length. Use `setLength(halfLen * 2)` instead." )]]
65 setLength( halfLen * 2 ,
id );
An interface class which allows feature objects to share setters and getters on their main properties...
Definition MRFeatureObject.h:96
Definition MRLineObject.h:16
named object in the data model
Definition MRObject.h:62
Definition MRViewportId.h:16
static constexpr const char * StaticClassName() noexcept
Definition MRLineObject.h:29
MRMESH_API Vector3f getDirection(ViewportId id={}) const
calculates direction from xf
virtual MRMESH_API std::shared_ptr< Object > shallowClone() const override
static constexpr const char * StaticClassNameInPlural() noexcept
Definition MRLineObject.h:32
MRMESH_API float getLength(ViewportId id={}) const
calculates line size from xf
MRMESH_API Vector3f getPointA(ViewportId id={}) const
Returns the starting point, aka center - dir * len/2.
virtual std::string className() const override
Definition MRLineObject.h:30
MR_BIND_IGNORE void setSize(float halfLen, ViewportId id={})
Definition MRLineObject.h:63
LineObject(const LineObject &other)=default
LineObject(LineObject &&) noexcept=default
MRMESH_API Vector3f getCenter(ViewportId id={}) const
calculates center from xf
tl::expected< T, E > Expected
Definition MRExpected.h:31
virtual MRMESH_API void serializeFields_(Json::Value &root) const override
MRMESH_API LineObject(const std::vector< Vector3f > &pointsToApprox)
Finds best plane to approx given points.
MRMESH_API void setCenter(const Vector3f ¢er, ViewportId id={})
updates xf to fit given center
MRMESH_API void setupRenderObject_() const override
MRMESH_API FeatureObjectProjectPointResult projectPoint(const Vector3f &point, ViewportId id={}) const override
virtual MRMESH_API std::shared_ptr< Object > clone() const override
MRMESH_API LineObject()
Creates simple plane object.
MRMESH_API void setDirection(const Vector3f &normal, ViewportId id={})
updates xf to fit given normal
virtual std::string classNameInPlural() const override
Definition MRLineObject.h:33
virtual Expected< void > deserializeModel_(const std::filesystem::path &, ProgressCallback) override
Reads model from file.
Definition MRLineObject.h:83
MRMESH_API void setLength(float size, ViewportId id={})
updates xf to scale size
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:13
LineObject(ProtectedStruct, const LineObject &obj)
Definition MRLineObject.h:36
virtual MRMESH_API Vector3f getBasePoint(ViewportId id={}) const override
Returns point considered as base for the feature.
virtual MRMESH_API void swapBase_(Object &other) override
swaps this object with other
virtual Expected< std::future< Expected< void > > > serializeModel_(const std::filesystem::path &) const override
Definition MRLineObject.h:80
virtual MRMESH_API const std::vector< FeatureObjectSharedProperty > & getAllSharedProperties() const override
Create and generate list of bounded getters and setters for the main properties of feature object,...
MRMESH_API Vector3f getPointB(ViewportId id={}) const
Returns the finishing point, aka center + dir * len/2.
virtual const char * typeName() const override
Definition MRLineObject.h:27
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRFeatureObject.h:81
Definition MRObject.h:284