anpstudio 0.1.0
ANP Studio — Analytic Network Process desktop application
Loading...
Searching...
No Matches
pairwise_panel.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <QWidget>
9
10#include "anpcpp/pairwise.hpp"
11
12class Document;
13class QTableWidget;
14class QLabel;
15class QStackedWidget;
16class QScrollArea;
17class QPushButton;
18class QButtonGroup;
19class QVBoxLayout;
20
26class PairwisePanel : public QWidget {
27 Q_OBJECT
28public:
33 explicit PairwisePanel(Document* doc, QWidget* parent = nullptr);
34
35public slots:
37 void refresh();
39 void selectNodeParent(const QString& name);
41 void selectNodeLink(const QString& parent, const QString& destCluster);
43 void selectClusterParent(const QString& name);
44
45private slots:
46 void onCellChanged(int row, int col);
47 void onViewModeChanged();
48 void onQuestionnaireAnswered(int row, int col, double value);
49
50private:
51 void rebuildViews();
52 void rebuildMatrix(const anpcpp::PairwiseJudgments* pw);
53 void rebuildQuestionnaire(const anpcpp::PairwiseJudgments* pw);
54 void updateInfo(const anpcpp::PairwiseJudgments* pw);
55 [[nodiscard]] const anpcpp::PairwiseJudgments* currentPairwise() const;
56 void applyComparison(const QString& a, const QString& b, double value);
57 [[nodiscard]] bool nodeMode() const { return nodeMode_; }
58
59 Document* doc_ = nullptr;
60 bool nodeMode_ = true;
61 QString parent_;
62 QString destCluster_;
63
64 QPushButton* matrixBtn_ = nullptr;
65 QPushButton* questionnaireBtn_ = nullptr;
66 QButtonGroup* viewGroup_ = nullptr;
67 QStackedWidget* views_ = nullptr;
68 QTableWidget* table_ = nullptr;
69 QScrollArea* questionnaireScroll_ = nullptr;
70 QWidget* questionnaireHost_ = nullptr;
71 QVBoxLayout* questionnaireLay_ = nullptr;
72 QLabel* info_ = nullptr;
73 bool updating_ = false;
74};
Owns the root anpcpp::AnpNetwork, undo stack, file path, and dirty flag.
Definition document.hpp:23
Pairwise judgment editor with Matrix and Questionnaire views.
Definition pairwise_panel.hpp:26
PairwisePanel(Document *doc, QWidget *parent=nullptr)
void selectClusterParent(const QString &name)
Selects a cluster as the comparison parent (w.r.t.
void selectNodeParent(const QString &name)
Selects a node as the comparison parent (w.r.t.
void refresh()
Rebuilds the active view for the current selection.
void selectNodeLink(const QString &parent, const QString &destCluster)
Selects node parent and destination cluster.