(#541) Setting depth range for export from the curve's raw data, not the plot curve's data

This commit is contained in:
Pål Hagen
2015-10-15 16:31:11 +02:00
parent 2dd1e98f81
commit 3683dc95cd
3 changed files with 40 additions and 2 deletions

View File

@@ -244,3 +244,39 @@ void RigWellLogCurveData::computeFilteredIntervals(const std::vector< std::pair<
index += intervalSize;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigWellLogCurveData::depthRange(double* minimumDepth, double* maximumDepth) const
{
CVF_ASSERT(minimumDepth && maximumDepth);
double minValue = HUGE_VAL;
double maxValue = -HUGE_VAL;
for (size_t vIdx = 0; vIdx < m_yValues.size(); vIdx++)
{
double value = m_yValues[vIdx];
if (value < minValue)
{
minValue = value;
}
if (value > maxValue)
{
maxValue = value;
}
}
if (maxValue >= minValue)
{
*minimumDepth = minValue;
*maximumDepth = maxValue;
return true;
}
return false;
}