21 constexpr static const
char* StaticTypeName() noexcept {
return "AngleMeasurementObject"; }
22 const char*
typeName()
const override {
return StaticTypeName(); }
25 virtual std::string
className()
const override {
return StaticClassName(); }
28 virtual std::string
classNameInPlural()
const override {
return StaticClassNameInPlural(); }
33 MRMESH_API std::shared_ptr<Object>
clone()
const override;
43 [[nodiscard]] MRMESH_API Vector3f
getWorldRay(
bool second )
const;
45 [[nodiscard]] MRMESH_API Vector3f
getLocalRay(
bool second )
const;
51 MRMESH_API
virtual void setLocalRays(
const MR::Vector3f& a,
const MR::Vector3f& b );
64 [[nodiscard]] MRMESH_API std::vector<std::string>
getInfoLines()
const override;
82 bool isConical_ =
false;
85 bool shouldVisualizeRay_[2]{};
88 mutable std::optional<float> cachedValue_;
Represents an angle measurement.
Definition MRAngleMeasurementObject.h:13
Definition MRMeasurementObject.h:14
named object in the data model
Definition MRObject.h:62
MRMESH_API Vector3f getWorldPoint() const
Get the angle point in world coordinates.
MRMESH_API std::shared_ptr< Object > clone() const override
static constexpr const char * StaticClassNameInPlural() noexcept
Definition MRAngleMeasurementObject.h:27
MRMESH_API void swapBase_(Object &other) override
swaps this object with other
virtual std::string className() const override
Definition MRAngleMeasurementObject.h:25
MRMESH_API bool getShouldVisualizeRay(bool second) const
Whether we should draw a ray from the center point to better visualize the angle. Enable this if ther...
MRMESH_API void serializeFields_(Json::Value &root) const override
MRMESH_API void setIsConical(bool value)
AngleMeasurementObject(const AngleMeasurementObject &other)=default
MRMESH_API void deserializeFields_(const Json::Value &root) override
MRMESH_API bool getIsConical() const
Whether this is a conical angle. The middle line between the rays is preserved, but the rays themselv...
virtual MRMESH_API void setLocalRays(const MR::Vector3f &a, const MR::Vector3f &b)
MRMESH_API Vector3f getWorldRay(bool second) const
AngleMeasurementObject(AngleMeasurementObject &&) noexcept=default
MRMESH_API std::vector< std::string > getInfoLines() const override
return several info lines that can better describe the object in the UI
MRMESH_API std::shared_ptr< Object > shallowClone() const override
AngleMeasurementObject()
The xf encodes the two rays: the origin is the angle point, (1,0,0) is the first ray,...
Definition MRAngleMeasurementObject.h:16
MRMESH_API float computeAngle() const
Computes the angle value, as if by acos(dot(...)) from the two normalized getWorldRay()s.
const char * typeName() const override
Definition MRAngleMeasurementObject.h:22
MRMESH_API void setShouldVisualizeRay(bool second, bool enable)
static constexpr const char * StaticClassName() noexcept
Definition MRAngleMeasurementObject.h:24
virtual std::string classNameInPlural() const override
Definition MRAngleMeasurementObject.h:28
MRMESH_API Vector3f getLocalPoint() const
Get the angle point in local coordinates.
virtual MRMESH_API void setLocalPoint(const MR::Vector3f &point)
Set the angle point in the local coordinates.
MRMESH_API Vector3f getLocalRay(bool second) const
Same, but in local coordinates.
AngleMeasurementObject(ProtectedStruct, const AngleMeasurementObject &obj)
For std::make_shared() in clone().
Definition MRAngleMeasurementObject.h:31
MRMESH_API void setupRenderObject_() const override
MRMESH_API void onWorldXfChanged_() override
Emits worldXfChangedSignal, but derived classes can add additional behavior to it.
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRObject.h:284