Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkPlotDialog Class Reference

#include <QmitkPlotDialog.h>

Inheritance diagram for QmitkPlotDialog:
Collaboration diagram for QmitkPlotDialog:

Public Member Functions

 QmitkPlotDialog (const char *title, QWidget *parent=nullptr, const char *name=nullptr)
 
virtual ~QmitkPlotDialog ()
 
QmitkPlotWidgetGetPlot ()
 
QwtPlot * GetQwtPlot ()
 

Protected Attributes

QmitkPlotWidgetm_Plot
 
QPushButton * m_CloseDialogButton
 

Detailed Description

Provides a GUI interface for plotting curves using QmitkPlotWidget. Designed for qwt version 5.1.1. To plot data do the following:

  1. Create two QmitkPlotDialog::DataVector Objects and fill them with corresponding x/y values. DataVectors are simple stl-vectors of type std::vector<double>. Please note that the xValues vector and the yValues vector MUST have the same size.
  2. Instantiate and show the dialog for example like that: QmitkPlotDialog* dlg = new QmitkPlotDialog( "My dialog title", this, "dlg" ); dlg->GetPlot()->SetAxisTitle( QwtPlot::xBottom, "My x asis [mm]" ); dlg->GetPlot()->SetAxisTitle( QwtPlot::yLeft, "My y axis [mm]" ); int curveId = dlg->GetPlot()->InsertCurve( "My sophisticated data" ); dlg->GetPlot()->SetCurveData( curveId, xValues, yValues ); dlg->GetPlot()->SetCurvePen( curveId, QPen( red ) ); dlg->GetPlot()->SetCurveTitle( curveId, "My curve description" ); dlg->GetPlot()->Replot(); dlg->exec();
  3. You can modify the behavior of the plot by directly referencing the QwtPlot instance using the method GetQwtPlot().
    See also
    QwtPlot,
    QmitkPlotWidget

Definition at line 47 of file QmitkPlotDialog.h.

Constructor & Destructor Documentation

QmitkPlotDialog::QmitkPlotDialog ( const char *  title,
QWidget *  parent = nullptr,
const char *  name = nullptr 
)

Standard qt constructor

Definition at line 22 of file QmitkPlotDialog.cpp.

References m_CloseDialogButton, and m_Plot.

QmitkPlotDialog::~QmitkPlotDialog ( )
virtual

Virtual destructor

Definition at line 32 of file QmitkPlotDialog.cpp.

References m_Plot.

Member Function Documentation

QmitkPlotWidget * QmitkPlotDialog::GetPlot ( )

Returns the instance of the QmitkPlotWidget. This may be used to modify any detail of the appearance of the plot.

Definition at line 37 of file QmitkPlotDialog.cpp.

References m_Plot.

QwtPlot * QmitkPlotDialog::GetQwtPlot ( )

Returns the instance of the plot-widget. This may be used to modify any detail of the appearance of the plot.

Definition at line 42 of file QmitkPlotDialog.cpp.

References QmitkPlotWidget::GetPlot(), and m_Plot.

Member Data Documentation

QPushButton* QmitkPlotDialog::m_CloseDialogButton
protected

Definition at line 75 of file QmitkPlotDialog.h.

Referenced by QmitkPlotDialog().

QmitkPlotWidget* QmitkPlotDialog::m_Plot
protected

Definition at line 73 of file QmitkPlotDialog.h.

Referenced by GetPlot(), GetQwtPlot(), QmitkPlotDialog(), and ~QmitkPlotDialog().


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