RosAna
A rosette analyzer and synthesizer tool
|
The DrawWidget class plots a rosette based on the parameters found in its model. More...
Public Slots | |
void | itemChanged (QStandardItem *item) |
Is executed when an item has changed in the model. More... | |
void | rowDeleted () |
Is executed when a row is deleted. More... | |
Public Member Functions | |
DrawWidget (QWidget *parent=0) | |
Constructs the DrawWidget. Sets up customPlot, main graph and layout. More... | |
~DrawWidget () | |
Destroys DrawWidget. More... | |
void | setModel (QStandardItemModel *newModel) |
Sets a new model. More... | |
bool | saveImage (QString filename) |
Saves current plot as image. More... | |
Private Member Functions | |
void | generatePlotData () |
Generates plot data from model to display with customPlot. | |
bool | saveParameters (QString filename) |
Saves the current parameters to file. More... | |
Private Attributes | |
QCPCurve * | graph |
QCustomPlot * | customPlot |
QStandardItemModel * | model |
QVector< double > | xdata |
QVector< double > | ydata |
QVector< double > | zdata |
The DrawWidget class plots a rosette based on the parameters found in its model.
It inherits QWdiget and makes use of QCustomPlot.
|
explicit |
Constructs the DrawWidget. Sets up customPlot, main graph and layout.
parent | The parent of the widget. |
DrawWidget::~DrawWidget | ( | ) |
Destroys DrawWidget.
Deletes customPlot, graph and model.
|
slot |
Is executed when an item has changed in the model.
Triggers a recalculation of plot data with generatePlotData().
item | The changed item, unused. |
|
slot |
Is executed when a row is deleted.
Triggers a recalculation of plot data with generatePlotData().
bool DrawWidget::saveImage | ( | QString | filename | ) |
Saves current plot as image.
filename | Name of the saved file. |
True
if the save is successfull; otherwise False
.
|
private |
Saves the current parameters to file.
filename | Name of the saved file. |
True
if the save is successfull; otherwise False
. void DrawWidget::setModel | ( | QStandardItemModel * | newModel | ) |
Sets a new model.
newModel | The new model to display. |
|
private |
Displays the rosette plot.
|
private |
Holds data points for the rosette plot.
|
private |
The model containing rosette desccription parameters.
|
private |
List of x-coordinates for the rosette plot.
|
private |
List of y-coordinates for the rosette plot.
|
private |
List of time-coordinates for the rosette plot.