Base class for all graphical nodes.
More...
#include <node_base.h>
|
| | NodeBase (const QString &id, const QString &nodeId, std::shared_ptr< NodeConfig > config, QGraphicsItem *parent) |
| | Constructs a new NodeBase instance.
|
|
virtual | ~NodeBase () |
| | Destructor.
|
| QString | id () const |
| | Retrieves the unique identifier of the node.
|
| virtual int | type () const override |
| | Returns the type of the node.
|
| virtual QString | nodeId () const |
| | Retrieves the identifier of the node within its type.
|
| virtual VoidResult | start () |
| | Starts the node.
|
| virtual std::shared_ptr< NodeConfig > | config () const |
| | Retrieves the configuration settings for the node.
|
| virtual QRectF | boundingRect () const override |
| | Returns the bounding rectangle of the node.
|
| virtual QRectF | labelBoundingRect () const |
| | Returns the bounding rectangle of the label.
|
| virtual QRectF | scaledRect () const |
| | Returns the scaled rectangle of the node.
|
| virtual QRectF | drawingRect (const QRectF &input) const |
| | Returns the drawing rectangle based on the input rectangle.
|
| virtual QPainterPath | nodeShape (const QRectF &bounds) const |
| | Returns the node shape as a QPainterPath.
|
| void | paintNode (const QRectF &bounds, const QColor &background, const QPen &text, QPainter *painter) |
| | Paints the node using the provided painter.
|
| virtual QPixmap | nodePixmap () const |
| | Retrieves the pixmap of the node.
|
| virtual QString | nodeIcon () const |
| | Retrieves the icon path of the node.
|
|
virtual void | toggleLabelVisibility () |
| | Toggles the visibility of the label.
|
|
| virtual void | setPixmap (const QPixmap &pixmap) |
| | Pointer to the SVG icon item.
|
| virtual void | setIcon (const QString &path, const QColor &iconColor) |
| | Sets the icon for the node.
|
| virtual void | setLabel (const QString &name, qreal fontSize) |
| | Sets the label text and font size.
|
| virtual void | setLabelName (const QString &name) |
| | Sets the label text.
|
| virtual void | setLabelSize (qreal fontSize, const QSizeF &boundingSize) |
| | Sets the font size and bounding size for the label.
|
| virtual void | paintLabel (QPainter *painter, const QRectF &area, const QPen &pen) const |
| | Paints the label using the provided painter.
|
| virtual void | paintPixmap (QPainter *painter) const |
| | Paints the pixmap using the provided painter.
|
|
|
QGraphicsPixmapItem * | mPixmapItem = nullptr |
| | Configuration settings for the node.
|
|
QString | mIconPath = "" |
| | Pointer to the pixmap item.
|
|
QGraphicsSvgItem * | mIconItem = nullptr |
| | Path to the icon image.
|
|
|
const QRectF | mBounds |
| | Unique identifier of the node.
|
|
QString | mLabelText |
| | Bounding rectangle of the node.
|
Base class for all graphical nodes.
◆ NodeBase()
| NodeBase::NodeBase |
( |
const QString & | id, |
|
|
const QString & | nodeId, |
|
|
std::shared_ptr< NodeConfig > | config, |
|
|
QGraphicsItem * | parent ) |
Constructs a new NodeBase instance.
- Parameters
-
| id | Unique identifier for the node. |
| nodeId | Identifier of the node within its type. |
| config | Configuration settings for the node. |
| parent | Parent QGraphicsItem. |
◆ boundingRect()
| QRectF NodeBase::boundingRect |
( |
| ) |
const |
|
overridevirtual |
Returns the bounding rectangle of the node.
- Returns
- The bounding rectangle.
◆ computeScaleFactor()
| qreal NodeBase::computeScaleFactor |
( |
| ) |
const |
|
private |
Scaled bounding rectangle of the node.
Computes the scale factor for the node.
- Returns
- The computed scale factor.
◆ config()
| std::shared_ptr< NodeConfig > NodeBase::config |
( |
| ) |
const |
|
virtual |
Retrieves the configuration settings for the node.
- Returns
- The configuration settings.
◆ drawingRect()
| QRectF NodeBase::drawingRect |
( |
const QRectF & | input | ) |
const |
|
virtual |
Returns the drawing rectangle based on the input rectangle.
- Parameters
-
- Returns
- The drawing rectangle.
◆ id()
| QString NodeBase::id |
( |
| ) |
const |
Retrieves the unique identifier of the node.
- Returns
- The unique identifier.
◆ labelBoundingRect()
| QRectF NodeBase::labelBoundingRect |
( |
| ) |
const |
|
virtual |
Returns the bounding rectangle of the label.
- Returns
- The bounding rectangle of the label.
◆ nodeIcon()
| QString NodeBase::nodeIcon |
( |
| ) |
const |
|
virtual |
Retrieves the icon path of the node.
- Returns
- The icon path of the node.
◆ nodeId()
| QString NodeBase::nodeId |
( |
| ) |
const |
|
virtual |
Retrieves the identifier of the node within its type.
- Returns
- The identifier of the node within its type.
◆ nodePixmap()
| QPixmap NodeBase::nodePixmap |
( |
| ) |
const |
|
virtual |
Retrieves the pixmap of the node.
- Returns
- The pixmap of the node.
◆ nodeShape()
| QPainterPath NodeBase::nodeShape |
( |
const QRectF & | bounds | ) |
const |
|
virtual |
Returns the node shape as a QPainterPath.
- Parameters
-
| bounds | Bounding rectangle of the node. |
- Returns
- The node shape.
◆ paintLabel()
| void NodeBase::paintLabel |
( |
QPainter * | painter, |
|
|
const QRectF & | area, |
|
|
const QPen & | pen ) const |
|
protectedvirtual |
Paints the label using the provided painter.
- Parameters
-
| painter | Painter to use for drawing. |
| area | Area to paint the label in. |
◆ paintNode()
| void NodeBase::paintNode |
( |
const QRectF & | bounds, |
|
|
const QColor & | background, |
|
|
const QPen & | text, |
|
|
QPainter * | painter ) |
Paints the node using the provided painter.
- Parameters
-
| bounds | Bounding rectangle of the node. |
| background | Background color for the node. |
| text | Text pen for the label. |
| painter | Painter to use for drawing. |
◆ paintPixmap()
| void NodeBase::paintPixmap |
( |
QPainter * | painter | ) |
const |
|
protectedvirtual |
Paints the pixmap using the provided painter.
- Parameters
-
| painter | Painter to use for drawing. |
◆ scaledRect()
| QRectF NodeBase::scaledRect |
( |
| ) |
const |
|
virtual |
Returns the scaled rectangle of the node.
- Returns
- The scaled rectangle.
◆ setIcon()
| void NodeBase::setIcon |
( |
const QString & | path, |
|
|
const QColor & | iconColor ) |
|
protectedvirtual |
Sets the icon for the node.
- Parameters
-
| path | Path to the icon image. |
| iconColor | Color of the icon. |
◆ setLabel()
| void NodeBase::setLabel |
( |
const QString & | name, |
|
|
qreal | fontSize ) |
|
protectedvirtual |
Sets the label text and font size.
- Parameters
-
| name | The label text. |
| fontSize | Font size for the label. |
◆ setLabelName()
| void NodeBase::setLabelName |
( |
const QString & | name | ) |
|
|
protectedvirtual |
Sets the label text.
- Parameters
-
◆ setLabelSize()
| void NodeBase::setLabelSize |
( |
qreal | fontSize, |
|
|
const QSizeF & | boundingSize ) |
|
protectedvirtual |
Sets the font size and bounding size for the label.
- Parameters
-
| fontSize | Font size for the label. |
| boundingSize | Bounding size for the label. |
◆ setPixmap()
| void NodeBase::setPixmap |
( |
const QPixmap & | pixmap | ) |
|
|
protectedvirtual |
Pointer to the SVG icon item.
Sets the pixmap for the node.
- Parameters
-
◆ start()
| VoidResult NodeBase::start |
( |
| ) |
|
|
virtual |
Starts the node.
- Returns
- A VoidResult indicating success or failure.
Reimplemented in NodeItem.
◆ type()
| int NodeBase::type |
( |
| ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following files:
- /__w/maki/maki/app/elements/node_base.h
- /__w/maki/maki/app/elements/node_base.cpp