23 constexpr static const char*
TypeName() noexcept {
return "ObjectDistanceMap"; }
24 virtual const char*
typeName()
const override {
return TypeName(); }
33 std::string
getClassName()
const override {
return "Distance Map"; }
41 const std::shared_ptr<DistanceMap>& dmap,
42 const AffineXf3f& dmap2local,
43 bool needUpdateMesh =
true,
51 [[nodiscard]]
const std::shared_ptr<DistanceMap>&
getDistanceMap()
const {
return dmap_; }
53 [[nodiscard]]
virtual bool hasModel()
const override {
return bool( dmap_ ); }
76 std::shared_ptr<DistanceMap> dmap_;
77 AffineXf3f dmap2local_;
79 const char * saveDistanceMapFormat_{
"*.raw" };
86 const std::shared_ptr<DistanceMap>& dmap,
87 const AffineXf3f& dmap2local,
88 bool needUpdateMesh =
true,
92 void setDefaultColors_();
95 void setDefaultSceneProperties_();
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:83
Definition MRObjectDistanceMap.h:13
MRMESH_API const AffineXf3f & getToWorldParameters() const
unlike the name, actually it is the transformation from distance map in local space
Definition MRObjectDistanceMap.h:56
virtual MRMESH_API Expected< std::future< Expected< void > > > serializeModel_(const std::filesystem::path &path) const override
virtual MRMESH_API void serializeFields_(Json::Value &root) const override
MRMESH_API std::shared_ptr< Mesh > calculateMesh(ProgressCallback cb={}) const
creates a grid for this object
MRMESH_API void updateMesh(const std::shared_ptr< Mesh > &mesh)
updates the grid to the current one
MRMESH_API ObjectDistanceMap()
virtual MRMESH_API std::shared_ptr< Object > clone() const override
ObjectDistanceMap(ObjectDistanceMap &&) noexcept=default
MRMESH_API Expected< void > deserializeModel_(const std::filesystem::path &path, ProgressCallback progressCb={}) override
Reads model from file.
MRMESH_API void deserializeFields_(const Json::Value &root) override
virtual MRMESH_API std::vector< std::string > getInfoLines() const override
return several info lines that can better describe the object in the UI
const std::shared_ptr< DistanceMap > & getDistanceMap() const
Definition MRObjectDistanceMap.h:51
virtual bool hasModel() const override
Definition MRObjectDistanceMap.h:53
virtual MRMESH_API std::shared_ptr< Object > shallowClone() const override
virtual MRMESH_API void swapBase_(Object &other) override
swaps this object with other
virtual MRMESH_API size_t heapBytes() const override
returns the amount of memory this object occupies on heap
virtual const char * typeName() const override
Definition MRObjectDistanceMap.h:24
MRMESH_API bool setDistanceMap(const std::shared_ptr< DistanceMap > &dmap, const AffineXf3f &dmap2local, bool needUpdateMesh=true, ProgressCallback cb={})
std::string getClassNameInPlural() const override
return human readable name of subclass in plural form
Definition MRObjectDistanceMap.h:34
static constexpr const char * TypeName() noexcept
Definition MRObjectDistanceMap.h:23
ObjectDistanceMap(const ObjectDistanceMap &other)=default
std::string getClassName() const override
return human readable name of subclass
Definition MRObjectDistanceMap.h:33
virtual MRMESH_API void applyScale(float scaleFactor) override
scale object size (all point positions)
Definition MRObjectMeshHolder.h:30
named object in the data model
Definition MRObject.h:60
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:626
tl::expected< T, E > Expected
Definition MRExpected.h:59
Definition MRObject.h:253