SGSolve
sgsimulationplot.hpp
1 // This file is part of the SGSolve library for stochastic games
2 // Copyright (C) 2019 Benjamin A. Brooks
3 //
4 // SGSolve free software: you can redistribute it and/or modify it
5 // under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // SGSolve is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see
16 // <http://www.gnu.org/licenses/>.
17 //
18 // Benjamin A. Brooks
19 // ben@benjaminbrooks.net
20 // Chicago, IL
21 
22 #ifndef SGSIMULATIONPLOT_HPP
23 #define SGSIMULATIONPLOT_HPP
24 
25 #include "qcustomplot.h"
26 #include "sgpoint.hpp"
27 
29 
34 class SGSimulationPlot : public QCustomPlot
35 {
36  Q_OBJECT;
37 private:
39  int numStates;
40 
41 public:
43  SGSimulationPlot(int _numStates): numStates(_numStates) {}
44 
45 protected:
47 
48  void resizeEvent(QResizeEvent * event)
49  {
50  QCustomPlot::resizeEvent(event);
51  }
52 
53 private slots:
54 
55 private:
56 
58  virtual QSize minimumSizeHint() const
59  { return QSize(100,200*(numStates+2)); }
60 
61 };
62 
63 #endif
SGSimulationPlot::SGSimulationPlot
SGSimulationPlot(int _numStates)
Constructor.
Definition: sgsimulationplot.hpp:43
SGSimulationPlot::minimumSizeHint
virtual QSize minimumSizeHint() const
Custom minimum size.
Definition: sgsimulationplot.hpp:58
SGSimulationPlot::numStates
int numStates
The number of states in the given plot.
Definition: sgsimulationplot.hpp:36
SGSimulationPlot::resizeEvent
void resizeEvent(QResizeEvent *event)
Reimplement resizeEvent.
Definition: sgsimulationplot.hpp:48
SGSimulationPlot
A customized version of QCustomPlot.
Definition: sgsimulationplot.hpp:35