32 constexpr static const
char* TypeName() noexcept
59 const std::filesystem::path&
getFontPath()
const {
return pathToFont_; }
92 return sourcePointColor_.get(
id );
99 return leaderLineColor_.get(
id );
106 return contourColor_.get(
id );
148 float fontHeight_{ 25.0f };
150 float leaderLineWidth_{ 1.0f };
152 float sourcePointSize_{ 5.f };
154 float backgroundPadding_{ 8.f };
183 void setDefaultColors_();
186 void setDefaultSceneProperties_();
188 void updatePivotShift_()
const;
190 mutable bool needRebuild_{
true };
191 mutable Vector2f pivotShift_;
192 mutable std::shared_ptr<Mesh> mesh_;
193 mutable Box3f meshBox_;
Contour
Definition MRObjectLabel.h:16
Background
Definition MRObjectLabel.h:15
SourcePoint
Definition MRObjectLabel.h:13
LeaderLine
Definition MRObjectLabel.h:14
#define MRSYMBOLMESH_API
Definition MRSymbolMeshFwd.h:11
#define MRSYMBOLMESH_CLASS
Definition MRSymbolMeshFwd.h:12
Definition MRVisualObject.h:67
Definition MRObjectLabel.h:25
Vector2f pivotPoint_
Definition MRObjectLabel.h:145
ObjectLabel(ObjectLabel &&) noexcept=default
virtual MRSYMBOLMESH_API void setSourcePointColorsForAllViewports(ViewportProperty< Color > val)
MRSYMBOLMESH_API const ViewportProperty< Color > & getSourcePointColorsForAllViewports() const
ViewportProperty< Color > contourColor_
Definition MRObjectLabel.h:163
virtual MRSYMBOLMESH_API void deserializeFields_(const Json::Value &root) override
virtual MRSYMBOLMESH_API Box3f getWorldBox(ViewportId={}) const override
const PositionedText & getLabel() const
Definition MRObjectLabel.h:55
MRSYMBOLMESH_API const ViewportProperty< Color > & getContourColorsForAllViewports() const
virtual MRSYMBOLMESH_API std::shared_ptr< Object > shallowClone() const override
ObjectLabel(ProtectedStruct, const ObjectLabel &obj)
Definition MRObjectLabel.h:119
const std::filesystem::path & getFontPath() const
Definition MRObjectLabel.h:59
const Vector2f & getPivotShift() const
get pivot shift (pivot point * text diagonal)
Definition MRObjectLabel.h:72
virtual MRSYMBOLMESH_API void setupRenderObject_() const override
const std::shared_ptr< Mesh > & labelRepresentingMesh() const
Definition MRObjectLabel.h:128
float getSourcePointSize() const
returns size of source point in pixels
Definition MRObjectLabel.h:81
MRSYMBOLMESH_API void setLabel(const PositionedText &label)
sets text and position of label
virtual MRSYMBOLMESH_API void setContourColorsForAllViewports(ViewportProperty< Color > val)
virtual MRSYMBOLMESH_API void swapBase_(Object &other) override
swaps this object with other
virtual MRSYMBOLMESH_API void setFontHeight(float size)
sets size of label font in pixels
ViewportMask sourcePoint_
Definition MRObjectLabel.h:156
const Vector2f & getPivotPoint() const
get pivot point
Definition MRObjectLabel.h:69
MRSYMBOLMESH_API AllVisualizeProperties getAllVisualizeProperties() const override
get all visualize properties masks
const Color & getLeaderLineColor(ViewportId id={}) const
return color of leader line
Definition MRObjectLabel.h:97
virtual const char * typeName() const override
Definition MRObjectLabel.h:36
virtual MRSYMBOLMESH_API void setLeaderLineColorsForAllViewports(ViewportProperty< Color > val)
virtual MRSYMBOLMESH_API void serializeFields_(Json::Value &root) const override
ViewportProperty< Color > leaderLineColor_
Definition MRObjectLabel.h:162
MRSYMBOLMESH_API void setFontPath(const std::filesystem::path &pathToFont)
sets path to font file
ViewportProperty< Color > sourcePointColor_
Definition MRObjectLabel.h:161
virtual MRSYMBOLMESH_API void setSourcePointColor(const Color &color, ViewportId id={})
sets color of source point
virtual MRSYMBOLMESH_API void setLeaderLineColor(const Color &color, ViewportId id={})
sets color of leader line
MRSYMBOLMESH_API void setAllVisualizeProperties_(const AllVisualizeProperties &properties, std::size_t &pos) override
set all visualize properties masks
float getBackgroundPadding() const
returns background padding in pixels
Definition MRObjectLabel.h:85
virtual MRSYMBOLMESH_API void setBackgroundPadding(float padding)
sets background padding in pixels
virtual MRSYMBOLMESH_API void setLeaderLineWidth(float width)
sets width of leader line in pixels
virtual MRSYMBOLMESH_API Box3f computeBoundingBox_() const override
MRSYMBOLMESH_API const ViewportProperty< Color > & getLeaderLineColorsForAllViewports() const
virtual MRSYMBOLMESH_API void applyScale(float scaleFactor) override
scale object size (all point positions)
MRSYMBOLMESH_API void setPivotPoint(const Vector2f &pivotPoint)
MRSYMBOLMESH_API void buildMeshFromText() const
float getLeaderLineWidth() const
returns width of leader line in pixels
Definition MRObjectLabel.h:77
ViewportMask background_
Definition MRObjectLabel.h:157
ObjectLabel(const ObjectLabel &other)=default
virtual MRSYMBOLMESH_API std::shared_ptr< Object > clone() const override
virtual bool hasVisualRepresentation() const override
does the object have any visual representation (visible points, triangles, edges, etc....
Definition MRObjectLabel.h:43
float getFontHeight() const
returns size of label font on screen in pixels
Definition MRObjectLabel.h:51
ViewportMask leaderLine_
Definition MRObjectLabel.h:159
virtual MRSYMBOLMESH_API size_t heapBytes() const override
returns the amount of memory this object occupies on heap
std::filesystem::path pathToFont_
Definition MRObjectLabel.h:144
MRSYMBOLMESH_API ObjectLabel()
MRSYMBOLMESH_API void setContourColor(const Color &color, ViewportId id={})
sets contour color
PositionedText label_
Definition MRObjectLabel.h:143
virtual MRSYMBOLMESH_API void setSourcePointSize(float size)
sets size of source point in pixels
const Color & getContourColor(ViewportId id={}) const
return contour color
Definition MRObjectLabel.h:104
ViewportMask contour_
Definition MRObjectLabel.h:158
const Color & getSourcePointColor(ViewportId id={}) const
returns color of source point
Definition MRObjectLabel.h:90
MRSYMBOLMESH_API const ViewportMask & getVisualizePropertyMask(AnyVisualizeMaskEnum type) const override
returns mask of viewports where given property is set
named object in the data model
Definition MRObject.h:60
Definition MRViewportId.h:16
stores mask of viewport unique identifiers
Definition MRViewportId.h:38
Definition MRViewportProperty.h:17
Visual Object.
Definition MRVisualObject.h:131
std::vector< ViewportMask > AllVisualizeProperties
Definition MRVisualObject.h:85
Definition MRCameraOrientationPlugin.h:8
Definition MRVisualObject.h:45
Definition MRObject.h:246
Definition MRPositionedText.h:9