22 constexpr static const
char* StaticTypeName() noexcept {
return "DistanceMeasurementObject"; }
23 const char*
typeName()
const override {
return StaticTypeName(); }
26 virtual std::string
className()
const override {
return StaticClassName(); }
29 virtual std::string
classNameInPlural()
const override {
return StaticClassNameInPlural(); }
34 MRMESH_API std::shared_ptr<Object>
clone()
const override;
58 euclideanWithSignedDeltasPerAxis,
59 euclideanWithAbsoluteDeltasPerAxis,
74 [[nodiscard]] MRMESH_API std::vector<std::string>
getInfoLines()
const override;
102 bool isNegative_ =
false;
108 mutable std::optional<float> cachedValue_;
110 std::optional<ComparisonTolerance> tolerance_;
112 std::optional<float> referenceValue_;
Represents a distance measurement.
Definition MRDistanceMeasurementObject.h:14
Definition MRMeasurementObject.h:14
A base class for a data-model object that is a feature/measurement that can be compared between two m...
Definition MRObjectComparableWithReference.h:17
named object in the data model
Definition MRObject.h:62
virtual MRMESH_API void setLocalDelta(const MR::Vector3f &delta)
Set the delta vector in the local coordinates.
MRMESH_API Vector3f getLocalPoint() const
Get the starting point in local coordinates.
MRMESH_API void setComparisonTolerance(std::size_t i, std::optional< ComparisonTolerance > newTolerance) override
virtual MRMESH_API void setLocalPoint(const MR::Vector3f &point)
Set the start point in the local coordinates.
DistanceMeasurementObject(const DistanceMeasurementObject &other)=default
virtual std::string classNameInPlural() const override
Definition MRDistanceMeasurementObject.h:29
MRMESH_API void deserializeFields_(const Json::Value &root) override
static constexpr const char * StaticClassNameInPlural() noexcept
Definition MRDistanceMeasurementObject.h:28
MRMESH_API std::string_view getComparisonReferenceValueName(std::size_t i) const override
i goes up to numComparisonReferenceValues(), exclusive.
MRMESH_API float computeDistance() const
DistanceMeasurementObject()
The xf encodes the distance: the origin is one point, and (1,0,0) is another.
Definition MRDistanceMeasurementObject.h:17
MRMESH_API Vector3f getLocalDelta() const
MRMESH_API void serializeFields_(Json::Value &root) const override
virtual MRMESH_API void setDistanceMode(DistanceMode mode)
MRMESH_API std::optional< ComparisonTolerance > getComparisonTolerence(std::size_t i) const override
const char * typeName() const override
Definition MRDistanceMeasurementObject.h:23
MRMESH_API std::size_t numComparableProperties() const override
Implement ObjectComparableWithReference:
MRMESH_API void setupRenderObject_() const override
MRMESH_API Vector3f getWorldPoint() const
Get the starting point in world coordinates.
DistanceMeasurementObject(DistanceMeasurementObject &&) noexcept=default
MRMESH_API std::shared_ptr< Object > shallowClone() const override
DistanceMeasurementObject(ProtectedStruct, const DistanceMeasurementObject &obj)
For std::make_shared() in clone().
Definition MRDistanceMeasurementObject.h:32
MRMESH_API ComparisonReferenceValue getComparisonReferenceValue(std::size_t i) const override
virtual MRMESH_API void setIsNegative(bool value)
MRMESH_API std::string_view getComparablePropertyName(std::size_t i) const override
i goes up to numComparableProperties(), exclusive.
MRMESH_API Vector3f getWorldDelta() const
The delta from the starting point to the other point.
MRMESH_API void onWorldXfChanged_() override
Emits worldXfChangedSignal, but derived classes can add additional behavior to it.
MRMESH_API bool isNegative() const
Whether the distance should be displayed as a negative one.
MRMESH_API std::optional< ComparableProperty > computeComparableProperty(std::size_t i) const override
MRMESH_API std::shared_ptr< Object > clone() const override
static constexpr const char * StaticClassName() noexcept
Definition MRDistanceMeasurementObject.h:25
DistanceMode
Definition MRDistanceMeasurementObject.h:56
virtual std::string className() const override
Definition MRDistanceMeasurementObject.h:26
MRMESH_API DistanceMode getDistanceMode() const
Whether we should draw the individual X/Y/Z deltas in addition to the distance itself.
MRMESH_API void swapBase_(Object &other) override
swaps this object with other
MRMESH_API void setComparisonReferenceValue(std::size_t i, std::optional< ComparisonReferenceValue::Var > value) override
MRMESH_API std::vector< std::string > getInfoLines() const override
return several info lines that can better describe the object in the UI
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
This can't be std::optional<Var>, because we still need the variant to know the correct type.
Definition MRObjectComparableWithReference.h:90
Definition MRObject.h:284