3D Well Log Curves: Command to Delete curve #2667

* Add delete command with explicit delete feature class.
This commit is contained in:
Gaute Lindkvist
2018-04-10 10:57:04 +02:00
parent a73526f85b
commit 2cc93fb09d
6 changed files with 157 additions and 5 deletions

View File

@@ -19,6 +19,7 @@
#include "Rim3dWellLogCurveCollection.h"
#include "Rim3dWellLogCurve.h"
#include "RimWellPath.h"
#include "RimProject.h"
CAF_PDM_SOURCE_INIT(Rim3dWellLogCurveCollection, "Rim3dWellLogCurveCollection");
@@ -79,6 +80,14 @@ void Rim3dWellLogCurveCollection::add3dWellLogCurve(Rim3dWellLogCurve* curve)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogCurveCollection::remove3dWellLogCurve(Rim3dWellLogCurve* curve)
{
m_3dWellLogCurves.removeChildObject(curve);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -117,6 +126,25 @@ std::vector<Rim3dWellLogCurve*> Rim3dWellLogCurveCollection::vectorOf3dWellLogCu
return curves;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dWellLogCurveCollection::redrawAffectedViewsAndEditors()
{
RimProject* proj = nullptr;
this->firstAncestorOrThisOfType(proj);
if (proj)
{
proj->createDisplayModelAndRedrawAllViews();
}
RimWellPath* path = nullptr;
this->firstAncestorOrThisOfType(path);
if (path)
{
path->updateConnectedEditors();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -46,6 +46,7 @@ public:
bool has3dWellLogCurves() const;
void add3dWellLogCurve(Rim3dWellLogCurve* curve);
void remove3dWellLogCurve(Rim3dWellLogCurve* curve);
bool isShowingGrid() const;
bool isShowingPlot() const;
@@ -53,7 +54,7 @@ public:
PlanePosition planePosition() const;
std::vector<Rim3dWellLogCurve*> vectorOf3dWellLogCurves() const;
void redrawAffectedViewsAndEditors();
private:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
virtual caf::PdmFieldHandle* objectToggleField() override;

View File

@@ -760,18 +760,22 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
menuBuilder << "RicDeleteSubItemsFeature";
}
// Special delete commands for specific features
// Placed here to fit context menu location of general delete feature
if (caf::CmdFeatureManager::instance()->getCommandFeature("RicWellPathDeleteFeature")->canFeatureBeExecuted())
{
// Special delete command for Well paths
// Placed here to fit context menu location of general delete feature
menuBuilder << "Separator";
menuBuilder << "RicWellPathDeleteFeature";
}
if (caf::CmdFeatureManager::instance()->getCommandFeature("Ric3dWellLogCurveDeleteFeature")->canFeatureBeExecuted())
{
menuBuilder << "Separator";
menuBuilder << "Ric3dWellLogCurveDeleteFeature";
}
if (caf::CmdFeatureManager::instance()->getCommandFeature("RicWellLogFileCloseFeature")->canFeatureBeExecuted())
{
// Special delete command for Well paths
// Placed here to fit context menu location of general delete feature
menuBuilder << "Separator";
menuBuilder << "RicWellLogFileCloseFeature";
}