Ejemplo n.º 1
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
bool RicNewPltPlotFeature::isCommandEnabled()
{
    if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;

    RimSimWellInView* simWell = caf::firstAncestorOfTypeFromSelectedObject<RimSimWellInView*>();
    RimWellPath* selectedWellPath = caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>();

    bool enable = true;

    if (selectedWellPath)
    {
        if (selectedWellPath->wellPathGeometry() == nullptr && !RimWellPlotTools::hasFlowData(selectedWellPath))
        {
            return false;
        }
    }

    if (simWell != nullptr)
    {
        RimProject* proj = RiaApplication::instance()->project();
        QString simWellName = simWell->name();

        RimWellPath* wellPath = proj->wellPathFromSimWellName(simWellName);
        enable = wellPath != nullptr;
    }
    return enable;
}
Ejemplo n.º 2
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFracture::defineEditorAttribute(const caf::PdmFieldHandle* field,
                                                QString                    uiConfigName,
                                                caf::PdmUiEditorAttribute* attribute)
{
    RimFracture::defineEditorAttribute(field, uiConfigName, attribute);

    if (field == &m_measuredDepth)
    {
        caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>(attribute);

        if (myAttr)
        {
            RimWellPath* rimWellPath = nullptr;
            this->firstAncestorOrThisOfType(rimWellPath);
            if (!rimWellPath) return;

            RigWellPath* wellPathGeo = rimWellPath->wellPathGeometry();
            if (!wellPathGeo) return;

            if (wellPathGeo->m_measuredDepths.size() > 2)
            {
                myAttr->m_minimum = wellPathGeo->m_measuredDepths.front();
                myAttr->m_maximum = wellPathGeo->m_measuredDepths.back();
            }
        }
    }
}
Ejemplo n.º 3
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3d> RimWellPathFracture::perforationLengthCenterLineCoords() const
{
    std::vector<cvf::Vec3d> wellPathCoords;

    RimWellPath* wellPath = nullptr;
    this->firstAncestorOrThisOfType(wellPath);
    if (wellPath && wellPath->wellPathGeometry())
    {
        double startMd = m_measuredDepth - perforationLength() / 2.0;
        double endMd   = m_measuredDepth + perforationLength() / 2.0;

        auto coordsAndMd = wellPath->wellPathGeometry()->clippedPointSubset(startMd, endMd);

        wellPathCoords = coordsAndMd.first;
    }

    return wellPathCoords;
}
Ejemplo n.º 4
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;
}
Ejemplo n.º 5
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellPathFracture::wellAzimuthAtFracturePosition() const
{
    RimWellPath* wellPath = nullptr;
    this->firstAncestorOrThisOfType(wellPath);
    if (!wellPath) return cvf::UNDEFINED_DOUBLE;

    double wellPathAzimuth = 0.0;

    RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
    if (wellPathGeometry)
    {
        wellPathAzimuth = wellPathGeometry->wellPathAzimuthAngle(fracturePosition());
    }

    if (wellPathAzimuth < 0) wellPathAzimuth += 360;

    return wellPathAzimuth;
}
Ejemplo n.º 6
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);
}