LabelNode

Search for usage in LXR

#include <labelnode.h>

Inheritance diagram for LabelNode:

Public Member Functions

 LabelNode (QString name, LabelsItem::label_t type)
 
 LabelNode (SkyObject *skyObject, LabelsItem::label_t type)
 
virtual ~LabelNode ()
 
virtual void changePos (QPointF pos) override
 
void createTexture (QColor color=QColor())
 
void initialize ()
 
LabelsItem::label_t labelType ()
 
QString name ()
 
void setLabelPos (QPointF pos)
 
virtual void update () override
 
bool zoomFont ()
 
- Public Member Functions inherited from SkyNode
 SkyNode (SkyObject *skyObject)
 
void addChildNode (QSGNode *node)
 
virtual void hide ()
 
int hideCount ()
 
SkyMapLitemap () const
 
const Projectorprojector ()
 
virtual void show ()
 
SkyObjectskyObject () const
 
void update (bool drawLabel)
 
bool visible ()
 
- Public Member Functions inherited from QSGTransformNode
const QMatrix4x4matrix () const const
 
void setMatrix (const QMatrix4x4 &matrix)
 
- Public Member Functions inherited from QSGNode
void appendChildNode (QSGNode *node)
 
QSGNodechildAtIndex (int i) const const
 
int childCount () const const
 
QSGNodefirstChild () const const
 
Flags flags () const const
 
void insertChildNodeAfter (QSGNode *node, QSGNode *after)
 
void insertChildNodeBefore (QSGNode *node, QSGNode *before)
 
virtual bool isSubtreeBlocked () const const
 
QSGNodelastChild () const const
 
void markDirty (DirtyState bits)
 
QSGNodenextSibling () const const
 
QSGNodeparent () const const
 
void prependChildNode (QSGNode *node)
 
virtual void preprocess ()
 
QSGNodepreviousSibling () const const
 
void removeAllChildNodes ()
 
void removeChildNode (QSGNode *node)
 
void setFlag (Flag f, bool enabled)
 
void setFlags (Flags f, bool enabled)
 
NodeType type () const const
 

Public Attributes

QPointF labelPos
 
- Public Attributes inherited from SkyNode
SkyOpacityNodem_opacity { nullptr }
 
- Public Attributes inherited from QSGNode
 BasicNodeType
 
 ClipNodeType
 
 DirtyForceUpdate
 
 DirtyGeometry
 
 DirtyMaterial
 
 DirtyMatrix
 
 DirtyNodeAdded
 
 DirtyNodeRemoved
 
 DirtyOpacity
 
 DirtyPropagationMask
 
 DirtySubtreeBlocked
 
 DirtyUsePreprocess
 
 GeometryNodeType
 
 InternalReserved
 
 IsVisitableNode
 
 OpacityNodeType
 
 OwnedByParent
 
 OwnsGeometry
 
 OwnsMaterial
 
 OwnsOpaqueMaterial
 
 RenderNodeType
 
 RootNodeType
 
 TransformNodeType
 
 UsePreprocess
 

Additional Inherited Members

- Public Types inherited from QSGNode
typedef  DirtyState
 
enum  DirtyStateBit
 
enum  Flag
 
typedef  Flags
 
enum  NodeType
 
- Protected Attributes inherited from SkyNode
bool m_drawLabel { false }
 
int m_hideCount { 0 }
 
SkyObjectm_skyObject { nullptr }
 

Detailed Description

A SkyNode derived class used for displaying labels.

Author
Artem Fedoskin
Version
1.0

Definition at line 26 of file labelnode.h.

Constructor & Destructor Documentation

◆ LabelNode() [1/2]

LabelNode::LabelNode ( SkyObject * skyObject,
LabelsItem::label_t type )

Constructor.

Use name of skyObject as a text

Parameters
skyObject- target object, for which this label is created.
type- type of label (corresponds to type of SkyObject)

Definition at line 15 of file labelnode.cpp.

◆ LabelNode() [2/2]

LabelNode::LabelNode ( QString name,
LabelsItem::label_t type )

Constructor.

Use string parameter name as a text

Parameters
name- text of label
type- type of label (corresponds to type of SkyObject)

Definition at line 22 of file labelnode.cpp.

◆ ~LabelNode()

LabelNode::~LabelNode ( )
virtual

Destructor.

Definition at line 28 of file labelnode.cpp.

Member Function Documentation

◆ changePos()

void LabelNode::changePos ( QPointF pos)
overridevirtual

Changes position of the label.

Parameters
pos- new position

Reimplemented from SkyNode.

Definition at line 114 of file labelnode.cpp.

◆ createTexture()

void LabelNode::createTexture ( QColor color = QColor())

Create texture from label's name.

Parameters
color- color of the label

Definition at line 74 of file labelnode.cpp.

◆ initialize()

void LabelNode::initialize ( )

Convenience function to not to repeat the same code in 2 constructors.

Set parameters of label based on its type

Definition at line 35 of file labelnode.cpp.

◆ labelType()

LabelsItem::label_t LabelNode::labelType ( )
inline

Definition at line 62 of file labelnode.h.

◆ name()

QString LabelNode::name ( )
inline

Definition at line 60 of file labelnode.h.

◆ setLabelPos()

void LabelNode::setLabelPos ( QPointF pos)

set the position of label with the given offset from SkyObject's position and makes the label visible if it was hidden

Warning
Keep mind that to update labels position, you should first set it with setLabelPos() and then call update()
Parameters
posposition of label

Definition at line 123 of file labelnode.cpp.

◆ update()

void LabelNode::update ( )
overridevirtual

Update position of label according to labelPos and recreate texture if label's size depends on zoom level.

Reimplemented from SkyNode.

Definition at line 135 of file labelnode.cpp.

◆ zoomFont()

bool LabelNode::zoomFont ( )
inline
Returns
true if the size of text depends on zoom

Definition at line 73 of file labelnode.h.

Member Data Documentation

◆ labelPos

QPointF LabelNode::labelPos

Definition at line 90 of file labelnode.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:57:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.