2016-12-16 14:05:11 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2016- Statoil ASA
|
|
|
|
|
//
|
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2017-01-02 11:59:30 +01:00
|
|
|
#include "RimWellPathFracture.h"
|
2016-12-16 14:05:11 +01:00
|
|
|
|
2016-12-19 12:04:07 +01:00
|
|
|
#include "RiaApplication.h"
|
|
|
|
|
|
2017-01-06 10:26:57 +01:00
|
|
|
#include "RigTesselatorTools.h"
|
|
|
|
|
|
2017-01-12 13:29:18 +01:00
|
|
|
#include "RimEllipseFractureTemplate.h"
|
2016-12-19 12:04:07 +01:00
|
|
|
#include "RimFractureDefinitionCollection.h"
|
|
|
|
|
#include "RimOilField.h"
|
|
|
|
|
#include "RimProject.h"
|
2016-12-16 14:05:11 +01:00
|
|
|
#include "RimWellPath.h"
|
|
|
|
|
|
2017-01-06 13:13:25 +01:00
|
|
|
#include "RivWellPathPartMgr.h"
|
|
|
|
|
|
2016-12-19 12:04:07 +01:00
|
|
|
#include "cafPdmFieldHandle.h"
|
2016-12-16 14:05:11 +01:00
|
|
|
#include "cafPdmObject.h"
|
2016-12-19 12:04:07 +01:00
|
|
|
#include "cafPdmUiItem.h"
|
|
|
|
|
|
2016-12-20 15:28:37 +01:00
|
|
|
#include "cvfVector3.h"
|
2017-01-06 10:26:57 +01:00
|
|
|
|
|
|
|
|
#include <QToolBox>
|
|
|
|
|
#include <QList>
|
2016-12-16 14:05:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-02 11:59:30 +01:00
|
|
|
CAF_PDM_SOURCE_INIT(RimWellPathFracture, "WellPathFracture");
|
2016-12-16 14:05:11 +01:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-01-02 11:59:30 +01:00
|
|
|
RimWellPathFracture::RimWellPathFracture(void)
|
2016-12-16 14:05:11 +01:00
|
|
|
{
|
2017-01-05 14:57:04 +01:00
|
|
|
CAF_PDM_InitObject("Fracture", ":/FractureSymbol16x16.png", "", "");
|
2016-12-16 14:05:11 +01:00
|
|
|
|
2016-12-21 13:40:53 +01:00
|
|
|
CAF_PDM_InitField( &measuredDepth, "MeasuredDepth", 0.0f, "Measured Depth Location (if along well path)", "", "", "");
|
2016-12-16 14:05:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-01-02 11:59:30 +01:00
|
|
|
RimWellPathFracture::~RimWellPathFracture()
|
2016-12-16 14:05:11 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-19 12:04:07 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-01-02 11:59:30 +01:00
|
|
|
QList<caf::PdmOptionItemInfo> RimWellPathFracture::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
2016-12-19 12:04:07 +01:00
|
|
|
{
|
2017-01-19 10:43:23 +01:00
|
|
|
return RimFracture::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
|
2017-01-04 08:10:02 +01:00
|
|
|
}
|
|
|
|
|
|
2017-01-04 13:29:25 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
|
|
|
|
{
|
2017-01-19 10:43:23 +01:00
|
|
|
RimFracture::fieldChangedByUi(changedField, oldValue, newValue);
|
|
|
|
|
|
2017-01-04 13:29:25 +01:00
|
|
|
if (changedField == &measuredDepth)
|
|
|
|
|
{
|
2017-01-19 10:43:23 +01:00
|
|
|
cvf::Vec3d positionAtWellpath = cvf::Vec3d::ZERO;
|
2017-01-04 13:29:25 +01:00
|
|
|
|
|
|
|
|
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(this);
|
|
|
|
|
if (!objHandle) return;
|
|
|
|
|
|
|
|
|
|
RimWellPath* wellPath = nullptr;
|
|
|
|
|
objHandle->firstAncestorOrThisOfType(wellPath);
|
|
|
|
|
if (!wellPath) return;
|
|
|
|
|
|
|
|
|
|
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
|
|
|
|
positionAtWellpath = wellPathGeometry->interpolatedPointAlongWellPath(measuredDepth);
|
|
|
|
|
|
2017-01-19 10:43:23 +01:00
|
|
|
this->setAnchorPosition(positionAtWellpath);
|
2017-01-04 13:29:25 +01:00
|
|
|
|
2017-01-19 10:43:23 +01:00
|
|
|
RimProject* proj;
|
|
|
|
|
this->firstAncestorOrThisOfType(proj);
|
|
|
|
|
if (proj) proj->createDisplayModelAndRedrawAllViews();
|
|
|
|
|
}
|
2017-01-04 13:29:25 +01:00
|
|
|
}
|
|
|
|
|
|
2017-01-04 10:41:46 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
caf::PdmFieldHandle* RimWellPathFracture::userDescriptionField()
|
|
|
|
|
{
|
|
|
|
|
return &name;
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-16 14:05:11 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-01-02 11:59:30 +01:00
|
|
|
void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
2016-12-16 14:05:11 +01:00
|
|
|
{
|
2017-01-19 10:43:23 +01:00
|
|
|
RimFracture::defineUiOrdering(uiConfigName, uiOrdering);
|
2016-12-16 14:05:11 +01:00
|
|
|
|
2017-01-19 10:43:23 +01:00
|
|
|
uiOrdering.add(&measuredDepth);
|
2016-12-16 14:05:11 +01:00
|
|
|
}
|
2017-01-04 09:08:10 +01:00
|
|
|
|