Public Member Functions | Protected Attributes

QmitkPlotDialog Class Reference

#include <QmitkPlotDialog.h>

Collaboration diagram for QmitkPlotDialog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QmitkPlotDialog (const char *title, QWidget *parent=0, const char *name=0)
virtual ~QmitkPlotDialog ()
QmitkPlotWidgetGetPlot ()
QwtPlotGetQwtPlot ()

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 48 of file QmitkPlotDialog.h.


Constructor & Destructor Documentation

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

Standard qt constructor

Definition at line 23 of file QmitkPlotDialog.cpp.

References m_CloseDialogButton, and m_Plot.

                                                                                         : QDialog(parent) 
{
  QVBoxLayout* boxLayout = new QVBoxLayout(this);
  m_Plot = new QmitkPlotWidget( this, title ) ;
  m_CloseDialogButton = new QPushButton("close plot window", this);  
  boxLayout->addWidget( m_Plot );
  boxLayout->addWidget( m_CloseDialogButton );
  connect( m_CloseDialogButton, SIGNAL( clicked( ) ), this, SLOT( accept() ) );
}
QmitkPlotDialog::~QmitkPlotDialog (  ) [virtual]

Virtual destructor

Definition at line 33 of file QmitkPlotDialog.cpp.

References m_Plot.

{
  delete 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 38 of file QmitkPlotDialog.cpp.

References m_Plot.

{
  return 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 43 of file QmitkPlotDialog.cpp.

References QmitkPlotWidget::GetPlot(), and m_Plot.

{
  return m_Plot->GetPlot();
}

Member Data Documentation

QPushButton* QmitkPlotDialog::m_CloseDialogButton [protected]

Definition at line 78 of file QmitkPlotDialog.h.

Referenced by QmitkPlotDialog().

Definition at line 76 of file QmitkPlotDialog.h.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines