mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added commands for well path features
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathImport.h"
|
||||
|
||||
@@ -602,6 +603,12 @@ void RimProject::actionsBasedOnSelection(std::vector<QAction*>& actions)
|
||||
else if (dynamic_cast<RimWellPathCollection*>(uiItem))
|
||||
{
|
||||
actions.push_back(commandManager->action("RicImportWellPathsSsihubFeature"));
|
||||
actions.push_back(commandManager->action("RicImportWellPathsFileFeature"));
|
||||
actions.push_back(commandManager->action("RicWellPathsDeleteAllFeature"));
|
||||
}
|
||||
else if (dynamic_cast<RimWellPath*>(uiItem))
|
||||
{
|
||||
actions.push_back(commandManager->action("RicDeleteItemFeature"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "RimWellPath.h"
|
||||
#include "RivWellPathCollectionPartMgr.h"
|
||||
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
#include <QFile>
|
||||
@@ -45,6 +46,30 @@ namespace caf
|
||||
}
|
||||
}
|
||||
|
||||
class RimWellPathCollectionEditorHandle : public caf::PdmUiEditorHandle
|
||||
{
|
||||
public:
|
||||
RimWellPathCollectionEditorHandle(caf::PdmFieldHandle* a)
|
||||
{
|
||||
this->bindToPdmItem(a->uiCapability());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
virtual void configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = dynamic_cast<caf::PdmUiFieldHandle*>(this->pdmItem());
|
||||
RimWellPathCollection* wellPathColl = dynamic_cast<RimWellPathCollection*>(uiFieldHandle->fieldHandle()->ownerObject());
|
||||
|
||||
wellPathColl->scheduleGeometryRegenAndRedrawViews();
|
||||
|
||||
// This will update UI editors related to tree view (and others), as there is no tree view entity for editor for
|
||||
// the property filters childarrayfield (this field is hidden)
|
||||
uiObj(wellPathColl)->updateConnectedEditors();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPathCollection, "WellPaths");
|
||||
|
||||
@@ -80,6 +105,8 @@ RimWellPathCollection::RimWellPathCollection()
|
||||
m_project = NULL;
|
||||
|
||||
m_asciiFileReader = new RimWellPathAsciiFileReader;
|
||||
|
||||
wellPaths.uiCapability()->addFieldEditor(new RimWellPathCollectionEditorHandle(&wellPaths));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user