MeshLib Documentation
Loading...
Searching...
No Matches
MRPointObject.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRFeatureObject.h"
4#include "MRMeshFwd.h"
5#include "MRVisualObject.h"
6
7namespace MR
8{
9
13{
14public:
18 MRMESH_API PointObject( const std::vector<Vector3f>& pointsToApprox );
19
20 PointObject( PointObject&& ) noexcept = default;
21 PointObject& operator = ( PointObject&& ) noexcept = default;
22
23 constexpr static const char* TypeName() noexcept { return "PointObject"; }
24 virtual const char* typeName() const override { return TypeName(); }
25
28 {}
29
30 virtual std::string getClassName() const override { return "Point"; }
31
32 MRMESH_API virtual std::shared_ptr<Object> clone() const override;
33 MRMESH_API virtual std::shared_ptr<Object> shallowClone() const override;
34
36 [[nodiscard]] MRMESH_API Vector3f getPoint( ViewportId id = {} ) const;
38 MRMESH_API void setPoint( const Vector3f& point, ViewportId id = {} );
39
40 MRMESH_API virtual std::vector<FeatureObjectSharedProperty>& getAllSharedProperties() const override;
41
42 [[nodiscard]] MRMESH_API FeatureObjectProjectPointResult projectPoint( const Vector3f& /*point*/, ViewportId id = {} ) const override;
43
44protected:
45 PointObject( const PointObject& other ) = default;
46
48 MRMESH_API virtual void swapBase_( Object& other ) override;
49
50 MRMESH_API virtual void serializeFields_( Json::Value& root ) const override;
51
52 virtual Expected<std::future<Expected<void>>> serializeModel_( const std::filesystem::path& ) const override
53 { return {}; }
54
55 virtual Expected<void> deserializeModel_( const std::filesystem::path&, ProgressCallback ) override
56 { return {}; }
57
58 MRMESH_API void setupRenderObject_() const override;
59};
60
61}
#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
named object in the data model
Definition MRObject.h:60
Definition MRPointObject.h:13
MRMESH_API FeatureObjectProjectPointResult projectPoint(const Vector3f &, ViewportId id={}) const override
virtual Expected< void > deserializeModel_(const std::filesystem::path &, ProgressCallback) override
Reads model from file.
Definition MRPointObject.h:55
PointObject(const PointObject &other)=default
PointObject(ProtectedStruct, const PointObject &obj)
Definition MRPointObject.h:27
virtual MRMESH_API std::shared_ptr< Object > shallowClone() const override
MRMESH_API Vector3f getPoint(ViewportId id={}) const
calculates point from xf
virtual std::string getClassName() const override
return human readable name of subclass
Definition MRPointObject.h:30
virtual MRMESH_API std::vector< FeatureObjectSharedProperty > & getAllSharedProperties() const override
Create and generate list of bounded getters and setters for the main properties of feature object,...
MRMESH_API PointObject(const std::vector< Vector3f > &pointsToApprox)
Finds best point to approx given points.
MRMESH_API void setupRenderObject_() const override
PointObject(PointObject &&) noexcept=default
MRMESH_API PointObject()
Creates simple point object with zero position.
virtual MRMESH_API std::shared_ptr< Object > clone() const override
virtual MRMESH_API void serializeFields_(Json::Value &root) const override
virtual Expected< std::future< Expected< void > > > serializeModel_(const std::filesystem::path &) const override
Definition MRPointObject.h:52
MRMESH_API void setPoint(const Vector3f &point, ViewportId id={})
updates xf to fit given point
virtual const char * typeName() const override
Definition MRPointObject.h:24
virtual MRMESH_API void swapBase_(Object &other) override
swaps this object with other
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