//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimWellLogTrack::loadDataAndUpdate() { CVF_ASSERT(m_wellLogTrackPlotWidget); RimWellLogPlot* wellLogPlot; firstAnchestorOrThisOfType(wellLogPlot); if (wellLogPlot) { m_wellLogTrackPlotWidget->setDepthTitle(wellLogPlot->depthPlotTitle()); } for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx) { curves[cIdx]->updatePlotData(); } }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot) { this->RimPlotCurve::updateCurvePresentation(updateParentPlot); if (isCurveVisible()) { // Make sure we have set correct case data into the result definitions. bool isUsingPseudoLength = false; RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(m_case.value()); RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value()); m_eclipseResultDefinition->setEclipseCase(eclipseCase); m_geomResultDefinition->setGeoMechCase(geomCase); clampBranchIndex(); RimMainPlotCollection* mainPlotCollection; this->firstAncestorOrThisOfTypeAsserted(mainPlotCollection); RimWellLogPlotCollection* wellLogCollection = mainPlotCollection->wellLogPlotCollection(); cvf::ref<RigEclipseWellLogExtractor> eclExtractor; if (eclipseCase) { if (m_trajectoryType == WELL_PATH) { eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase); } else { std::vector<const RigWellPath*> simWellBranches = simulationWellBranches(); if (m_branchIndex >= 0 && m_branchIndex < static_cast<int>(simWellBranches.size())) { auto wellBranch = simWellBranches[m_branchIndex]; eclExtractor = wellLogCollection->findOrCreateSimWellExtractor(m_simWellName, eclipseCase->caseUserDescription(), wellBranch, eclipseCase->eclipseCaseData()); if (eclExtractor.notNull()) { m_wellPathsWithExtractors.push_back(wellBranch); } isUsingPseudoLength = true; } } } cvf::ref<RigGeoMechWellLogExtractor> geomExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, geomCase); std::vector<double> values; std::vector<double> measuredDepthValues; std::vector<double> tvDepthValues; RiaDefines::DepthUnitType depthUnit = RiaDefines::UNIT_METER; if (eclExtractor.notNull() && eclipseCase) { measuredDepthValues = eclExtractor->measuredDepth(); tvDepthValues = eclExtractor->trueVerticalDepth(); m_eclipseResultDefinition->loadResult(); cvf::ref<RigResultAccessor> resAcc = RigResultAccessorFactory::createFromResultDefinition(eclipseCase->eclipseCaseData(), 0, m_timeStep, m_eclipseResultDefinition); if (resAcc.notNull()) { eclExtractor->curveData(resAcc.p(), &values); } RiaEclipseUnitTools::UnitSystem eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType(); if (eclipseUnitsType == RiaEclipseUnitTools::UNITS_FIELD) { // See https://github.com/OPM/ResInsight/issues/538 depthUnit = RiaDefines::UNIT_FEET; } } else if (geomExtractor.notNull()) // geomExtractor { measuredDepthValues = geomExtractor->measuredDepth(); tvDepthValues = geomExtractor->trueVerticalDepth(); m_geomResultDefinition->loadResult(); geomExtractor->curveData(m_geomResultDefinition->resultAddress(), m_timeStep, &values); } m_curveData = new RigWellLogCurveData; if (values.size() && measuredDepthValues.size()) { if (!tvDepthValues.size()) { m_curveData->setValuesAndMD(values, measuredDepthValues, depthUnit, true); } else { m_curveData->setValuesWithTVD(values, measuredDepthValues, tvDepthValues, depthUnit, true); } } RiaDefines::DepthUnitType displayUnit = RiaDefines::UNIT_METER; RimWellLogPlot* wellLogPlot; firstAncestorOrThisOfType(wellLogPlot); CVF_ASSERT(wellLogPlot); if (!wellLogPlot) return; displayUnit = wellLogPlot->depthUnit(); if(wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH) { m_qwtPlotCurve->setSamples(m_curveData->xPlotValues().data(), m_curveData->trueDepthPlotValues(displayUnit).data(), static_cast<int>(m_curveData->xPlotValues().size())); isUsingPseudoLength = false; } else if (wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH) { m_qwtPlotCurve->setSamples(m_curveData->xPlotValues().data(), m_curveData->measuredDepthPlotValues(displayUnit).data(), static_cast<int>(m_curveData->xPlotValues().size())); } m_qwtPlotCurve->setLineSegmentStartStopIndices(m_curveData->polylineStartStopIndices()); if (isUsingPseudoLength) { RimWellLogTrack* wellLogTrack; firstAncestorOrThisOfType(wellLogTrack); CVF_ASSERT(wellLogTrack); RiuWellLogTrack* viewer = wellLogTrack->viewer(); if (viewer) { viewer->setDepthTitle("PL/" + wellLogPlot->depthPlotTitle()); } } updateZoomInParentPlot(); setLogScaleFromSelectedResult(); if (m_parentQwtPlot) m_parentQwtPlot->replot(); } }