BCESolve
bceplothandler.hpp
1// This file is part of the BCESolve library for games of incomplete
2// information
3// Copyright (C) 2022 Benjamin A. Brooks
4//
5// BCESolve free software: you can redistribute it and/or modify it
6// under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// BCESolve is distributed in the hope that it will be useful, but
11// WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13// General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see
17// <http://www.gnu.org/licenses/>.
18//
19// Benjamin A. Brooks
20// ben@benjaminbrooks.net
21// Chicago, IL
22
23#ifndef BCEPLOTHANDLER_HPP
24#define BCEPLOTHANDLER_HPP
25
26#include <vector>
27#include <QtWidgets>
28#include "bcedatastate.hpp"
29#include "qcustomplot.h"
30#include "bcevaluesetplot.hpp"
31#include "bceenumeration.hpp"
32#include "bcelabel.hpp"
33#include "bceplottitle.hpp"
34#include <QPointer>
35
36using namespace std;
37
39
45class BCEPlotHandler : public QMainWindow
46{
47 Q_OBJECT;
48
49public:
51 BCEPlotHandler(QWidget *parent);
54 delete guiData;
55 }
57
71
72signals:
74 void sendingDataPath(QString location);
75
76public slots:
77
79
84 void plotEqm();
86
94 void plotDeviationObjectives(int player);
96
104 void plotBCEValueSet();
106 void setGUITitle();
108 void toggleLinearScale(bool checked);
110 void toggleColorfulTheme(bool checked);
111
112private:
113
115 QHBoxLayout *mainTab;
117
125
129 QCPColorMap *colorMap;
131 QCPColorScale *colorScale;
133 QAction *linearScale;
137 QCPColorGradient *mGradient;
141 QVector<BCEValueSetPlot*> deviationBarGraphs;
143 QVector<BCEPlotTitle*> devPlotTitles;
145 void setupLayout();
148
149public:
151 QHBoxLayout * getLayout() const {
152 return mainTab;
153 }
155 void setSolution(const BCESolution &solution,const bool isBoundaryMapped);
156
159 return guiData->getSolution();
160 }
161
162private slots:
163
165
170 void indicateDataLoaded();
171
172};
173
174#endif
Class for storing and manipulating solution data used by the plot handler.
Definition: bcedatastate.hpp:52
const BCESolution & getSolution() const
Shares the current BCESolution by reference.
Definition: bcedatastate.hpp:299
This class handles all the plotting in the solution tab.
Definition: bceplothandler.hpp:46
const BCESolution & getSolutionData() const
Returns the current BCESolution in BCEDataState.
Definition: bceplothandler.hpp:158
void setupLayout()
Sets up the layout of the plot handler.
Definition: bceplothandler.cpp:35
QCPColorMap * colorMap
Heatmap.
Definition: bceplothandler.hpp:129
QAction * colorfulDistn
Colorful/Blue theme toggle for colorScale.
Definition: bceplothandler.hpp:135
QHBoxLayout * getLayout() const
Returns Layout of the Plot Handler.
Definition: bceplothandler.hpp:151
void sendingDataPath(QString location)
Sends data path to BCEDataState.
BCEValueSetPlot * conditionalMarginalPlot
Heatmap template.
Definition: bceplothandler.hpp:123
BCEValueSetPlot * setOfBCEPlot
Set of BCE Plot.
Definition: bceplothandler.hpp:139
void toggleLinearScale(bool checked)
Toggles colorScale between linear and log scales.
Definition: bceplothandler.cpp:385
bool isSolnDataLoaded
Indicates if solution data is loaded in the soln tab.
Definition: bceplothandler.hpp:147
void setSolution(const BCESolution &solution, const bool isBoundaryMapped)
Sets the current BCESolution in BCEDataState.
Definition: bceplothandler.cpp:426
QHBoxLayout * mainTab
Layout for the Plot Handler.
Definition: bceplothandler.hpp:115
QCPColorScale * colorScale
Scale for heatmap colors.
Definition: bceplothandler.hpp:131
void setGUITitle()
Sets a new title for the GUI using fileName information.
Definition: bceplothandler.cpp:411
BCEDataState * guiData
Data in the current solution object.
Definition: bceplothandler.hpp:70
QVector< BCEValueSetPlot * > deviationBarGraphs
Bar Graphs.
Definition: bceplothandler.hpp:141
~BCEPlotHandler()
Destructor.
Definition: bceplothandler.hpp:53
QVector< BCEPlotTitle * > devPlotTitles
Plot titles for the deviation bar plots.
Definition: bceplothandler.hpp:143
void plotBCEValueSet()
Plots set of equilibria player payoffs.
Definition: bceplothandler.cpp:242
void toggleColorfulTheme(bool checked)
Toggles color gradient between blue and gpSpectrum themes.
Definition: bceplothandler.cpp:397
QAction * linearScale
Linear/Log incrementation toggle for colorScale.
Definition: bceplothandler.hpp:133
void plotEqm()
Plots Bayes Correlated Equilibria.
Definition: bceplothandler.cpp:208
QCPColorGradient * mGradient
Color of heatmap colorScale.
Definition: bceplothandler.hpp:137
void plotDeviationObjectives(int player)
Plots Bar Graphs for Player Deviation Objectives.
Definition: bceplothandler.cpp:307
BCEPlotHandler(QWidget *parent)
Constructor.
Definition: bceplothandler.cpp:25
void indicateDataLoaded()
Sets isSolnDataLoaded to true.
Definition: bceplothandler.cpp:431
Class for storing data produced by BCESolver.
Definition: bcesolution.hpp:64
QCustomPlot with Tool-tip and click functionality.
Definition: bcevaluesetplot.hpp:37