22 constexpr static const
char* TypeName() noexcept {
return "LineObject"; }
23 virtual const char*
typeName()
const override {
return TypeName(); }
29 virtual std::string
getClassName()
const override {
return "Line"; }
54 [[deprecated(
"This confusingly sets half-length. Use `setLength(halfLen * 2)` instead." )]]
57 setLength( halfLen * 2 ,
id );
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:50
An interface class which allows feature objects to share setters and getters on their main properties...
Definition MRFeatureObject.h:93
Definition MRLineObject.h:12
MRMESH_API Vector3f getDirection(ViewportId id={}) const
calculates direction from xf
virtual MRMESH_API std::shared_ptr< Object > shallowClone() const override
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.
LineObject(const LineObject &other)=default
LineObject(LineObject &&) noexcept=default
virtual std::string getClassName() const override
return human readable name of subclass
Definition MRLineObject.h:29
MRMESH_API Vector3f getCenter(ViewportId id={}) const
calculates center from xf
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 Expected< void > deserializeModel_(const std::filesystem::path &, ProgressCallback) override
Reads model from file.
Definition MRLineObject.h:75
void setSize(float halfLen, ViewportId id={})
Definition MRLineObject.h:55
MRMESH_API void setLength(float size, ViewportId id={})
updates xf to scale size
LineObject(ProtectedStruct, const LineObject &obj)
Definition MRLineObject.h:26
virtual MRMESH_API Vector3f getBasePoint(ViewportId id={}) const override
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:72
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:23
named object in the data model
Definition MRObject.h:60
Definition MRViewportId.h:16
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:58
Definition MRFeatureObject.h:78
Definition MRObject.h:246