anpstudio 0.4.0
ANP Studio — Analytic Network Process desktop application
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | List of all members
NetworkCanvas Class Reference

Visual editor for clusters, nodes, and connections. More...

#include <network_canvas.hpp>

Inherits QGraphicsView.

Signals

void nodeActivated (const QString &name)
 Emitted to open a node's subnetwork (e.g.
 
void selectionChanged (const QString &cluster, const QString &node)
 Emitted when the user selects a cluster or node on the canvas.
 
void connectModeChanged (bool on)
 Emitted when Connection mode is entered or left.
 

Public Member Functions

 NetworkCanvas (Document *doc, QWidget *parent=nullptr)
 
void rebuild ()
 Rebuilds scene items from the current network.
 
void persistLayout ()
 Writes current cluster item positions into the model.
 
void organizeClusters ()
 Topology-aware auto-layout of cluster windows (undoable).
 
void setConnectMode (bool on)
 Enables or disables Connection mode.
 
bool connectMode () const
 
void select (const QString &cluster, const QString &node)
 Highlights a cluster/node from Document selection.
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *event) override
 Shows context menu for add/connect operations (Normal mode only).
 
void mousePressEvent (QMouseEvent *event) override
 Handles Connection-mode clicks and Normal-mode interaction.
 

Detailed Description

Visual editor for clusters, nodes, and connections.

Supports Connection mode for multi-source link editing and persists layout positions back to the Document model.

Constructor & Destructor Documentation

◆ NetworkCanvas()

NetworkCanvas::NetworkCanvas ( Document doc,
QWidget *  parent = nullptr 
)
explicit
Parameters
docDocument whose network is displayed.
parentOptional parent widget.

Member Function Documentation

◆ connectMode()

bool NetworkCanvas::connectMode ( ) const
inline
Returns
True when Connection mode is active.

◆ nodeActivated

void NetworkCanvas::nodeActivated ( const QString &  name)
signal

Emitted to open a node's subnetwork (e.g.

from context menu).

◆ persistLayout()

void NetworkCanvas::persistLayout ( )

Writes current cluster item positions into the model.

Call before save so drags are not lost when no rebuild has run yet.


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