| 49 | } |
| 50 | |
| 51 | unsigned int QmitkPlotWidget::InsertCurve(const char *title, QColor color) |
| 52 | { |
| 53 | QwtText qwt_title = QwtText(title); |
| 54 | qwt_title.setColor(color); |
| 55 | qwt_title.setPaintAttribute(QwtText::PaintUsingTextColor); |
| 56 | |
| 57 | QwtPlotCurve *curve = new QwtPlotCurve(qwt_title); |
| 58 | QwtPlotIntervalCurve *xErrors = new QwtPlotIntervalCurve(); |
| 59 | QwtPlotIntervalCurve *yErrors = new QwtPlotIntervalCurve(); |
| 60 | |
| 61 | auto tuple = std::make_tuple(curve, xErrors, yErrors); |
| 62 | m_PlotCurveVector.push_back(tuple); |
| 63 | |
| 64 | std::get<0>(m_PlotCurveVector.back())->attach(m_Plot); |
| 65 | std::get<1>(m_PlotCurveVector.back())->attach(m_Plot); |
| 66 | std::get<2>(m_PlotCurveVector.back())->attach(m_Plot); |
| 67 | |
| 68 | // error curves should not show up on the legend |
| 69 | std::get<1>(m_PlotCurveVector.back())->setItemAttribute(QwtPlotItem::Legend, false); |
| 70 | std::get<2>(m_PlotCurveVector.back())->setItemAttribute(QwtPlotItem::Legend, false); |
| 71 | |
| 72 | return static_cast<unsigned int>(m_PlotCurveVector.size() - 1); |
| 73 | } |
| 74 | |
| 75 | void QmitkPlotWidget::SetPlotTitle(const QwtText &qwt_title) |
| 76 | { |