Added commands for well path features

This commit is contained in:
Magne Sjaastad
2015-08-12 20:59:38 +02:00
parent 9f16c859c6
commit 9bee1b81fc
8 changed files with 344 additions and 11 deletions

View File

@@ -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"));
}
}

View File

@@ -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));
}