#2125 Refactor : Introduce typedef for CurveIntervals

This commit is contained in:
Magne Sjaastad
2017-11-16 13:27:17 +01:00
parent 827cee6093
commit cd368d8ef2
2 changed files with 16 additions and 11 deletions

View File

@@ -31,14 +31,17 @@
class RigCurveDataTools
{
public:
static void calculateIntervalsOfValidValues(const std::vector<double>& values,
std::vector< std::pair<size_t, size_t> >* intervals,
typedef std::vector<std::pair<size_t, size_t>> CurveIntervals;
public:
static void calculateIntervalsOfValidValues(const std::vector<double>& values,
CurveIntervals* intervals,
bool removeNegativeValues);
template <typename T>
static void getValuesByIntervals(const std::vector<T>& values,
const std::vector< std::pair<size_t, size_t> >& intervals,
std::vector<T>* filteredValues)
const CurveIntervals& intervals,
std::vector<T>* filteredValues)
{
CVF_ASSERT(filteredValues);
@@ -51,8 +54,8 @@ public:
}
}
static void computePolyLineStartStopIndices(const std::vector< std::pair<size_t, size_t> >& intervals,
std::vector< std::pair<size_t, size_t> >* filteredIntervals);
static void computePolyLineStartStopIndices(const CurveIntervals& intervals,
std::vector<std::pair<size_t, size_t>>* lineStartAndStopIndices);
private:
static bool isValidValue(double value, bool removeNegativeValues);