mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-16 18:34:54 -06:00
3D Well Log Curve (#2747): Add "Add new curve" command to 3D track and other curves.
This commit is contained in:
parent
32fb519073
commit
4dc9d1ba8a
@ -84,6 +84,26 @@ RimWellPath* RicWellLogTools::selectedWellPath()
|
|||||||
return selection.size() > 0 ? selection[0] : nullptr;
|
return selection.size() > 0 ? selection[0] : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimWellPath* RicWellLogTools::findWellPathFromSelection()
|
||||||
|
{
|
||||||
|
std::vector<caf::PdmObject*> selection;
|
||||||
|
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||||
|
if (selection.size() > 0)
|
||||||
|
{
|
||||||
|
caf::PdmObject* firstSelection = selection[0];
|
||||||
|
RimWellPath* wellPath;
|
||||||
|
firstSelection->firstAncestorOrThisOfType(wellPath);
|
||||||
|
if (wellPath)
|
||||||
|
{
|
||||||
|
return wellPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -170,6 +190,19 @@ RimWellPath* RicWellLogTools::selectedWellPathWithLogFile()
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimWellPath* RicWellLogTools::findWellPathWithLogFileFromSelection()
|
||||||
|
{
|
||||||
|
RimWellPath* wellPath = findWellPathFromSelection();
|
||||||
|
if (wellPath->wellLogFiles().size() > 0)
|
||||||
|
{
|
||||||
|
return wellPath;
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
class RimSimWellInView;
|
class RimSimWellInView;
|
||||||
class Rim3dView;
|
class Rim3dView;
|
||||||
|
class Rim3dWellLogCurveCollection;
|
||||||
class RimWellLogExtractionCurve;
|
class RimWellLogExtractionCurve;
|
||||||
class RimWellLogFileChannel;
|
class RimWellLogFileChannel;
|
||||||
class RimWellLogFileCurve;
|
class RimWellLogFileCurve;
|
||||||
@ -40,11 +41,13 @@ public:
|
|||||||
static RimWellLogTrack* selectedWellLogPlotTrack();
|
static RimWellLogTrack* selectedWellLogPlotTrack();
|
||||||
static RimSimWellInView* selectedSimulationWell(int* branchIndex);
|
static RimSimWellInView* selectedSimulationWell(int* branchIndex);
|
||||||
static RimWellPath* selectedWellPath();
|
static RimWellPath* selectedWellPath();
|
||||||
|
static RimWellPath* findWellPathFromSelection();
|
||||||
static bool wellHasRftData(const QString& wellName);
|
static bool wellHasRftData(const QString& wellName);
|
||||||
static bool isWellPathOrSimWellSelectedInView();
|
static bool isWellPathOrSimWellSelectedInView();
|
||||||
static void addWellLogChannelsToPlotTrack(RimWellLogTrack* plotTrack,
|
static void addWellLogChannelsToPlotTrack(RimWellLogTrack* plotTrack,
|
||||||
const std::vector<RimWellLogFileChannel*>& wellLogFileChannels);
|
const std::vector<RimWellLogFileChannel*>& wellLogFileChannels);
|
||||||
static RimWellPath* selectedWellPathWithLogFile();
|
static RimWellPath* selectedWellPathWithLogFile();
|
||||||
|
static RimWellPath* findWellPathWithLogFileFromSelection();
|
||||||
static RimWellLogExtractionCurve* addExtractionCurve(RimWellLogTrack* plotTrack, Rim3dView* view, RimWellPath* wellPath,
|
static RimWellLogExtractionCurve* addExtractionCurve(RimWellLogTrack* plotTrack, Rim3dView* view, RimWellPath* wellPath,
|
||||||
const RimSimWellInView* simWell, int branchIndex,
|
const RimSimWellInView* simWell, int branchIndex,
|
||||||
bool useBranchDetection);
|
bool useBranchDetection);
|
||||||
|
@ -42,7 +42,7 @@ bool RicAdd3dWellLogCurveFeature::isCommandEnabled()
|
|||||||
RiaApplication::instance()->project()->allCases(cases);
|
RiaApplication::instance()->project()->allCases(cases);
|
||||||
if (cases.empty()) return false;
|
if (cases.empty()) return false;
|
||||||
|
|
||||||
return (RicWellLogTools::selectedWellPath() != nullptr);
|
return RicWellLogTools::findWellPathFromSelection() != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -50,7 +50,8 @@ bool RicAdd3dWellLogCurveFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicAdd3dWellLogCurveFeature::onActionTriggered(bool isChecked)
|
void RicAdd3dWellLogCurveFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
RimWellPath* selectedWellPath = RicWellLogTools::selectedWellPath();
|
RimWellPath* selectedWellPath = RicWellLogTools::findWellPathFromSelection();
|
||||||
|
if (!selectedWellPath) return;
|
||||||
|
|
||||||
Rim3dWellLogExtractionCurve* rim3dWellLogExtractionCurve = new Rim3dWellLogExtractionCurve();
|
Rim3dWellLogExtractionCurve* rim3dWellLogExtractionCurve = new Rim3dWellLogExtractionCurve();
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ bool RicAdd3dWellLogFileCurveFeature::isCommandEnabled()
|
|||||||
RiaApplication::instance()->project()->allCases(cases);
|
RiaApplication::instance()->project()->allCases(cases);
|
||||||
if (cases.empty()) return false;
|
if (cases.empty()) return false;
|
||||||
|
|
||||||
return (RicWellLogTools::selectedWellPathWithLogFile() != nullptr);
|
return (RicWellLogTools::findWellPathWithLogFileFromSelection() != nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -49,7 +49,7 @@ bool RicAdd3dWellLogFileCurveFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicAdd3dWellLogFileCurveFeature::onActionTriggered(bool isChecked)
|
void RicAdd3dWellLogFileCurveFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
RimWellPath* selectedWellPath = RicWellLogTools::selectedWellPathWithLogFile();
|
RimWellPath* selectedWellPath = RicWellLogTools::findWellPathWithLogFileFromSelection();
|
||||||
if (!selectedWellPath) return;
|
if (!selectedWellPath) return;
|
||||||
|
|
||||||
Rim3dWellLogFileCurve* rim3dWellLogFileCurve = new Rim3dWellLogFileCurve();
|
Rim3dWellLogFileCurve* rim3dWellLogFileCurve = new Rim3dWellLogFileCurve();
|
||||||
|
@ -41,17 +41,20 @@ bool RicAdd3dWellLogRftCurveFeature::isCommandEnabled()
|
|||||||
RiaApplication::instance()->project()->allCases(cases);
|
RiaApplication::instance()->project()->allCases(cases);
|
||||||
if (cases.empty()) return false;
|
if (cases.empty()) return false;
|
||||||
|
|
||||||
RimWellPath* wellPath = RicWellLogTools::selectedWellPath();
|
RimWellPath* wellPath = RicWellLogTools::findWellPathFromSelection();
|
||||||
|
if (wellPath)
|
||||||
|
{
|
||||||
return RicWellLogTools::wellHasRftData(wellPath->name());
|
return RicWellLogTools::wellHasRftData(wellPath->name());
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicAdd3dWellLogRftCurveFeature::onActionTriggered(bool isChecked)
|
void RicAdd3dWellLogRftCurveFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
RimWellPath* selectedWellPath = RicWellLogTools::selectedWellPath();
|
RimWellPath* selectedWellPath = RicWellLogTools::findWellPathFromSelection();
|
||||||
if (!selectedWellPath) return;
|
if (!selectedWellPath) return;
|
||||||
|
|
||||||
Rim3dWellLogRftCurve* rim3dWellLogRftCurve = new Rim3dWellLogRftCurve();
|
Rim3dWellLogRftCurve* rim3dWellLogRftCurve = new Rim3dWellLogRftCurve();
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
#include "Rim3dOverlayInfoConfig.h"
|
#include "Rim3dOverlayInfoConfig.h"
|
||||||
|
#include "Rim3dWellLogCurveCollection.h"
|
||||||
|
#include "Rim3dWellLogExtractionCurve.h"
|
||||||
|
#include "Rim3dWellLogFileCurve.h"
|
||||||
|
#include "Rim3dWellLogRftCurve.h"
|
||||||
#include "RimCalcScript.h"
|
#include "RimCalcScript.h"
|
||||||
#include "RimCaseCollection.h"
|
#include "RimCaseCollection.h"
|
||||||
#include "RimCellRangeFilter.h"
|
#include "RimCellRangeFilter.h"
|
||||||
@ -291,6 +295,15 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
menuBuilder << "Separator";
|
menuBuilder << "Separator";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if (dynamic_cast<Rim3dWellLogCurveCollection*>(uiItem) ||
|
||||||
|
dynamic_cast<Rim3dWellLogExtractionCurve*>(uiItem) ||
|
||||||
|
dynamic_cast<Rim3dWellLogFileCurve*>(uiItem) ||
|
||||||
|
dynamic_cast<Rim3dWellLogRftCurve*>(uiItem))
|
||||||
|
{
|
||||||
|
menuBuilder << "RicAdd3dWellLogCurveFeature";
|
||||||
|
menuBuilder << "RicAdd3dWellLogFileCurveFeature";
|
||||||
|
menuBuilder << "RicAdd3dWellLogRftCurveFeature";
|
||||||
|
}
|
||||||
else if (dynamic_cast<RimWellLogFile*>(uiItem))
|
else if (dynamic_cast<RimWellLogFile*>(uiItem))
|
||||||
{
|
{
|
||||||
menuBuilder << "RicWellPathsImportFileFeature";
|
menuBuilder << "RicWellPathsImportFileFeature";
|
||||||
|
Loading…
Reference in New Issue
Block a user