mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3184 Enable creation of plots within plot window.
This commit is contained in:
@@ -373,6 +373,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicPasteWellLogPlotFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicNewWellLogPlotFeature";
|
||||
menuBuilder << "RicNewWellBoreStabilityPlotFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimRftPlotCollection*>(uiItem))
|
||||
{
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
#include "RimWellLogFileCurve.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
@@ -225,8 +227,24 @@ void RimWellLogCurveCommonDataSource::updateCurves(std::vector<RimWellLogCurve*>
|
||||
std::set<RimWellLogPlot*> plots;
|
||||
for (RimWellLogCurve* curve : curves)
|
||||
{
|
||||
RimWellLogFileCurve* fileCurve = dynamic_cast<RimWellLogFileCurve*>(curve);
|
||||
RimWellLogExtractionCurve* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>(curve);
|
||||
if (extractionCurve)
|
||||
if (fileCurve)
|
||||
{
|
||||
if (wellPathToApply() != nullptr)
|
||||
{
|
||||
fileCurve->setWellPath(wellPathToApply());
|
||||
if (!fileCurve->wellLogChannelName().isEmpty())
|
||||
{
|
||||
RimWellLogFile* logFile = wellPathToApply()->firstWellLogFileMatchingChannelName(fileCurve->wellLogChannelName());
|
||||
fileCurve->setWellLogFile(logFile);
|
||||
RimWellLogPlot* parentPlot = nullptr;
|
||||
fileCurve->firstAncestorOrThisOfTypeAsserted(parentPlot);
|
||||
plots.insert(parentPlot);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (extractionCurve)
|
||||
{
|
||||
bool updatedSomething = false;
|
||||
if (caseToApply() != nullptr)
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogFileChannel.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimWellPathAttributeCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
@@ -377,6 +378,27 @@ std::vector<RimWellLogFile*> RimWellPath::wellLogFiles() const
|
||||
{
|
||||
return std::vector<RimWellLogFile*>(m_wellLogFiles.begin(), m_wellLogFiles.end());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogFile* RimWellPath::firstWellLogFileMatchingChannelName(const QString& channelName) const
|
||||
{
|
||||
std::vector<RimWellLogFile*> allWellLogFiles = wellLogFiles();
|
||||
for (RimWellLogFile* logFile : allWellLogFiles)
|
||||
{
|
||||
std::vector<RimWellLogFileChannel*> channels = logFile->wellLogChannels();
|
||||
for (RimWellLogFileChannel* channel : channels)
|
||||
{
|
||||
if (channel->name() == channelName)
|
||||
{
|
||||
return logFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -90,6 +90,7 @@ public:
|
||||
void deleteWellLogFile(RimWellLogFile* logFileInfo);
|
||||
void detachWellLogFile(RimWellLogFile* logFileInfo);
|
||||
std::vector<RimWellLogFile*> wellLogFiles() const;
|
||||
RimWellLogFile* firstWellLogFileMatchingChannelName(const QString& channelName) const;
|
||||
|
||||
void setFormationsGeometry(cvf::ref<RigWellPathFormations> wellPathFormations);
|
||||
bool readWellPathFormationsFile(QString* errorMessage, RifWellPathFormationsImporter* wellPathFormationsImporter);
|
||||
|
||||
Reference in New Issue
Block a user