Refactored RiuLineSegmnetQwtPlotCurve

Removed domain specific code
Created RigCurveDataTools
Use symbol to draw single values
This commit is contained in:
Magne Sjaastad
2015-11-06 10:08:35 +01:00
parent 3c00a8394d
commit ab3c5c029a
12 changed files with 210 additions and 146 deletions

View File

@@ -1,6 +1,6 @@
#include "gtest/gtest.h"
#include "RigWellLogCurveData.h"
#include "RigCurveDataTools.h"
#include <cmath> // Needed for HUGE_VAL on Linux
@@ -19,7 +19,7 @@ TEST(RimWellLogExtractionCurveImplTest, StripOffInvalidValAtEndsOfVector)
values.push_back(HUGE_VAL);
std::vector< std::pair<size_t, size_t> > valuesIntervals;
RigWellLogCurveDataTestInterface::calculateIntervalsOfValidValues(values, &valuesIntervals);
RigCurveDataTools::calculateIntervalsOfValidValues(values, &valuesIntervals);
EXPECT_EQ(1, static_cast<int>(valuesIntervals.size()));
EXPECT_EQ(2, static_cast<int>(valuesIntervals[0].first));
@@ -43,7 +43,7 @@ TEST(RimWellLogExtractionCurveImplTest, StripOffHugeValAtEndsAndInteriorOfVector
values.push_back(HUGE_VAL);
std::vector< std::pair<size_t, size_t> > valuesIntervals;
RigWellLogCurveDataTestInterface::calculateIntervalsOfValidValues(values, &valuesIntervals);
RigCurveDataTools::calculateIntervalsOfValidValues(values, &valuesIntervals);
EXPECT_EQ(2, static_cast<int>(valuesIntervals.size()));
EXPECT_EQ(2, static_cast<int>(valuesIntervals[0].first));

View File

@@ -255,7 +255,9 @@ void RimWellLogExtractionCurve::updatePlotData()
}
}
m_qwtPlotCurve->setCurveData(m_curveData.p());
m_qwtPlotCurve->setSamples(m_curveData->xPlotValues().data(), m_curveData->depthPlotValues().data(), static_cast<int>(m_curveData->xPlotValues().size()));
m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices());
zoomAllOwnerTrackAndPlot();
if (m_ownerQwtTrack) m_ownerQwtTrack->replot();

View File

@@ -114,7 +114,8 @@ void RimWellLogFileCurve::updatePlotData()
}
}
m_qwtPlotCurve->setCurveData(m_curveData.p());
m_qwtPlotCurve->setSamples(m_curveData->xPlotValues().data(), m_curveData->depthPlotValues().data(), static_cast<int>(m_curveData->xPlotValues().size()));
m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices());
zoomAllOwnerTrackAndPlot();