#2965 Implement option (on by default) to follow time step in 3D view.

This commit is contained in:
Gaute Lindkvist
2018-06-20 10:31:03 +02:00
parent 5fc795a24a
commit a0f5db5d7e
8 changed files with 125 additions and 33 deletions

View File

@@ -49,7 +49,8 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables(const caf::Display
const Rim3dWellLogCurve* rim3dWellLogCurve,
double planeOffsetFromWellPathCenter,
double planeWidth,
const std::vector<cvf::Vec3d>& drawSurfaceVertices)
const std::vector<cvf::Vec3d>& drawSurfaceVertices,
int currentTimeStep)
{
CVF_ASSERT(rim3dWellLogCurve);
@@ -66,7 +67,14 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables(const caf::Display
std::vector<double> resultValues;
std::vector<double> resultMds;
rim3dWellLogCurve->curveValuesAndMds(&resultValues, &resultMds);
if (rim3dWellLogCurve->followAnimationTimeStep())
{
rim3dWellLogCurve->curveValuesAndMdsAtTimeStep(&resultValues, &resultMds, currentTimeStep);
}
else
{
rim3dWellLogCurve->curveValuesAndMds(&resultValues, &resultMds);
}
m_planeWidth = planeWidth;

View File

@@ -52,7 +52,8 @@ public:
const Rim3dWellLogCurve* rim3dWellLogCurve,
double planeOffsetFromWellPathCenter,
double planeWidth,
const std::vector<cvf::Vec3d>& drawSurfaceVertices);
const std::vector<cvf::Vec3d>& drawSurfaceVertices,
int currentTimeStep);
void clearCurvePointsAndGeometry();

View File

@@ -107,7 +107,8 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurveToModel(cvf::ModelBasicList*
rim3dWellLogCurve,
wellPathCenterToPlotStartOffset(rim3dWellLogCurve),
planeWidth(),
drawSurfaceVertices);
drawSurfaceVertices,
m_gridView->currentTimeStep());
cvf::ref<cvf::DrawableGeo> curveDrawable = generator->curveDrawable();

View File

@@ -502,12 +502,6 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList*
appendFishboneSubsPartsToModel(model, displayCoordTransform, characteristicCellSize);
appendImportedFishbonesToModel(model, displayCoordTransform, characteristicCellSize);
RimGridView* gridView = dynamic_cast<RimGridView*>(m_rimView.p());
if (!gridView) return;
m_3dWellLogPlanePartMgr = new Riv3dWellLogPlanePartMgr(m_rimWellPath, gridView);
m_3dWellLogPlanePartMgr->appendPlaneToModel(model, displayCoordTransform, wellPathClipBoundingBox);
}
//--------------------------------------------------------------------------------------------------
@@ -566,6 +560,13 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
appendPerforationsToModel(model, timeStepIndex, displayCoordTransform, characteristicCellSize, false);
appendVirtualTransmissibilitiesToModel(model, timeStepIndex, displayCoordTransform, characteristicCellSize);
RimGridView* gridView = dynamic_cast<RimGridView*>(m_rimView.p());
if (!gridView) return;
m_3dWellLogPlanePartMgr = new Riv3dWellLogPlanePartMgr(m_rimWellPath, gridView);
m_3dWellLogPlanePartMgr->appendPlaneToModel(model, displayCoordTransform, wellPathClipBoundingBox);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -135,6 +135,37 @@ bool Rim3dWellLogCurve::isShowingCurve() const
return m_showCurve;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogCurve::curveValuesAndMdsAtTimeStep(std::vector<double>* values, std::vector<double>* measuredDepthValues, int timeStep) const
{
return this->curveValuesAndMds(values, measuredDepthValues);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<double, double> Rim3dWellLogCurve::findCurveValueRange()
{
double foundMinValue = std::numeric_limits<float>::infinity();
double foundMaxValue = -std::numeric_limits<float>::infinity();
std::vector<double> values;
std::vector<double> measuredDepths;
this->curveValuesAndMds(&values, &measuredDepths);
for (double value : values)
{
if (RiaCurveDataTools::isValidValue(value, false))
{
foundMinValue = std::min(foundMinValue, value);
foundMaxValue = std::max(foundMaxValue, value);
}
}
return std::make_pair(foundMinValue, foundMaxValue);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -261,22 +292,10 @@ cvf::ref<Riv3dWellLogCurveGeometryGenerator> Rim3dWellLogCurve::geometryGenerato
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogCurve::resetMinMaxValues()
{
std::vector<double> values;
std::vector<double> measuredDepths;
this->curveValuesAndMds(&values, &measuredDepths);
double foundMinValue = std::numeric_limits<float>::infinity();
double foundMaxValue = -std::numeric_limits<float>::infinity();
for (double value : values)
{
if (RiaCurveDataTools::isValidValue(value, false))
{
foundMinValue = std::min(foundMinValue, value);
foundMaxValue = std::max(foundMaxValue, value);
}
}
std::pair<double, double> valueRange = findCurveValueRange();
m_minCurveDataValue = foundMinValue;
m_maxCurveDataValue = foundMaxValue;
m_minCurveDataValue = valueRange.first;
m_maxCurveDataValue = valueRange.second;
m_minCurveUIValue = m_minCurveDataValue;
m_maxCurveUIValue = m_maxCurveDataValue;

View File

@@ -66,7 +66,10 @@ public:
cvf::Color3f color() const;
bool isShowingCurve() const;
virtual bool followAnimationTimeStep() const { return false; }
virtual void curveValuesAndMds(std::vector<double>* values, std::vector<double>* measuredDepthValues) const = 0;
virtual void curveValuesAndMdsAtTimeStep(std::vector<double>* values, std::vector<double>* measuredDepthValues, int timeStep) const;
virtual std::pair<double,double> findCurveValueRange();
void setColor(const cvf::Color3f& color);

View File

@@ -21,6 +21,7 @@
#include "RigWellLogFile.h"
#include "RiaExtractionTools.h"
#include "RiaCurveDataTools.h"
#include "RigEclipseCaseData.h"
#include "RigGeoMechCaseData.h"
#include "RigEclipseWellLogExtractor.h"
@@ -68,7 +69,7 @@ Rim3dWellLogExtractionCurve::Rim3dWellLogExtractionCurve()
m_case.uiCapability()->setUiTreeChildrenHidden(true);
m_case = nullptr;
CAF_PDM_InitField(&m_timeStep, "CurveTimeStep", 0, "Time Step", "", "", "");
CAF_PDM_InitField(&m_timeStep, "CurveTimeStep", -1, "Time Step", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_eclipseResultDefinition, "CurveEclipseResult", "", "", "", "");
m_eclipseResultDefinition.uiCapability()->setUiHidden(true);
@@ -114,14 +115,12 @@ void Rim3dWellLogExtractionCurve::setPropertiesFromView(Rim3dView* view)
if (eclipseView)
{
m_eclipseResultDefinition->simpleCopy(eclipseView->cellResult());
m_timeStep = eclipseView->currentTimeStep();
}
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>(view);
if (geoMechView)
{
m_geomResultDefinition->setResultAddress(geoMechView->cellResultResultDefinition()->resultAddress());
m_timeStep = geoMechView->currentTimeStep();
}
}
@@ -154,10 +153,28 @@ QString Rim3dWellLogExtractionCurve::resultPropertyString() const
return name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool Rim3dWellLogExtractionCurve::followAnimationTimeStep() const
{
return m_timeStep() == -1;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogExtractionCurve::curveValuesAndMds(std::vector<double>* values, std::vector<double>* measuredDepthValues) const
{
CVF_ASSERT(m_timeStep() >= 0);
return this->curveValuesAndMdsAtTimeStep(values, measuredDepthValues, m_timeStep());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep(std::vector<double>* values, std::vector<double>* measuredDepthValues, int timeStep) const
{
CAF_ASSERT(values != nullptr);
CAF_ASSERT(measuredDepthValues != nullptr);
@@ -191,7 +208,7 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMds(std::vector<double>* values,
cvf::ref<RigResultAccessor> resAcc = RigResultAccessorFactory::createFromResultDefinition(eclipseCase->eclipseCaseData(),
0,
m_timeStep,
timeStep,
m_eclipseResultDefinition);
if (resAcc.notNull())
{
@@ -207,6 +224,32 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMds(std::vector<double>* values,
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<double, double> Rim3dWellLogExtractionCurve::findCurveValueRange()
{
double foundMinValue = std::numeric_limits<float>::infinity();
double foundMaxValue = -std::numeric_limits<float>::infinity();
for (size_t i = 0; i < m_case->timeStepStrings().size(); ++i)
{
std::vector<double> values;
std::vector<double> measuredDepths;
this->curveValuesAndMdsAtTimeStep(&values, &measuredDepths, int(i));
for (double value : values)
{
if (RiaCurveDataTools::isValidValue(value, false))
{
foundMinValue = std::min(foundMinValue, value);
foundMaxValue = std::max(foundMaxValue, value);
}
}
}
return std::make_pair(foundMinValue, foundMaxValue);
}
QString Rim3dWellLogExtractionCurve::name() const
{
return m_nameConfig()->name();
@@ -244,10 +287,12 @@ QString Rim3dWellLogExtractionCurve::createCurveAutoName() const
if (m_nameConfig->addTimeStep() || m_nameConfig->addDate())
{
bool addTimeStep = m_nameConfig->addTimeStep() && m_timeStep() != -1;
size_t maxTimeStep = 0;
if (eclipseCase)
{
addTimeStep = addTimeStep && m_eclipseResultDefinition->resultType() != RiaDefines::STATIC_NATIVE;
RigEclipseCaseData* data = eclipseCase->eclipseCaseData();
if (data)
{
@@ -272,9 +317,9 @@ QString Rim3dWellLogExtractionCurve::createCurveAutoName() const
}
}
if (m_nameConfig->addTimeStep())
if (addTimeStep)
{
generatedCurveName.push_back(QString("[%1/%2]").arg(m_timeStep() + 1).arg(maxTimeStep));
generatedCurveName.push_back(QString("[%1/%2]").arg(m_timeStep() + 1).arg(maxTimeStep));
}
}
@@ -360,7 +405,7 @@ QList<caf::PdmOptionItemInfo> Rim3dWellLogExtractionCurve::calculateValueOptions
{
timeStepNames = m_case->timeStepStrings();
}
options.push_back(caf::PdmOptionItemInfo(QString("Follow Animation Time Step"), -1));
for (int i = 0; i < timeStepNames.size(); i++)
{
options.push_back(caf::PdmOptionItemInfo(timeStepNames[i], i));
@@ -416,6 +461,9 @@ void Rim3dWellLogExtractionCurve::initAfterRead()
m_geomResultDefinition->setGeoMechCase(geomCase);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString Rim3dWellLogExtractionCurve::wellDate() const
{
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(m_case.value());
@@ -425,6 +473,10 @@ QString Rim3dWellLogExtractionCurve::wellDate() const
if (eclipseCase)
{
if (m_eclipseResultDefinition->resultType() == RiaDefines::STATIC_NATIVE)
{
return QString();
}
if (eclipseCase->eclipseCaseData())
{
timeStepNames = eclipseCase->timeStepStrings();
@@ -437,6 +489,9 @@ QString Rim3dWellLogExtractionCurve::wellDate() const
timeStepNames = geomCase->timeStepStrings();
}
}
if (m_timeStep == -1)
{
return QString("Animation Time Step");
}
return (m_timeStep >= 0 && m_timeStep < timeStepNames.size()) ? timeStepNames[m_timeStep] : "";
}

View File

@@ -44,7 +44,11 @@ public:
void setPropertiesFromView(Rim3dView* view);
virtual QString resultPropertyString() const override;
virtual bool followAnimationTimeStep() const override;
virtual void curveValuesAndMds(std::vector<double>* values, std::vector<double>* measuredDepthValues) const override;
virtual void curveValuesAndMdsAtTimeStep(std::vector<double>* values, std::vector<double>* measuredDepthValues, int timeStep) const override;
virtual std::pair<double, double> findCurveValueRange() override;
virtual QString name() const override;
virtual QString createCurveAutoName() const override;