22 #ifndef SGCUSTOMPLOT_HPP
23 #define SGCUSTOMPLOT_HPP
25 #include "qcustomplot.h"
26 #include "sgpoint.hpp"
90 const QCPRange & yrange);
116 QCustomPlot::resizeEvent(event);
127 QPoint globalPos = this->mapToGlobal(pos);
132 contextMenu.addSeparator();
136 contextMenu.exec(globalPos);
147 void simulationRequested()
158 QString newPath = QFileDialog::getSaveFileName(
this, tr(
"Save PDF"),
159 path, tr(
"PDF files (*.pdf)"));
161 if (newPath.isEmpty())
164 QFileInfo fi(newPath);
165 path = fi.canonicalPath();
173 QString newPath = QFileDialog::getSaveFileName(
this, tr(
"Save PNG"),
174 path, tr(
"PNG files (*.png)"));
176 if (newPath.isEmpty())
179 QFileInfo fi(newPath);
180 path = fi.canonicalPath();
QCPRange realYRange
Definition: sgcustomplot.hpp:53
QCPRange realXRange
Definition: sgcustomplot.hpp:52
virtual QSize minimumSizeHint() const
Custom minimum size.
Definition: sgcustomplot.hpp:196
QCPRange nominalYRange
Definition: sgcustomplot.hpp:51
void savePNG()
Saves graph as a PNG.
Definition: sgcustomplot.hpp:171
void adjustRanges()
Updates ranges when window is resized.
Definition: sgcustomplot.cpp:94
void savePDF()
Saves graph as a PDF.
Definition: sgcustomplot.hpp:156
void setRanges(const QCPRange &xrange, const QCPRange &yrange)
Sets the nominal ranges.
Definition: sgcustomplot.cpp:70
virtual int heightForWidth(int w) const
Reimplement heightForWidth.
Definition: sgcustomplot.hpp:189
int getState() const
Gets the state associated with the plot.
Definition: sgcustomplot.hpp:107
QPoint lastContextPos
Stores the last location at which a context menu was requested.
Definition: sgcustomplot.hpp:71
QCPRange nominalXRange
Definition: sgcustomplot.hpp:50
const QCPRange & getNominalYRange() const
Returns the nominal Y range.
Definition: sgcustomplot.hpp:97
void inspectPoint(SGPoint point, int state, bool isDetailPlot)
Signal to inspect the given point.
void resizeEvent(QResizeEvent *event)
Reimplement resizeEvent.
Definition: sgcustomplot.hpp:113
QAction * savePDFAction
Pointer to the QAction for saving PDF files.
Definition: sgcustomplot.hpp:68
void ShowContextMenu(const QPoint &pos)
Slot for showing context menu.
Definition: sgcustomplot.hpp:123
QString path
Save file path.
Definition: sgcustomplot.hpp:57
void setState(int newState)
Sets the state associated with the plot.
Definition: sgcustomplot.hpp:104
bool isDetailPlot
Indicates if this is the detail plot.
Definition: sgcustomplot.hpp:47
SGCustomPlot()
Constructor.
Definition: sgcustomplot.hpp:75
A customized version of QCustomPlot.
Definition: sgcustomplot.hpp:41
QAction * simulateAction
Action for forward simulating.
Definition: sgcustomplot.hpp:63
int state
Indicates the state that this plot is associated with.
Definition: sgcustomplot.hpp:42
A vector in .
Definition: sgpoint.hpp:35
void pointInspected()
Point inspected.
Definition: sgcustomplot.hpp:140
QAction * savePNGAction
Pointer to the QAction for saving PNG files.
Definition: sgcustomplot.hpp:66
QCPPlotTitle * title
Definition: sgcustomplot.hpp:49
void simulateEquilibrium(SGPoint point, int state, bool isDetailPlot)
Signal to simulate the given equilibrium forwards.
QAction * inspectPointAction
Inspect a point.
Definition: sgcustomplot.hpp:60
const QCPRange & getNominalXRange() const
Returns the nominal X range.
Definition: sgcustomplot.hpp:93
virtual bool hasHeightForWidth() const
Reimplement hasHeighForWidth.
Definition: sgcustomplot.hpp:193
void equalizeAxesScales()
Normalize ranges.
Definition: sgcustomplot.cpp:79
QCPPlotTitle * getTitle()
Returns the title.
Definition: sgcustomplot.hpp:83