mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#468) Added context menu item in 3D view for plotting of logs from LAS files
This commit is contained in:
parent
e7866cbdfd
commit
8667b6baa0
@ -20,9 +20,13 @@
|
||||
#include "RicNewWellLogFileCurveFeature.h"
|
||||
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||
|
||||
#include "RimWellLogFileCurve.h"
|
||||
#include "RimWellLogPlotTrack.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
@ -40,7 +44,7 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogFileCurveFeature, "RicNewWellLogFileCurveFeatur
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewWellLogFileCurveFeature::isCommandEnabled()
|
||||
{
|
||||
return selectedWellLogPlotTrack() != NULL;
|
||||
return selectedWellLogPlotTrack() != NULL || selectedWellLogPlotTrackWithLogFile() != NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -53,6 +57,17 @@ void RicNewWellLogFileCurveFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
addCurve(wellLogPlotTrack);
|
||||
}
|
||||
else
|
||||
{
|
||||
RimWellPath* wellPath = selectedWellLogPlotTrackWithLogFile();
|
||||
if (wellPath)
|
||||
{
|
||||
RimWellLogPlotTrack* wellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
|
||||
RimWellLogFileCurve* plotCurve = addCurve(wellLogPlotTrack);
|
||||
plotCurve->setWellPath(wellPath);
|
||||
plotCurve->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -76,13 +91,33 @@ RimWellLogPlotTrack* RicNewWellLogFileCurveFeature::selectedWellLogPlotTrack()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellLogFileCurveFeature::addCurve(RimWellLogPlotTrack* plotTrack)
|
||||
RimWellPath* RicNewWellLogFileCurveFeature::selectedWellLogPlotTrackWithLogFile()
|
||||
{
|
||||
std::vector<RimWellPath*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
if (selection.size() > 0)
|
||||
{
|
||||
RimWellPath* wellPath = selection[0];
|
||||
if (wellPath->m_wellLogFile())
|
||||
{
|
||||
return wellPath;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogFileCurve* RicNewWellLogFileCurveFeature::addCurve(RimWellLogPlotTrack* plotTrack)
|
||||
{
|
||||
CVF_ASSERT(plotTrack);
|
||||
|
||||
size_t curveIndex = plotTrack->curveCount();
|
||||
|
||||
RimWellLogPlotCurve* curve = new RimWellLogFileCurve();
|
||||
RimWellLogFileCurve* curve = new RimWellLogFileCurve();
|
||||
plotTrack->addCurve(curve);
|
||||
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromIndex(curveIndex);
|
||||
@ -91,4 +126,6 @@ void RicNewWellLogFileCurveFeature::addCurve(RimWellLogPlotTrack* plotTrack)
|
||||
plotTrack->updateConnectedEditors();
|
||||
|
||||
RiuMainWindow::instance()->setCurrentObjectInTreeView(curve);
|
||||
|
||||
return curve;
|
||||
}
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimWellLogPlotTrack;
|
||||
class RimWellLogFileCurve;
|
||||
class RimWellPath;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -31,7 +33,7 @@ class RicNewWellLogFileCurveFeature : public caf::CmdFeature
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
static void addCurve(RimWellLogPlotTrack* plotTrack);
|
||||
static RimWellLogFileCurve* addCurve(RimWellLogPlotTrack* plotTrack);
|
||||
|
||||
|
||||
protected:
|
||||
@ -42,4 +44,5 @@ protected:
|
||||
|
||||
private:
|
||||
RimWellLogPlotTrack* selectedWellLogPlotTrack();
|
||||
RimWellPath* selectedWellLogPlotTrackWithLogFile();
|
||||
};
|
||||
|
@ -20,11 +20,14 @@
|
||||
#include "RicNewWellLogPlotFeature.h"
|
||||
|
||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||
#include "RicNewWellLogFileCurveFeature.h"
|
||||
#include "RicNewWellLogCurveExtractionFeature.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotTrack.h"
|
||||
#include "RicNewWellLogCurveExtractionFeature.h"
|
||||
#include "RimWellLogPlotCurve.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include <QAction>
|
||||
@ -47,16 +50,7 @@ bool RicNewWellLogPlotFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimWellLogPlot* plot = RicNewWellLogPlotFeatureImpl::createWellLogPlot();
|
||||
|
||||
RimWellLogPlotTrack* plotTrack = new RimWellLogPlotTrack();
|
||||
plot->addTrack(plotTrack);
|
||||
plotTrack->setDescription(QString("Track %1").arg(plot->trackCount()));
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
plot->updateConnectedEditors();
|
||||
RiaApplication::instance()->project()->updateConnectedEditors();
|
||||
|
||||
RimWellLogPlotTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
|
||||
RicNewWellLogCurveExtractionFeature::addCurve(plotTrack);
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotTrack.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
@ -78,3 +79,21 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot()
|
||||
|
||||
return plot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlotTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack()
|
||||
{
|
||||
RimWellLogPlot* plot = createWellLogPlot();
|
||||
|
||||
RimWellLogPlotTrack* plotTrack = new RimWellLogPlotTrack();
|
||||
plot->addTrack(plotTrack);
|
||||
plotTrack->setDescription(QString("Track %1").arg(plot->trackCount()));
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
plot->updateConnectedEditors();
|
||||
RiaApplication::instance()->project()->updateConnectedEditors();
|
||||
|
||||
return plotTrack;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
class RimMainPlotCollection;
|
||||
class RimWellLogPlotCollection;
|
||||
class RimWellLogPlot;
|
||||
class RimWellLogPlotTrack;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -33,4 +34,5 @@ public:
|
||||
static RimMainPlotCollection* mainPlotCollection();
|
||||
static RimWellLogPlotCollection* wellLogPlotCollection();
|
||||
static RimWellLogPlot* createWellLogPlot();
|
||||
static RimWellLogPlotTrack* createWellLogPlotTrack();
|
||||
};
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "RicEclipsePropertyFilterNewExec.h"
|
||||
#include "RicGeoMechPropertyFilterNewExec.h"
|
||||
#include "RicRangeFilterNewExec.h"
|
||||
#include "Commands/WellLogCommands/RicNewWellLogFileCurveFeature.h"
|
||||
|
||||
#include "RigCaseData.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
@ -49,6 +50,7 @@
|
||||
#include "RimView.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellLogFile.h"
|
||||
|
||||
#include "RiuFemResultTextBuilder.h"
|
||||
#include "RiuMainWindow.h"
|
||||
@ -63,6 +65,7 @@
|
||||
#include "cafCmdExecCommandManager.h"
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfHitItemCollection.h"
|
||||
@ -200,6 +203,28 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
}
|
||||
}
|
||||
|
||||
if (firstHitPart && firstHitPart->sourceInfo())
|
||||
{
|
||||
const RivWellPathSourceInfo* wellPathSourceInfo = dynamic_cast<const RivWellPathSourceInfo*>(firstHitPart->sourceInfo());
|
||||
if (wellPathSourceInfo)
|
||||
{
|
||||
RimWellPath* wellPath = wellPathSourceInfo->wellPath();
|
||||
if (wellPath)
|
||||
{
|
||||
// TODO: Handle selection through mouse events outside this method, or after ray picking above
|
||||
caf::SelectionManager::instance()->setSelectedItem(wellPath);
|
||||
RiaApplication::instance()->project()->updateConnectedEditors();
|
||||
|
||||
RicNewWellLogFileCurveFeature* newWellLogFileCurveFeature = dynamic_cast<RicNewWellLogFileCurveFeature*>(caf::CmdFeatureManager::instance()->getCommandFeature("RicNewWellLogFileCurveFeature"));
|
||||
CVF_ASSERT(newWellLogFileCurveFeature);
|
||||
|
||||
menu.addAction(newWellLogFileCurveFeature->action());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (firstHitPart)
|
||||
|
||||
// View Link commands
|
||||
{
|
||||
QStringList commandIds;
|
||||
@ -604,5 +629,3 @@ void RiuViewerCommands::ijkFromCellIndex(size_t gridIdx, size_t cellIndex, size
|
||||
geomView->geoMechCase()->geoMechData()->femParts()->part(gridIdx)->structGrid()->ijkFromCellIndex(cellIndex, i, j, k);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user