|
anpstudio 0.4.0
ANP Studio — Analytic Network Process desktop application
|
Owns the root anpcpp::AnpNetwork, undo stack, file path, and dirty flag.
More...
#include <document.hpp>
Inherits QObject.
Signals | |
| void | sessionChanged () |
| Emitted when the judgment session scope or roster changes. | |
| void | researcherSessionChanged () |
| Emitted when the Researcher session is replaced (load / new). | |
| void | linkedFormsChanged () |
| Emitted when the linked Google Forms list changes. | |
Public Member Functions | |
| const QVector< ResearcherNotebook > & | researcherNotebooks () const |
| int | researcherActiveIndex () const |
| void | setResearcherSession (QVector< ResearcherNotebook > notebooks, int activeIndex) |
| Replaces the Researcher session (does not emit session changed). | |
| void | clearResearcherSession () |
| Clears Researcher notebooks without emitting session changed. | |
| const QVector< LinkedGoogleForm > & | linkedGoogleForms () const |
| void | addLinkedGoogleForm (const LinkedGoogleForm &form) |
| Appends a linked form and marks dirty. | |
| void | removeLinkedGoogleForm (const QString &formId) |
| Removes by form id. | |
| const LinkedGoogleForm * | latestLinkedGoogleForm () const |
| anpcpp::AnpNetwork * | networkAtPath (const QString &path) const |
| Returns the network at a breadcrumb path without changing the view. | |
| bool | hasParticipants () const |
| const std::vector< anpcpp::JudgmentParticipant > & | participants () const |
| const std::vector< anpcpp::JudgmentGroup > & | judgmentGroups () const |
| anpcpp::JudgmentSession | judgmentSession () const |
| void | setJudgmentSession (const anpcpp::JudgmentSession &session) |
| Sets the session scope, rebuilds effective judgments on the root network, and marks the document dirty. | |
| anpcpp::JudgmentParticipant & | addParticipant (const QString &id, const QString &name, const QString &email={}) |
Adds (or renames, if id already exists) a participant. | |
| void | removeParticipant (const QString &id) |
| Removes a participant and their judgment tables. | |
| anpcpp::JudgmentGroup & | setJudgmentGroup (const QString &id, const QString &name, const QStringList &memberIds) |
| Adds or updates a named group of participant ids. | |
| void | removeJudgmentGroup (const QString &id) |
| Removes a named group. | |
| QByteArray | snapshotNetworkJson () const |
| Serializes the root ANP network only (no researcher / google_forms). | |
| void | applyNetworkJson (const QByteArray &bytes) |
| Replaces the root network from snapshotNetworkJson bytes. | |
| void | rebuildEffectiveJudgments () |
| Rebuilds effective judgments from the root network downward. | |
| QString | activeParticipantId () const |
| bool | judgmentReadOnly () const |
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.
File I/O wraps libanpcpp network JSON and may include an optional top-level researcher notebook block (Studio extension; ignored by older tools).
| QString Document::activeParticipantId | ( | ) | const |
| void Document::addLinkedGoogleForm | ( | const LinkedGoogleForm & | form | ) |
Appends a linked form and marks dirty.
Emits linkedFormsChanged.
| anpcpp::JudgmentParticipant & Document::addParticipant | ( | const QString & | id, |
| const QString & | name, | ||
| const QString & | email = {} |
||
| ) |
Adds (or renames, if id already exists) a participant.
Ensures per-user judgment tables exist and rebuilds effective judgments.
| void Document::applyNetworkJson | ( | const QByteArray & | bytes | ) |
Replaces the root network from snapshotNetworkJson bytes.
Preserves the undo stack, file path, Researcher notebooks, and linked Google Forms. Resets the subnet view stack to root and refreshes UI.
|
inline |
|
inline |
| bool Document::judgmentReadOnly | ( | ) | const |
|
inline |
| const LinkedGoogleForm * Document::latestLinkedGoogleForm | ( | ) | const |
|
inline |
| anpcpp::AnpNetwork * Document::networkAtPath | ( | const QString & | path | ) | const |
Returns the network at a breadcrumb path without changing the view.
| path | e.g. "Root" or "Root / Node" (same form as networkPathOptions()). |
path is invalid.
|
inline |
| void Document::rebuildEffectiveJudgments | ( | ) |
Rebuilds effective judgments from the root network downward.
Call after any per-participant judgment edit (via *_for network calls). Marks the document dirty and triggers a UI refresh.
|
inline |
|
inline |
|
signal |
Emitted when the Researcher session is replaced (load / new).
Not emitted for incremental edits via setResearcherSession().
| void Document::setJudgmentSession | ( | const anpcpp::JudgmentSession & | session | ) |
Sets the session scope, rebuilds effective judgments on the root network, and marks the document dirty.
Emits sessionChanged.
| void Document::setResearcherSession | ( | QVector< ResearcherNotebook > | notebooks, |
| int | activeIndex | ||
| ) |
Replaces the Researcher session (does not emit session changed).
Callers that edit notebooks should also call setDirty().
| QByteArray Document::snapshotNetworkJson | ( | ) | const |
Serializes the root ANP network only (no researcher / google_forms).
Used for undo snapshots of remove-participant and bulk judgment imports.