示例#1
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
cvf::BoundingBox RimPerforationInterval::boundingBoxInDomainCoords()
{
    cvf::BoundingBox bb;

    RimWellPath* wellPath = nullptr;
    this->firstAncestorOrThisOfTypeAsserted(wellPath);

    RigWellPath* rigWellPath = wellPath->wellPathGeometry();
    if (rigWellPath)
    {
        bb.add(rigWellPath->interpolatedPointAlongWellPath(startMD()));
        bb.add(rigWellPath->interpolatedPointAlongWellPath(endMD()));
    }

    return bb;
}
示例#2
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFracture::updatePositionFromMeasuredDepth()
{
    cvf::Vec3d positionAlongWellpath = cvf::Vec3d::ZERO;

    caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(this);
    if (!objHandle) return;

    RimWellPath* wellPath = nullptr;
    objHandle->firstAncestorOrThisOfType(wellPath);
    if (!wellPath) return;

    RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
    if (wellPathGeometry)
    {
        positionAlongWellpath = wellPathGeometry->interpolatedPointAlongWellPath(m_measuredDepth());
    }

    this->setAnchorPosition(positionAlongWellpath);
}
示例#3
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RimWellLogFileCurve::onLoadDataAndUpdate(bool updateParentPlot)
{
    this->RimPlotCurve::updateCurvePresentation(updateParentPlot);

    if (isCurveVisible())
    {
        m_curveData = new RigWellLogCurveData;

        RimWellLogPlot* wellLogPlot;
        firstAncestorOrThisOfType(wellLogPlot);
        CVF_ASSERT(wellLogPlot);

        if (m_wellPath && m_wellLogFile)
        {
            RigWellLogFile* wellLogFile = m_wellLogFile->wellLogFileData();
            if (wellLogFile)
            {
                std::vector<double> values = wellLogFile->values(m_wellLogChannnelName);
                std::vector<double> measuredDepthValues = wellLogFile->depthValues();

                if (wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
                {
                    bool canUseTvd = false;
                    if (wellLogFile->hasTvdChannel())
                    {
                        std::vector<double> tvdMslValues = wellLogFile->tvdMslValues();

                        if (values.size() == measuredDepthValues.size() && values.size() == tvdMslValues.size())
                        {
                            m_curveData->setValuesWithTVD(values, measuredDepthValues, tvdMslValues, wellLogFile->depthUnit(), false);
                            canUseTvd = true;
                        }
                    }

                    if (!canUseTvd)
                    {
                        RigWellPath* rigWellPath = m_wellPath->wellPathGeometry();
                        if (rigWellPath)
                        {
                            std::vector<double> trueVerticeldepthValues;

                            for (double measuredDepthValue : measuredDepthValues)
                            {
                                trueVerticeldepthValues.push_back(-rigWellPath->interpolatedPointAlongWellPath(measuredDepthValue).z());
                            }
                            if (values.size() == trueVerticeldepthValues.size() && values.size() == measuredDepthValues.size())
                            {
                                m_curveData->setValuesWithTVD(values, measuredDepthValues, trueVerticeldepthValues, wellLogFile->depthUnit(), false);
                                canUseTvd = true;
                            }
                        }
                    }

                    if (!canUseTvd)
                    {
                        if (RiaApplication::instance()->preferences()->showLasCurveWithoutTvdWarning())
                        {
                            QString tmp = QString("Display of True Vertical Depth (TVD) for LAS curves is not possible without a well log path, and the LAS curve will be hidden in this mode.\n\n");
                            tmp += "Control display of this warning from \"Preferences->Show LAS curve without TVD warning\"";

                            QMessageBox::warning(nullptr, "LAS curve without TVD", tmp);
                        }
                    }
                }
                else
                {
                    if (values.size() == measuredDepthValues.size())
                    {
                        m_curveData->setValuesAndMD(values, measuredDepthValues, wellLogFile->depthUnit(), false);
                    }
                }
            }

            if (m_isUsingAutoName)
            {
                m_qwtPlotCurve->setTitle(createCurveAutoName());
            }
        }

        RiaDefines::DepthUnitType displayUnit = RiaDefines::UNIT_METER;
        if (wellLogPlot)
        {
            displayUnit = wellLogPlot->depthUnit();
        }
        if (wellLogPlot && 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()));
        }
        else
        {
            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());

        updateZoomInParentPlot();

        if (m_parentQwtPlot) m_parentQwtPlot->replot();
    }
}