RosAna
A rosette analyzer and synthesizer tool
 All Classes Namespaces Functions Variables Properties
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
DrawWidget Class Reference

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
 
QStandardItemModelmodel
 
QVector< double > xdata
 
QVector< double > ydata
 
QVector< double > zdata
 

Detailed Description

The DrawWidget class plots a rosette based on the parameters found in its model.

It inherits QWdiget and makes use of QCustomPlot.

Constructor & Destructor Documentation

DrawWidget::DrawWidget ( QWidget parent = 0)
explicit

Constructs the DrawWidget. Sets up customPlot, main graph and layout.

Parameters
parentThe parent of the widget.
DrawWidget::~DrawWidget ( )

Destroys DrawWidget.

Deletes customPlot, graph and model.

Member Function Documentation

void DrawWidget::itemChanged ( QStandardItem item)
slot

Is executed when an item has changed in the model.

Triggers a recalculation of plot data with generatePlotData().

Parameters
itemThe changed item, unused.
void DrawWidget::rowDeleted ( )
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.

Parameters
filenameName of the saved file.
Returns
True if the save is successfull; otherwise False.
bool DrawWidget::saveParameters ( QString  filename)
private

Saves the current parameters to file.

Parameters
filenameName of the saved file.
Returns
True if the save is successfull; otherwise False.
void DrawWidget::setModel ( QStandardItemModel newModel)

Sets a new model.

Parameters
newModelThe new model to display.

Member Data Documentation

QCustomPlot* DrawWidget::customPlot
private

Displays the rosette plot.

QCPCurve* DrawWidget::graph
private

Holds data points for the rosette plot.

QStandardItemModel* DrawWidget::model
private

The model containing rosette desccription parameters.

QVector<double> DrawWidget::xdata
private

List of x-coordinates for the rosette plot.

QVector<double> DrawWidget::ydata
private

List of y-coordinates for the rosette plot.

QVector<double> DrawWidget::zdata
private

List of time-coordinates for the rosette plot.


The documentation for this class was generated from the following files: