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

Method SetCurveData

Modules/QtWidgetsExt/src/QmitkPlotWidget.cpp:91–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool QmitkPlotWidget::SetCurveData(unsigned int curveId,
92 const QmitkPlotWidget::DataVector &xValues,
93 const QmitkPlotWidget::DataVector &yValues)
94{
95 if (xValues.size() != yValues.size())
96 {
97 std::cerr << "Sizes of data arrays don't match." << std::endl;
98 return false;
99 }
100 double *rawDataX = ConvertToRawArray(xValues);
101 double *rawDataY = ConvertToRawArray(yValues);
102 std::get<0>(m_PlotCurveVector[curveId])
103 ->setSamples(new QwtPointArrayData(rawDataX, rawDataY, static_cast<int>(xValues.size())));
104 delete[] rawDataX;
105 delete[] rawDataY;
106 return true;
107}
108
109bool QmitkPlotWidget::SetCurveData(unsigned int curveId,
110 const DataVector &xValues,

Callers 4

RenderPlotCurveMethod · 0.80
RenderPlotMethod · 0.80
PlotPointSetMethod · 0.80

Calls 3

AddErrorIntervalCurveMethod · 0.95
sizeMethod · 0.45
setDataMethod · 0.45

Tested by 2

RenderPlotCurveMethod · 0.64
RenderPlotMethod · 0.64