MCPcopy Create free account
hub / github.com/MITK/MITK / InsertCurve

Method InsertCurve

Modules/QtWidgetsExt/src/QmitkPlotWidget.cpp:51–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51unsigned 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
75void QmitkPlotWidget::SetPlotTitle(const QwtText &qwt_title)
76{

Callers 4

RenderPlotCurveMethod · 0.80
RenderPlotMethod · 0.80
PlotPointSetMethod · 0.80

Calls 3

setColorMethod · 0.80
backMethod · 0.80
sizeMethod · 0.45

Tested by 2

RenderPlotCurveMethod · 0.64
RenderPlotMethod · 0.64