#1250 Show fractures directly as child objects of wells / well path

This commit is contained in:
Magne Sjaastad 2017-02-22 14:40:13 +01:00
parent 73690e6d66
commit 65d71f7106
11 changed files with 71 additions and 47 deletions

View File

@ -21,16 +21,20 @@
#include "RicDeleteItemExec.h"
#include "RicDeleteItemExecData.h"
#include "RimCase.h"
#include "RimCellRangeFilterCollection.h"
#include "RimEclipsePropertyFilterCollection.h"
#include "RimFormationNamesCollection.h"
#include "RimGeoMechPropertyFilterCollection.h"
#include "RimIntersectionCollection.h"
#include "RimProject.h"
#include "RimSimWellFractureCollection.h"
#include "RimView.h"
#include "RimViewLinkerCollection.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "cafNotificationCenter.h"
@ -39,9 +43,6 @@
#include "cafPdmReferenceHelper.h"
#include "cafPdmUiFieldHandle.h"
#include "cafSelectionManager.h"
#include "RimFormationNamesCollection.h"
#include "RimCase.h"
#include "RimSimWellFractureCollection.h"
namespace caf
@ -123,9 +124,9 @@ void RicDeleteItemExec::redo()
}
// SimWell Fractures
RimSimWellFractureCollection* simWellFractureColl;
parentObj->firstAncestorOrThisOfType(simWellFractureColl);
if (view && simWellFractureColl)
RimEclipseWell* eclipseWell;
parentObj->firstAncestorOrThisOfType(eclipseWell);
if (view && eclipseWell)
{
view->scheduleCreateDisplayModelAndRedraw();
}
@ -134,6 +135,14 @@ void RicDeleteItemExec::redo()
// Well paths
RimWellPath* wellPath;
parentObj->firstAncestorOrThisOfType(wellPath);
if (wellPath)
{
wellPath->updateConnectedEditors();
}
RimWellPathCollection* wellPathColl;
parentObj->firstAncestorOrThisOfType(wellPathColl);

View File

@ -54,12 +54,8 @@ void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
RimEclipseWell* eclipseWell = nullptr;
objHandle->firstAncestorOrThisOfType(eclipseWell);
RimSimWellFractureCollection* fractureCollection = nullptr;
objHandle->firstAncestorOrThisOfType(fractureCollection);
CVF_ASSERT(fractureCollection);
RimSimWellFracture* fracture = new RimSimWellFracture();
fractureCollection->simwellFractures.push_back(fracture);
eclipseWell->simwellFractureCollection()->simwellFractures.push_back(fracture);
RimOilField* oilfield = nullptr;
objHandle->firstAncestorOrThisOfType(oilfield);
@ -82,7 +78,7 @@ void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
fracture->updateFracturePositionFromLocation();
fractureCollection->updateConnectedEditors();
eclipseWell->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(fracture);
RimEclipseView* mainView = nullptr;

View File

@ -52,22 +52,15 @@ void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked)
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
if (!objHandle) return;
RimWellPathCollection* wellPathColl = nullptr;
objHandle->firstAncestorOrThisOfType(wellPathColl);
RimWellPathFractureCollection* fractureCollection = nullptr;
objHandle->firstAncestorOrThisOfType(fractureCollection);
CVF_ASSERT(fractureCollection);
RimWellPathFracture* fracture = new RimWellPathFracture();
fractureCollection->fractures.push_back(fracture);
float md_default = 0.0f;
fracture->setMeasuredDepth(md_default);
RimWellPath* wellPath = nullptr;
objHandle->firstAncestorOrThisOfType(wellPath);
CVF_ASSERT(wellPath);
RimWellPathFracture* fracture = new RimWellPathFracture();
wellPath->fractureCollection()->fractures.push_back(fracture);
float md_default = 0.0f;
fracture->setMeasuredDepth(md_default);
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
cvf::Vec3d positionAtWellpath = wellPathGeometry->interpolatedPointAlongWellPath(md_default);
@ -92,10 +85,15 @@ void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked)
fracture->setAzimuth();
}
fractureCollection->updateConnectedEditors();
wellPath->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(fracture);
wellPathColl->scheduleGeometryRegenAndRedrawViews();
RimWellPathCollection* wellPathColl = nullptr;
objHandle->firstAncestorOrThisOfType(wellPathColl);
if (wellPathColl)
{
wellPathColl->scheduleGeometryRegenAndRedrawViews();
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -223,6 +223,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
commandIds << "RicNewWellLogFileCurveFeature";
commandIds << "RicNewWellLogCurveExtractionFeature";
commandIds << "RicNewWellPathIntersectionFeature";
commandIds << "RicNewWellPathFractureFeature";
commandIds << "Separator";
commandIds << "RicWellPathDeleteFeature";
}
@ -372,17 +373,15 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
{
commandIds << "RicAddStoredWellAllocationPlotFeature";
}
else if (dynamic_cast<RimWellPathFractureCollection*>(uiItem) ||
dynamic_cast<RimWellPathFracture*>(uiItem) )
else if (dynamic_cast<RimWellPathFracture*>(uiItem))
{
commandIds << "RicNewWellPathFractureFeature";
commandIds << "RicWellPathFracturesDeleteAllFeature";
//commandIds << "RicWellPathFracturesDeleteAllFeature";
}
else if (dynamic_cast<RimSimWellFractureCollection*>(uiItem) ||
dynamic_cast<RimSimWellFracture*>(uiItem))
else if (dynamic_cast<RimSimWellFracture*>(uiItem))
{
commandIds << "RicNewSimWellFractureFeature";
commandIds << "RicSimWellFracturesDeleteAllFeature";
//commandIds << "RicSimWellFracturesDeleteAllFeature";
}
else if (dynamic_cast<RimFractureTemplateCollection*>(uiItem) ||
dynamic_cast<RimStimPlanFractureTemplate*>(uiItem))
@ -471,6 +470,8 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
commandIds << "RicEclipseWellShowSpheresFeature";
commandIds << "RicEclipseWellShowWellCellsFeature";
commandIds << "RicEclipseWellShowWellCellFenceFeature";
commandIds << "Separator";
commandIds << "RicNewSimWellFractureFeature";
commandIds << "RicExportSelectedSimWellFractureWellCompletionFeature";
}
else if (dynamic_cast<RimWellPath*>(uiItem))

View File

@ -28,9 +28,12 @@
#include "RimEclipseWellCollection.h"
#include "RimIntersectionCollection.h"
#include "RimSimWellFractureCollection.h"
#include "RimSimWellFracture.h"
#include "RiuMainWindow.h"
#include "cafPdmUiTreeOrdering.h"
#include "cvfMath.h"
CAF_PDM_SOURCE_INIT(RimEclipseWell, "Well");
@ -61,7 +64,6 @@ RimEclipseWell::RimEclipseWell()
name.uiCapability()->setUiHidden(true);
name.uiCapability()->setUiReadOnly(true);
simwellFractureCollection.uiCapability()->setUiHidden(true);
m_resultWellIndex = cvf::UNDEFINED_SIZE_T;
@ -288,6 +290,12 @@ void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
//--------------------------------------------------------------------------------------------------
void RimEclipseWell::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{
for (RimSimWellFracture* fracture : simwellFractureCollection()->simwellFractures())
{
uiTreeOrdering.add(fracture);
}
uiTreeOrdering.setForgetRemainingFields(true);
const RimEclipseView* reservoirView = nullptr;
this->firstAncestorOrThisOfType(reservoirView);
if (!reservoirView) return;

View File

@ -33,8 +33,6 @@ RimSimWellFractureCollection::RimSimWellFractureCollection(void)
{
CAF_PDM_InitObject("Fractures", ":/FractureSymbol16x16.png", "", "");
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
CAF_PDM_InitFieldNoDefault(&simwellFractures, "Fractures", "", "", "", "");
simwellFractures.uiCapability()->setUiHidden(true);
}

View File

@ -37,7 +37,6 @@ public:
virtual ~RimSimWellFractureCollection(void);
caf::PdmChildArrayField<RimSimWellFracture*> simwellFractures;
caf::PdmField<bool> isActive;
void deleteFractures();

View File

@ -21,20 +21,26 @@
#include "RimWellPath.h"
#include "RifJsonEncodeDecode.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "RimProject.h"
#include "RimTools.h"
#include "RimWellLogFile.h"
#include "RimProject.h"
#include "RimMainPlotCollection.h"
#include "RimWellLogPlotCollection.h"
#include "RivWellPathPartMgr.h"
#include "RimWellPathFracture.h"
#include "RimWellPathFractureCollection.h"
#include "RiuMainWindow.h"
#include "RivWellPathPartMgr.h"
#include "cafPdmUiTreeOrdering.h"
#include <QDateTime>
#include <QDir>
#include <QFileInfo>
#include <QMessageBox>
#include <QDateTime>
CAF_PDM_SOURCE_INIT(RimWellPath, "WellPath");
@ -97,10 +103,8 @@ RimWellPath::RimWellPath()
m_wellLogFile.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&fractureCollection, "FractureCollection", "Fractures", "", "", "");
fractureCollection.uiCapability()->setUiHidden(true);
fractureCollection = new RimWellPathFractureCollection();
m_wellPath = NULL;
}
@ -379,6 +383,18 @@ void RimWellPath::setupBeforeSave()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPath::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{
for (RimWellPathFracture* fracture : fractureCollection()->fractures())
{
uiTreeOrdering.add(fracture);
}
uiTreeOrdering.setForgetRemainingFields(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -79,7 +79,8 @@ public:
bool readWellPathFile(QString * errorMessage, RifWellPathAsciiFileReader* asciiReader);
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
protected:
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
private:
@ -107,4 +108,5 @@ private:
cvf::ref<RigWellPath> m_wellPath;
cvf::ref<RivWellPathPartMgr> m_wellPathPartMgr;
};

View File

@ -33,8 +33,6 @@ RimWellPathFractureCollection::RimWellPathFractureCollection(void)
{
CAF_PDM_InitObject("Fractures", ":/FractureSymbol16x16.png", "", "");
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
CAF_PDM_InitFieldNoDefault(&fractures, "Fractures", "", "", "", "");
fractures.uiCapability()->setUiHidden(true);
}

View File

@ -37,7 +37,6 @@ public:
virtual ~RimWellPathFractureCollection(void);
caf::PdmChildArrayField<RimWellPathFracture*> fractures;
caf::PdmField<bool> isActive;
void deleteFractures();
};