MeshLib
 
Loading...
Searching...
No Matches
MR::ObjectLabel Class Reference

#include <MRObjectLabel.h>

+ Inheritance diagram for MR::ObjectLabel:

Public Member Functions

MRSYMBOLMESH_API ObjectLabel ()
 
 ObjectLabel (ObjectLabel &&) noexcept=default
 
ObjectLabeloperator= (ObjectLabel &&) noexcept=default
 
virtual const char * typeName () const override
 
virtual MRSYMBOLMESH_API void applyScale (float scaleFactor) override
 scale object size (all point positions)
 
virtual bool hasVisualRepresentation () const override
 does the object have any visual representation (visible points, triangles, edges, etc.), no considering child objects
 
virtual MRSYMBOLMESH_API std::shared_ptr< Objectclone () const override
 
virtual MRSYMBOLMESH_API std::shared_ptr< ObjectshallowClone () const override
 
virtual MRSYMBOLMESH_API void setFontHeight (float size)
 sets size of label font in pixels
 
float getFontHeight () const
 returns size of label font on screen in pixels
 
MRSYMBOLMESH_API void setLabel (const PositionedText &label)
 sets text and position of label
 
const PositionedTextgetLabel () const
 
MRSYMBOLMESH_API void setFontPath (const std::filesystem::path &pathToFont)
 sets path to font file
 
const std::filesystem::path & getFontPath () const
 
MRSYMBOLMESH_API void setPivotPoint (const Vector2f &pivotPoint)
 
const Vector2f & getPivotPoint () const
 get pivot point
 
const Vector2f & getPivotShift () const
 get pivot shift (pivot point * text diagonal)
 
virtual MRSYMBOLMESH_API void setLeaderLineWidth (float width)
 sets width of leader line in pixels
 
float getLeaderLineWidth () const
 returns width of leader line in pixels
 
virtual MRSYMBOLMESH_API void setSourcePointSize (float size)
 sets size of source point in pixels
 
float getSourcePointSize () const
 returns size of source point in pixels
 
virtual MRSYMBOLMESH_API void setBackgroundPadding (float padding)
 sets background padding in pixels
 
float getBackgroundPadding () const
 returns background padding in pixels
 
virtual MRSYMBOLMESH_API void setSourcePointColor (const Color &color, ViewportId id={})
 sets color of source point
 
const ColorgetSourcePointColor (ViewportId id={}) const
 returns color of source point
 
virtual MRSYMBOLMESH_API void setLeaderLineColor (const Color &color, ViewportId id={})
 sets color of leader line
 
const ColorgetLeaderLineColor (ViewportId id={}) const
 return color of leader line
 
MRSYMBOLMESH_API void setContourColor (const Color &color, ViewportId id={})
 sets contour color
 
const ColorgetContourColor (ViewportId id={}) const
 return contour color
 
MRSYMBOLMESH_API const ViewportProperty< Color > & getSourcePointColorsForAllViewports () const
 
virtual MRSYMBOLMESH_API void setSourcePointColorsForAllViewports (ViewportProperty< Color > val)
 
MRSYMBOLMESH_API const ViewportProperty< Color > & getLeaderLineColorsForAllViewports () const
 
virtual MRSYMBOLMESH_API void setLeaderLineColorsForAllViewports (ViewportProperty< Color > val)
 
MRSYMBOLMESH_API const ViewportProperty< Color > & getContourColorsForAllViewports () const
 
virtual MRSYMBOLMESH_API void setContourColorsForAllViewports (ViewportProperty< Color > val)
 
 ObjectLabel (ProtectedStruct, const ObjectLabel &obj)
 
virtual MRSYMBOLMESH_API Box3f getWorldBox (ViewportId={}) const override
 
const std::shared_ptr< Mesh > & labelRepresentingMesh () const
 
virtual MRSYMBOLMESH_API size_t heapBytes () const override
 returns the amount of memory this object occupies on heap
 
MRSYMBOLMESH_API AllVisualizeProperties getAllVisualizeProperties () const override
 get all visualize properties masks
 
MRSYMBOLMESH_API const ViewportMaskgetVisualizePropertyMask (AnyVisualizeMaskEnum type) const override
 returns mask of viewports where given property is set
 
MRSYMBOLMESH_API void buildMeshFromText () const
 
- Public Member Functions inherited from MR::VisualObject
MRMESH_API VisualObject ()
 
 VisualObject (VisualObject &&)=default
 
VisualObjectoperator= (VisualObject &&)=default
 
virtual ~VisualObject ()=default
 
virtual std::string getClassName () const override
 return human readable name of subclass
 
virtual MRMESH_API bool supportsVisualizeProperty (AnyVisualizeMaskEnum type) const
 Returns true if this class supports the property type. Otherwise passing it to the functions below is illegal.
 
MRMESH_API void setVisualizeProperty (bool value, AnyVisualizeMaskEnum type, ViewportMask viewportMask)
 set visual property in all viewports specified by the mask
 
virtual MRMESH_API void setVisualizePropertyMask (AnyVisualizeMaskEnum type, ViewportMask viewportMask)
 set visual property mask
 
MRMESH_API bool getVisualizeProperty (AnyVisualizeMaskEnum type, ViewportMask viewportMask) const
 returns true if the property is set at least in one viewport specified by the mask
 
MRMESH_API void toggleVisualizeProperty (AnyVisualizeMaskEnum type, ViewportMask viewportMask)
 toggle visual property in all viewports specified by the mask
 
void setAllVisualizeProperties (const AllVisualizeProperties &properties)
 set all visualize properties masks
 
void showLabels (bool on)
 shows/hides labels
 
bool showLabels () const
 
void showName (bool on)
 shows/hides object name in all viewports
 
bool showName () const
 returns whether object name is shown in any viewport
 
MRMESH_API const ColorgetFrontColor (bool selected=true, ViewportId viewportId={}) const
 returns color of object when it is selected/not-selected (depending on argument) in given viewport
 
virtual MRMESH_API void setFrontColor (const Color &color, bool selected, ViewportId viewportId={})
 sets color of object when it is selected/not-selected (depending on argument) in given viewport
 
virtual MRMESH_API const ViewportProperty< Color > & getFrontColorsForAllViewports (bool selected=true) const
 returns color of object when it is selected/not-selected (depending on argument) in all viewports
 
virtual MRMESH_API void setFrontColorsForAllViewports (ViewportProperty< Color > val, bool selected=true)
 sets color of object when it is selected/not-selected (depending on argument) in all viewports
 
virtual MRMESH_API const ViewportProperty< Color > & getBackColorsForAllViewports () const
 returns backward color of object in all viewports
 
virtual MRMESH_API void setBackColorsForAllViewports (ViewportProperty< Color > val)
 sets backward color of object in all viewports
 
MRMESH_API const ColorgetBackColor (ViewportId viewportId={}) const
 returns backward color of object in given viewport
 
virtual MRMESH_API void setBackColor (const Color &color, ViewportId viewportId={})
 sets backward color of object in given viewport
 
MRMESH_API const uint8_t & getGlobalAlpha (ViewportId viewportId={}) const
 returns global transparency alpha of object in given viewport
 
virtual MRMESH_API void setGlobalAlpha (uint8_t alpha, ViewportId viewportId={})
 sets global transparency alpha of object in given viewport
 
virtual MRMESH_API const ViewportProperty< uint8_t > & getGlobalAlphaForAllViewports () const
 returns global transparency alpha of object in all viewports
 
virtual MRMESH_API void setGlobalAlphaForAllViewports (ViewportProperty< uint8_t > val)
 sets global transparency alpha of object in all viewports
 
MRMESH_API const ColorgetLabelsColor (ViewportId viewportId={}) const
 
virtual MRMESH_API void setLabelsColor (const Color &color, ViewportId viewportId={})
 
MRMESH_API const ViewportProperty< Color > & getLabelsColorsForAllViewports () const
 
virtual MRMESH_API void setLabelsColorsForAllViewports (ViewportProperty< Color > val)
 
virtual MRMESH_API void setDirtyFlags (uint32_t mask, bool invalidateCaches=true)
 
MRMESH_API uint32_t getDirtyFlags () const
 returns current dirty flags for the object
 
MRMESH_API void resetDirty () const
 resets all dirty flags (except for cache flags that will be reset automatically on cache update)
 
MRMESH_API Box3f getBoundingBox () const
 returns cached bounding box of this object in local coordinates
 
virtual bool getRedrawFlag (ViewportMask viewportMask) const override
 returns true if the object must be redrawn (due to dirty flags) in one of specified viewports
 
bool isPickable (ViewportMask viewportMask=ViewportMask::any()) const
 whether the object can be picked (by mouse) in any of given viewports
 
virtual MRMESH_API void setPickable (bool on, ViewportMask viewportMask=ViewportMask::all())
 sets the object as can/cannot be picked (by mouse) in all of given viewports
 
const VertColors & getVertsColorMap () const
 returns per-vertex colors of the object
 
virtual void setVertsColorMap (VertColors vertsColorMap)
 sets per-vertex colors of the object
 
virtual void updateVertsColorMap (VertColors &vertsColorMap)
 swaps per-vertex colors of the object with given argument
 
ColoringType getColoringType () const
 returns the current coloring mode of the object
 
virtual MRMESH_API void setColoringType (ColoringType coloringType)
 sets coloring mode of the object with given argument
 
virtual MRMESH_API void copyColors (const VisualObject &src, const VertMap &thisToSrc, const FaceMap &thisToSrcFaces={})
 copies point colors from given source object
 
float getShininess () const
 returns the current shininess visual value
 
virtual void setShininess (float shininess)
 sets shininess visual value of the object with given argument
 
float getSpecularStrength () const
 returns intensity of reflections
 
virtual void setSpecularStrength (float specularStrength)
 sets intensity of reflections
 
float getAmbientStrength () const
 returns intensity of non-directional light
 
virtual void setAmbientStrength (float ambientStrength)
 sets intensity of non-directional light
 
const std::vector< PositionedText > & getLabels () const
 
virtual void setLabels (std::vector< PositionedText > labels)
 
virtual MRMESH_API bool render (const ModelRenderParams &) const
 
virtual MRMESH_API void renderForPicker (const ModelBaseRenderParams &, unsigned) const
 draws this object for picking
 
virtual MRMESH_API void renderUi (const UiRenderParams &params) const
 draws this object for 2d UI
 
 VisualObject (ProtectedStruct, const VisualObject &obj)
 this ctor is public only for std::make_shared used inside clone()
 
virtual MRMESH_API std::vector< std::string > getInfoLines () const override
 return several info lines that can better describe the object in the UI
 
MRMESH_API bool useDefaultScenePropertiesOnDeserialization () const
 
MRMESH_API void setUseDefaultScenePropertiesOnDeserialization (bool useDefaultScenePropertiesOnDeserialization)
 
- Public Member Functions inherited from MR::Object
 Object ()=default
 
 Object (Object &&) noexcept=default
 
Objectoperator= (Object &&) noexcept=default
 
virtual ~Object ()=default
 
template<typename T >
T * asType ()
 
template<typename T >
const T * asType () const
 
const std::string & name () const
 
virtual void setName (std::string name)
 
MRMESH_API std::shared_ptr< const Objectfind (const std::string_view &name) const
 finds a direct child by name
 
std::shared_ptr< Objectfind (const std::string_view &name)
 
template<typename T >
std::shared_ptr< const T > find () const
 finds a direct child by type
 
template<typename T >
std::shared_ptr< T > find ()
 
template<typename T >
std::shared_ptr< const T > find (const std::string_view &name) const
 finds a direct child by name and type
 
template<typename T >
std::shared_ptr< T > find (const std::string_view &name)
 
const AffineXf3fxf (ViewportId id={}, bool *isDef=nullptr) const
 
virtual MRMESH_API void setXf (const AffineXf3f &xf, ViewportId id={})
 
virtual MRMESH_API void resetXf (ViewportId id={})
 forgets specific transform in given viewport (or forgets all specific transforms for {} input)
 
const ViewportProperty< AffineXf3f > & xfsForAllViewports () const
 returns xfs for all viewports, combined into a single object
 
virtual void setXfsForAllViewports (ViewportProperty< AffineXf3f > xf)
 modifies xfs for all viewports at once
 
MRMESH_API AffineXf3f worldXf (ViewportId id={}, bool *isDef=nullptr) const
 
MRMESH_API void setWorldXf (const AffineXf3f &xf, ViewportId id={})
 
MRMESH_API ViewportMask globalVisibilityMask () const
 returns all viewports where this object is visible together with all its parents
 
bool globalVisibility (ViewportMask viewportMask=ViewportMask::any()) const
 returns true if this object is visible together with all its parents in any of given viewports
 
MRMESH_API void setGlobalVisibility (bool on, ViewportMask viewportMask=ViewportMask::any())
 if true sets all predecessors visible, otherwise sets this object invisible
 
bool isLocked () const
 object properties lock for UI
 
virtual void setLocked (bool on)
 
bool isParentLocked () const
 
virtual void setParentLocked (bool lock)
 
const Objectparent () const
 returns parent object in the tree
 
Objectparent ()
 
MRMESH_API bool isAncestor (const Object *ancestor) const
 return true if given object is ancestor of this one, false otherwise
 
MRMESH_API ObjectfindCommonAncestor (Object &other)
 
const ObjectfindCommonAncestor (const Object &other) const
 
virtual MRMESH_API bool detachFromParent ()
 
const std::vector< std::shared_ptr< Object > > & children ()
 an object can hold other sub-objects
 
const std::vector< std::shared_ptr< const Object > > & children () const
 
virtual MRMESH_API bool addChild (std::shared_ptr< Object > child, bool recognizedChild=true)
 
virtual MRMESH_API bool addChildBefore (std::shared_ptr< Object > newChild, const std::shared_ptr< Object > &existingChild)
 
bool removeChild (const std::shared_ptr< Object > &child)
 returns false if it was not child of this
 
virtual MRMESH_API bool removeChild (Object *child)
 
virtual MRMESH_API void removeAllChildren ()
 detaches all recognized children from this, keeping all unrecognized ones
 
MRMESH_API void sortChildren ()
 sort recognized children by name
 
virtual MRMESH_API bool select (bool on)
 selects the object, returns true if value changed, otherwise returns false
 
virtual bool isSelected () const
 
virtual MRMESH_API void setAncillary (bool ancillary)
 
bool isAncillary () const
 
MRMESH_API void setVisible (bool on, ViewportMask viewportMask=ViewportMask::all())
 sets the object visible in the viewports specified by the mask (by default in all viewports)
 
bool isVisible (ViewportMask viewportMask=ViewportMask::any()) const
 checks whether the object is visible in any of the viewports specified by the mask (by default in any viewport)
 
virtual MRMESH_API void setVisibilityMask (ViewportMask viewportMask)
 specifies object visibility as bitmask of viewports
 
virtual ViewportMask visibilityMask () const
 gets object visibility as bitmask of viewports
 
void resetRedrawFlag () const
 
MRMESH_API std::shared_ptr< ObjectcloneTree () const
 clones all tree of this object (except ancillary and unrecognized children)
 
MRMESH_API std::shared_ptr< ObjectshallowCloneTree () const
 
MRMESH_API Expected< std::vector< std::future< VoidOrErrStr > > > serializeRecursive (const std::filesystem::path &path, Json::Value &root, int childId) const
 
MRMESH_API VoidOrErrStr deserializeRecursive (const std::filesystem::path &path, const Json::Value &root, ProgressCallback progressCb={}, int *objCounter=nullptr)
 
MRMESH_API void swap (Object &other)
 
MRMESH_API Box3f getWorldTreeBox (ViewportId={}) const
 returns bounding box of this object and all children visible in given (or default) viewport in world coordinates
 
virtual bool hasModel () const
 
 Object (ProtectedStruct, const Object &obj)
 
- Public Member Functions inherited from MR::ObjectChildrenHolder
 ObjectChildrenHolder ()=default
 
 ObjectChildrenHolder (const ObjectChildrenHolder &) noexcept
 
ObjectChildrenHolderoperator= (const ObjectChildrenHolder &) noexcept
 
MRMESH_API ObjectChildrenHolder (ObjectChildrenHolder &&) noexcept
 
MRMESH_API ObjectChildrenHolderoperator= (ObjectChildrenHolder &&) noexcept
 
MRMESH_API ~ObjectChildrenHolder ()
 
MRMESH_API std::shared_ptr< ObjectgetSharedPtr () const
 
MRMESH_API size_t heapBytes () const
 

Static Public Member Functions

static constexpr const char * TypeName () noexcept
 
- Static Public Member Functions inherited from MR::VisualObject
static constexpr const char * TypeName () noexcept
 
- Static Public Member Functions inherited from MR::Object
static constexpr const char * TypeName () noexcept
 

Protected Member Functions

 ObjectLabel (const ObjectLabel &other)=default
 
virtual MRSYMBOLMESH_API void swapBase_ (Object &other) override
 swaps this object with other
 
virtual MRSYMBOLMESH_API Box3f computeBoundingBox_ () const override
 
virtual MRSYMBOLMESH_API void serializeFields_ (Json::Value &root) const override
 
virtual MRSYMBOLMESH_API void deserializeFields_ (const Json::Value &root) override
 
virtual MRSYMBOLMESH_API void setupRenderObject_ () const override
 
MRSYMBOLMESH_API void setAllVisualizeProperties_ (const AllVisualizeProperties &properties, std::size_t &pos) override
 set all visualize properties masks
 
- Protected Member Functions inherited from MR::VisualObject
 VisualObject (const VisualObject &obj)=default
 
MRMESH_API ViewportMaskgetVisualizePropertyMask_ (AnyVisualizeMaskEnum type)
 
MRMESH_API void deserializeFields_ (const Json::Value &root) override
 
MRMESH_API void boundingBoxToInfoLines_ (std::vector< std::string > &res) const
 adds information about bounding box in res
 
template<AnyVisualizeMaskEnumType T>
void setAllVisualizePropertiesForEnum (const AllVisualizeProperties &properties, std::size_t &pos)
 
template<AnyVisualizeMaskEnumType T>
void getAllVisualizePropertiesForEnum (AllVisualizeProperties &properties) const
 
- Protected Member Functions inherited from MR::Object
 Object (const Object &obj)=default
 user should not be able to call copy implicitly, use clone() function instead
 
virtual MRMESH_API void swapSignals_ (Object &other)
 
virtual MRMESH_API Expected< std::future< VoidOrErrStr > > serializeModel_ (const std::filesystem::path &path) const
 
virtual MRMESH_API VoidOrErrStr deserializeModel_ (const std::filesystem::path &path, ProgressCallback progressCb={})
 Reads model from file.
 
virtual MRMESH_API void propagateWorldXfChangedSignal_ ()
 

Protected Attributes

PositionedText label_
 
std::filesystem::path pathToFont_
 
Vector2f pivotPoint_
 
float fontHeight_ { 25.0f }
 size of label font on screen in pixels
 
float leaderLineWidth_ { 1.0f }
 width of leader line on screen in pixels
 
float sourcePointSize_ { 5.f }
 radius of source point on screen in pixels
 
float backgroundPadding_ { 8.f }
 padding of background on screen in pixels
 
ViewportMask sourcePoint_
 
ViewportMask background_
 
ViewportMask contour_
 
ViewportMask leaderLine_
 
ViewportProperty< ColorsourcePointColor_
 
ViewportProperty< ColorleaderLineColor_
 
ViewportProperty< ColorcontourColor_
 
- Protected Attributes inherited from MR::VisualObject
UniquePtr< IRenderObjectrenderObj_
 
Dirty dirty_
 
ViewportMask clipByPlane_
 
ViewportMask showLabels_
 
ViewportMask showName_
 
ViewportMask cropLabels_ = ViewportMask::all()
 
ViewportMask pickable_ = ViewportMask::all()
 enable picking by gl
 
ViewportMask invertNormals_
 invert mesh normals
 
ViewportMask depthTest_ = ViewportMask::all()
 
ViewportProperty< ColorlabelsColor_ = {}
 
float shininess_ {35.0f}
 specular exponent
 
float specularStrength_ { 0.5f }
 
float ambientStrength_ { 0.1f }
 
ColoringType coloringType_ {ColoringType::SolidColor}
 Main coloring options.
 
VertColors vertsColorMap_
 
ViewportProperty< ColorselectedColor_
 
ViewportProperty< ColorunselectedColor_
 
ViewportProperty< ColorbackFacesColor_
 
ViewportProperty< uint8_t > globalAlpha_ { 255 }
 
std::vector< PositionedTextlabels_
 
bool useDefaultScenePropertiesOnDeserialization_ { false }
 
- Protected Attributes inherited from MR::Object
std::string name_
 
ViewportProperty< AffineXf3fxf_
 
ViewportMask visibilityMask_ = ViewportMask::all()
 
bool locked_ = false
 
bool parentLocked_ = false
 
bool selected_ { false }
 
bool ancillary_ { false }
 
bool needRedraw_ {false}
 
- Protected Attributes inherited from MR::ObjectChildrenHolder
ObjectChildrenHolderparent_ = nullptr
 
std::vector< std::shared_ptr< Object > > children_
 
std::vector< std::weak_ptr< Object > > bastards_
 recognized ones
 

Additional Inherited Members

- Public Types inherited from MR::Object
using XfChangedSignal = Signal<void() >
 
- Public Attributes inherited from MR::Object
XfChangedSignal worldXfChangedSignal
 

Detailed Description

This object type renders label in scene

default pivot point = (0, 0)

Constructor & Destructor Documentation

◆ ObjectLabel() [1/4]

MRSYMBOLMESH_API MR::ObjectLabel::ObjectLabel ( )

◆ ObjectLabel() [2/4]

MR::ObjectLabel::ObjectLabel ( ObjectLabel && )
defaultnoexcept

◆ ObjectLabel() [3/4]

MR::ObjectLabel::ObjectLabel ( ProtectedStruct ,
const ObjectLabel & obj )
inline
Note
this ctor is public only for std::make_shared used inside clone()

◆ ObjectLabel() [4/4]

MR::ObjectLabel::ObjectLabel ( const ObjectLabel & other)
protecteddefault

Member Function Documentation

◆ applyScale()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::applyScale ( float scaleFactor)
overridevirtual

scale object size (all point positions)

Reimplemented from MR::Object.

◆ buildMeshFromText()

MRSYMBOLMESH_API void MR::ObjectLabel::buildMeshFromText ( ) const

Loads font, and converts the symbols of text into mesh; since this operation is time consuming, one can call this method in parallel for several ObjectLabels before rendering

◆ clone()

virtual MRSYMBOLMESH_API std::shared_ptr< Object > MR::ObjectLabel::clone ( ) const
overridevirtual

clones this object only, without its children, making new object the owner of all copied resources

Reimplemented from MR::VisualObject.

◆ computeBoundingBox_()

virtual MRSYMBOLMESH_API Box3f MR::ObjectLabel::computeBoundingBox_ ( ) const
overrideprotectedvirtual

Reimplemented from MR::VisualObject.

◆ deserializeFields_()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::deserializeFields_ ( const Json::Value & root)
overrideprotectedvirtual

Reads parameters from json value

Note
if you override this method, please call Base::deserializeFields_(root) in the beginning

Reimplemented from MR::Object.

◆ getAllVisualizeProperties()

MRSYMBOLMESH_API AllVisualizeProperties MR::ObjectLabel::getAllVisualizeProperties ( ) const
overridevirtual

get all visualize properties masks

Reimplemented from MR::VisualObject.

◆ getBackgroundPadding()

float MR::ObjectLabel::getBackgroundPadding ( ) const
inline

returns background padding in pixels

◆ getContourColor()

const Color & MR::ObjectLabel::getContourColor ( ViewportId id = {}) const
inline

return contour color

◆ getContourColorsForAllViewports()

MRSYMBOLMESH_API const ViewportProperty< Color > & MR::ObjectLabel::getContourColorsForAllViewports ( ) const

◆ getFontHeight()

float MR::ObjectLabel::getFontHeight ( ) const
inline

returns size of label font on screen in pixels

◆ getFontPath()

const std::filesystem::path & MR::ObjectLabel::getFontPath ( ) const
inline

◆ getLabel()

const PositionedText & MR::ObjectLabel::getLabel ( ) const
inline

◆ getLeaderLineColor()

const Color & MR::ObjectLabel::getLeaderLineColor ( ViewportId id = {}) const
inline

return color of leader line

◆ getLeaderLineColorsForAllViewports()

MRSYMBOLMESH_API const ViewportProperty< Color > & MR::ObjectLabel::getLeaderLineColorsForAllViewports ( ) const

◆ getLeaderLineWidth()

float MR::ObjectLabel::getLeaderLineWidth ( ) const
inline

returns width of leader line in pixels

◆ getPivotPoint()

const Vector2f & MR::ObjectLabel::getPivotPoint ( ) const
inline

get pivot point

◆ getPivotShift()

const Vector2f & MR::ObjectLabel::getPivotShift ( ) const
inline

get pivot shift (pivot point * text diagonal)

◆ getSourcePointColor()

const Color & MR::ObjectLabel::getSourcePointColor ( ViewportId id = {}) const
inline

returns color of source point

◆ getSourcePointColorsForAllViewports()

MRSYMBOLMESH_API const ViewportProperty< Color > & MR::ObjectLabel::getSourcePointColorsForAllViewports ( ) const

◆ getSourcePointSize()

float MR::ObjectLabel::getSourcePointSize ( ) const
inline

returns size of source point in pixels

◆ getVisualizePropertyMask()

MRSYMBOLMESH_API const ViewportMask & MR::ObjectLabel::getVisualizePropertyMask ( AnyVisualizeMaskEnum type) const
overridevirtual

returns mask of viewports where given property is set

Reimplemented from MR::VisualObject.

◆ getWorldBox()

virtual MRSYMBOLMESH_API Box3f MR::ObjectLabel::getWorldBox ( ViewportId = {}) const
overridevirtual

returns cached bounding box of this label object in world coordinates; if you need bounding box in local coordinates please call getBoundingBox()

Reimplemented from MR::VisualObject.

◆ hasVisualRepresentation()

virtual bool MR::ObjectLabel::hasVisualRepresentation ( ) const
inlineoverridevirtual

does the object have any visual representation (visible points, triangles, edges, etc.), no considering child objects

Reimplemented from MR::Object.

◆ heapBytes()

virtual MRSYMBOLMESH_API size_t MR::ObjectLabel::heapBytes ( ) const
nodiscardoverridevirtual

returns the amount of memory this object occupies on heap

Reimplemented from MR::VisualObject.

◆ labelRepresentingMesh()

const std::shared_ptr< Mesh > & MR::ObjectLabel::labelRepresentingMesh ( ) const
inline

returns mesh that represents current label only used in Render object for binding, cleared after it

◆ operator=()

ObjectLabel & MR::ObjectLabel::operator= ( ObjectLabel && )
defaultnoexcept

◆ serializeFields_()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::serializeFields_ ( Json::Value & root) const
overrideprotectedvirtual

Write parameters to given Json::Value,

Note
if you override this method, please call Base::serializeFields_(root) in the beginning

Reimplemented from MR::VisualObject.

◆ setAllVisualizeProperties_()

MRSYMBOLMESH_API void MR::ObjectLabel::setAllVisualizeProperties_ ( const AllVisualizeProperties & properties,
std::size_t & pos )
overrideprotectedvirtual

set all visualize properties masks

Reimplemented from MR::VisualObject.

◆ setBackgroundPadding()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setBackgroundPadding ( float padding)
virtual

sets background padding in pixels

◆ setContourColor()

MRSYMBOLMESH_API void MR::ObjectLabel::setContourColor ( const Color & color,
ViewportId id = {} )

sets contour color

◆ setContourColorsForAllViewports()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setContourColorsForAllViewports ( ViewportProperty< Color > val)
virtual

◆ setFontHeight()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setFontHeight ( float size)
virtual

sets size of label font in pixels

◆ setFontPath()

MRSYMBOLMESH_API void MR::ObjectLabel::setFontPath ( const std::filesystem::path & pathToFont)

sets path to font file

◆ setLabel()

MRSYMBOLMESH_API void MR::ObjectLabel::setLabel ( const PositionedText & label)

sets text and position of label

◆ setLeaderLineColor()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setLeaderLineColor ( const Color & color,
ViewportId id = {} )
virtual

sets color of leader line

◆ setLeaderLineColorsForAllViewports()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setLeaderLineColorsForAllViewports ( ViewportProperty< Color > val)
virtual

◆ setLeaderLineWidth()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setLeaderLineWidth ( float width)
virtual

sets width of leader line in pixels

◆ setPivotPoint()

MRSYMBOLMESH_API void MR::ObjectLabel::setPivotPoint ( const Vector2f & pivotPoint)

set pivot point

Parameters
pivotPoint- text location parameter of relative to text position point [0, 0] - text position point is left-down corner of text [1, 1] - text position point is right-up corner can be outside range [0, 0] - [1, 1]

◆ setSourcePointColor()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setSourcePointColor ( const Color & color,
ViewportId id = {} )
virtual

sets color of source point

◆ setSourcePointColorsForAllViewports()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setSourcePointColorsForAllViewports ( ViewportProperty< Color > val)
virtual

◆ setSourcePointSize()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setSourcePointSize ( float size)
virtual

sets size of source point in pixels

◆ setupRenderObject_()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::setupRenderObject_ ( ) const
overrideprotectedvirtual

each renderable child of VisualObject should implement this method and assign renderObj_ inside

Reimplemented from MR::VisualObject.

◆ shallowClone()

virtual MRSYMBOLMESH_API std::shared_ptr< Object > MR::ObjectLabel::shallowClone ( ) const
overridevirtual

clones this object only, without its children, making new object to share resources with this object

Reimplemented from MR::VisualObject.

◆ swapBase_()

virtual MRSYMBOLMESH_API void MR::ObjectLabel::swapBase_ ( Object & other)
overrideprotectedvirtual

swaps this object with other

Reimplemented from MR::VisualObject.

◆ TypeName()

static constexpr const char * MR::ObjectLabel::TypeName ( )
inlinestaticconstexprnoexcept

◆ typeName()

virtual const char * MR::ObjectLabel::typeName ( ) const
inlineoverridevirtual

Reimplemented from MR::VisualObject.

Member Data Documentation

◆ background_

ViewportMask MR::ObjectLabel::background_
protected

◆ backgroundPadding_

float MR::ObjectLabel::backgroundPadding_ { 8.f }
protected

padding of background on screen in pixels

◆ contour_

ViewportMask MR::ObjectLabel::contour_
protected

◆ contourColor_

ViewportProperty<Color> MR::ObjectLabel::contourColor_
protected

◆ fontHeight_

float MR::ObjectLabel::fontHeight_ { 25.0f }
protected

size of label font on screen in pixels

◆ label_

PositionedText MR::ObjectLabel::label_
protected

◆ leaderLine_

ViewportMask MR::ObjectLabel::leaderLine_
protected

◆ leaderLineColor_

ViewportProperty<Color> MR::ObjectLabel::leaderLineColor_
protected

◆ leaderLineWidth_

float MR::ObjectLabel::leaderLineWidth_ { 1.0f }
protected

width of leader line on screen in pixels

◆ pathToFont_

std::filesystem::path MR::ObjectLabel::pathToFont_
protected

◆ pivotPoint_

Vector2f MR::ObjectLabel::pivotPoint_
protected

◆ sourcePoint_

ViewportMask MR::ObjectLabel::sourcePoint_
protected

◆ sourcePointColor_

ViewportProperty<Color> MR::ObjectLabel::sourcePointColor_
protected

◆ sourcePointSize_

float MR::ObjectLabel::sourcePointSize_ { 5.f }
protected

radius of source point on screen in pixels


The documentation for this class was generated from the following file: