Owns the root anpcpp::AnpNetwork, undo stack, file path, and dirty flag.
More...
#include <document.hpp>
Inherits QObject.
|
|
void | modelChanged () |
| | Emitted when the model structure or data changes.
|
| |
|
void | dirtyChanged (bool dirty) |
| | Emitted when the dirty flag changes.
|
| |
|
void | pathChanged (const QString &path) |
| | Emitted when the file path changes.
|
| |
|
void | viewNetworkChanged () |
| | Emitted when the active network view changes (subnet navigation).
|
| |
|
void | selectionChanged (const QString &cluster, const QString &node) |
| | Emitted when soft selection changes.
|
| |
|
void | resultsFreshnessChanged () |
| | Emitted when calc freshness changes.
|
| |
|
| | Document (QObject *parent=nullptr) |
| |
| anpcpp::AnpNetwork & | network () |
| |
|
const anpcpp::AnpNetwork & | network () const |
| | Const overload of network.
|
| |
| anpcpp::AnpNetwork & | root () |
| |
|
const anpcpp::AnpNetwork & | root () const |
| | Const overload of root.
|
| |
| QUndoStack * | undoStack () |
| |
| QString | path () const |
| |
| bool | isDirty () const |
| |
|
void | setDirty (bool dirty) |
| | Sets the dirty flag and emits dirtyChanged when it changes.
|
| |
|
void | newNetwork (bool create_alts=true) |
| | Replaces the model with a new empty network.
|
| |
| bool | loadFromFile (const QString &path, QString *error=nullptr) |
| | Loads a network from JSON file.
|
| |
| bool | saveToFile (const QString &path, QString *error=nullptr) |
| | Saves the root network to JSON.
|
| |
|
void | pushSubnet (const QString &nodeName) |
| | Descends into a node's subnetwork for editing.
|
| |
|
void | popSubnet () |
| | Returns to the parent network in the subnet stack.
|
| |
|
void | popToRoot () |
| | Clears the subnet stack back to the root network.
|
| |
| void | popToDepth (int depth) |
| | Pops the subnet stack to depth frames (1 = root only).
|
| |
| int | subnetDepth () const |
| |
| QStringList | breadcrumb () const |
| |
|
void | notifyChanged () |
| | Marks the document dirty and emits modelChanged.
|
| |
| QString | selectedCluster () const |
| |
| QString | selectedNode () const |
| |
| void | setSelection (const QString &cluster, const QString &node) |
| | Soft-persists structure selection across stages.
|
| |
| bool | hasResults () const |
| |
| bool | resultsStale () const |
| |
|
void | markResultsCurrent () |
| | Marks results current after a successful Calculate.
|
| |
|
void | invalidateResults () |
| | Marks results stale (or clears hasResults if never calculated).
|
| |
Owns the root anpcpp::AnpNetwork, undo stack, file path, and dirty flag.
Subnet navigation maintains a stack of AnpNetwork* frames pointing into nodes' owned subnetworks.
◆ Document()
| Document::Document |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
- Parameters
-
| parent | Optional Qt parent object. |
◆ breadcrumb()
| QStringList Document::breadcrumb |
( |
| ) |
const |
- Returns
- Breadcrumb trail of host node names for the current view.
◆ hasResults()
| bool Document::hasResults |
( |
| ) |
const |
|
inline |
- Returns
- True if Calculate has produced a results snapshot.
◆ isDirty()
| bool Document::isDirty |
( |
| ) |
const |
|
inline |
- Returns
- True if there are unsaved changes.
◆ loadFromFile()
| bool Document::loadFromFile |
( |
const QString & |
path, |
|
|
QString * |
error = nullptr |
|
) |
| |
Loads a network from JSON file.
- Parameters
-
| path | File to read. |
| error | Optional error message output. |
- Returns
- False on failure.
◆ network()
| anpcpp::AnpNetwork & Document::network |
( |
| ) |
|
- Returns
- The network currently being edited (may be a subnetwork).
◆ path()
| QString Document::path |
( |
| ) |
const |
|
inline |
- Returns
- Current file path (empty if unsaved).
◆ popToDepth()
| void Document::popToDepth |
( |
int |
depth | ) |
|
Pops the subnet stack to depth frames (1 = root only).
- Parameters
-
| depth | Target stack size; values < 1 are treated as 1. |
◆ resultsStale()
| bool Document::resultsStale |
( |
| ) |
const |
|
inline |
- Returns
- True if the model changed since the last successful Calculate.
◆ root()
| anpcpp::AnpNetwork & Document::root |
( |
| ) |
|
- Returns
- The root (top-level) network.
◆ saveToFile()
| bool Document::saveToFile |
( |
const QString & |
path, |
|
|
QString * |
error = nullptr |
|
) |
| |
Saves the root network to JSON.
- Parameters
-
| path | Output path. |
| error | Optional error message output. |
- Returns
- False on failure.
◆ selectedCluster()
| QString Document::selectedCluster |
( |
| ) |
const |
|
inline |
- Returns
- Selected cluster name (may be empty).
◆ selectedNode()
| QString Document::selectedNode |
( |
| ) |
const |
|
inline |
- Returns
- Selected node name (may be empty).
◆ setSelection()
| void Document::setSelection |
( |
const QString & |
cluster, |
|
|
const QString & |
node |
|
) |
| |
Soft-persists structure selection across stages.
- Parameters
-
| cluster | Selected cluster (empty if node-only). |
| node | Selected node (empty if cluster-only). |
◆ subnetDepth()
| int Document::subnetDepth |
( |
| ) |
const |
- Returns
- Number of subnet frames above root (0 at root).
◆ undoStack()
| QUndoStack * Document::undoStack |
( |
| ) |
|
|
inline |
- Returns
- Undo/redo command stack for model edits.
The documentation for this class was generated from the following file: