Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _QmitkPlotWidget_H_
00019 #define _QmitkPlotWidget_H_
00020
00021 #include <qwidget.h>
00022 #include "QmitkExtExports.h"
00023 #include <qwt_plot.h>
00024 #include <qwt_plot_curve.h>
00025 #include <vector>
00026 #include "mitkCommon.h"
00027 #include <qwt_symbol.h>
00028
00054 class QmitkExt_EXPORT QmitkPlotWidget: public QWidget
00055 {
00056
00057 public:
00063 typedef double ScalarType;
00064
00070 typedef std::vector<ScalarType> DataVector;
00071
00076 typedef std::vector< std::pair< double, double > > XYDataVector;
00077
00081 QmitkPlotWidget(QWidget* parent = 0,const char* title = 0, const char* name = 0, Qt::WindowFlags f = 0);
00082
00086 virtual ~QmitkPlotWidget();
00087
00092 QwtPlot* GetPlot();
00093
00094 void SetPlotTitle(const char* title);
00095
00102 unsigned int InsertCurve( const char* title );
00103
00110 void SetAxisTitle(int axis, const char* title);
00111
00120 bool SetCurveData( unsigned int curveId, const DataVector& xValues, const DataVector& yValues );
00121
00129 bool SetCurveData( unsigned int curveId, const XYDataVector& data );
00130
00136 void SetCurvePen( unsigned int curveId, const QPen& pen );
00137
00148 void SetCurveBrush( unsigned int curveId, const QBrush& brush);
00149
00155 void SetCurveStyle( unsigned int curveId, const QwtPlotCurve::CurveStyle style );
00156
00162 void SetCurveSymbol( unsigned int curveId, QwtSymbol* symbol );
00163
00170 void SetCurveTitle( unsigned int curveId, const char* title );
00171
00176 void Replot();
00177
00181 void Clear();
00182
00183 protected:
00188 double* ConvertToRawArray( const DataVector& values );
00189
00197 double* ConvertToRawArray( const XYDataVector& values, unsigned int component );
00198
00199 QwtPlot* m_Plot;
00200 std::vector<QwtPlotCurve*> m_PlotCurveVector;
00201 };
00202
00203 #endif
00204