diff --git a/ApplicationCode/Commands/RicDeleteItemExec.cpp b/ApplicationCode/Commands/RicDeleteItemExec.cpp index c06af5e286..33bc6826e6 100644 --- a/ApplicationCode/Commands/RicDeleteItemExec.cpp +++ b/ApplicationCode/Commands/RicDeleteItemExec.cpp @@ -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); diff --git a/ApplicationCode/Commands/RicNewSimWellFractureFeature.cpp b/ApplicationCode/Commands/RicNewSimWellFractureFeature.cpp index 162301a3bb..fdcd4cb4d9 100644 --- a/ApplicationCode/Commands/RicNewSimWellFractureFeature.cpp +++ b/ApplicationCode/Commands/RicNewSimWellFractureFeature.cpp @@ -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; diff --git a/ApplicationCode/Commands/RicNewWellPathFractureFeature.cpp b/ApplicationCode/Commands/RicNewWellPathFractureFeature.cpp index 1a2f6a9372..7c347a27ff 100644 --- a/ApplicationCode/Commands/RicNewWellPathFractureFeature.cpp +++ b/ApplicationCode/Commands/RicNewWellPathFractureFeature.cpp @@ -52,22 +52,15 @@ void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked) caf::PdmObjectHandle* objHandle = dynamic_cast(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(); + } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp index 9bcc9ee998..c37d779844 100644 --- a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -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(uiItem) || - dynamic_cast(uiItem) ) + else if (dynamic_cast(uiItem)) { commandIds << "RicNewWellPathFractureFeature"; - commandIds << "RicWellPathFracturesDeleteAllFeature"; + //commandIds << "RicWellPathFracturesDeleteAllFeature"; } - else if (dynamic_cast(uiItem) || - dynamic_cast(uiItem)) + else if (dynamic_cast(uiItem)) { commandIds << "RicNewSimWellFractureFeature"; - commandIds << "RicSimWellFracturesDeleteAllFeature"; + //commandIds << "RicSimWellFracturesDeleteAllFeature"; } else if (dynamic_cast(uiItem) || dynamic_cast(uiItem)) @@ -471,6 +470,8 @@ QStringList RimContextCommandBuilder::commandsFromSelection() commandIds << "RicEclipseWellShowSpheresFeature"; commandIds << "RicEclipseWellShowWellCellsFeature"; commandIds << "RicEclipseWellShowWellCellFenceFeature"; + commandIds << "Separator"; + commandIds << "RicNewSimWellFractureFeature"; commandIds << "RicExportSelectedSimWellFractureWellCompletionFeature"; } else if (dynamic_cast(uiItem)) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseWell.cpp b/ApplicationCode/ProjectDataModel/RimEclipseWell.cpp index 061c1ef184..d3f59d8965 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseWell.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseWell.cpp @@ -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; diff --git a/ApplicationCode/ProjectDataModel/RimSimWellFractureCollection.cpp b/ApplicationCode/ProjectDataModel/RimSimWellFractureCollection.cpp index f1aaa60369..49b1c09b28 100644 --- a/ApplicationCode/ProjectDataModel/RimSimWellFractureCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimSimWellFractureCollection.cpp @@ -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); } diff --git a/ApplicationCode/ProjectDataModel/RimSimWellFractureCollection.h b/ApplicationCode/ProjectDataModel/RimSimWellFractureCollection.h index 2440c9a0fa..d0d14b5848 100644 --- a/ApplicationCode/ProjectDataModel/RimSimWellFractureCollection.h +++ b/ApplicationCode/ProjectDataModel/RimSimWellFractureCollection.h @@ -37,7 +37,6 @@ public: virtual ~RimSimWellFractureCollection(void); caf::PdmChildArrayField simwellFractures; - caf::PdmField isActive; void deleteFractures(); diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.cpp b/ApplicationCode/ProjectDataModel/RimWellPath.cpp index 6fec1ad041..6d51b05733 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPath.cpp @@ -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 #include #include #include -#include 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); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.h b/ApplicationCode/ProjectDataModel/RimWellPath.h index 841162a672..9dc26a9ff6 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.h +++ b/ApplicationCode/ProjectDataModel/RimWellPath.h @@ -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 m_wellPath; cvf::ref m_wellPathPartMgr; + }; diff --git a/ApplicationCode/ProjectDataModel/RimWellPathFractureCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathFractureCollection.cpp index 1de2c26daa..42dc4f2873 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathFractureCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathFractureCollection.cpp @@ -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); } diff --git a/ApplicationCode/ProjectDataModel/RimWellPathFractureCollection.h b/ApplicationCode/ProjectDataModel/RimWellPathFractureCollection.h index 28b87ac297..791af6c1e8 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathFractureCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellPathFractureCollection.h @@ -37,7 +37,6 @@ public: virtual ~RimWellPathFractureCollection(void); caf::PdmChildArrayField fractures; - caf::PdmField isActive; void deleteFractures(); };