mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add some features to well log plot, track and curve creation.
* Needed for creating the well bore stability plots * Add ability to set plot and track titles * Make updating and refreshing plots optional when adding curves/tracks so it can be done at the end instead. * Optionally set custom titles to the plots and tracks.
This commit is contained in:
@@ -29,23 +29,37 @@
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot()
|
||||
RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot(bool showAfterCreation, const QString& plotDescription)
|
||||
{
|
||||
RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection();
|
||||
CVF_ASSERT(wellLogPlotColl);
|
||||
|
||||
RimWellLogPlot* plot = new RimWellLogPlot();
|
||||
plot->setAsPlotMdiWindow();
|
||||
|
||||
wellLogPlotColl->wellLogPlots().push_back(plot);
|
||||
|
||||
// Make sure the summary plot window is created and visible
|
||||
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
||||
// Make sure the summary plot window is created
|
||||
RiaApplication::instance()->getOrCreateMainPlotWindow();
|
||||
|
||||
plot->setDescription(QString("Well Log Plot %1").arg(wellLogPlotCollection()->wellLogPlots.size()));
|
||||
if (!plotDescription.isEmpty())
|
||||
{
|
||||
plot->setDescription(plotDescription);
|
||||
}
|
||||
else
|
||||
{
|
||||
plot->setDescription(QString("Well Log Plot %1").arg(wellLogPlotCollection()->wellLogPlots.size()));
|
||||
}
|
||||
|
||||
if (showAfterCreation)
|
||||
{
|
||||
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
||||
}
|
||||
|
||||
return plot;
|
||||
}
|
||||
@@ -53,21 +67,45 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack()
|
||||
RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(bool updateAfter, const QString& trackDescription, RimWellLogPlot* existingPlot)
|
||||
{
|
||||
RimWellLogPlot* plot = createWellLogPlot();
|
||||
RimWellLogPlot* plot = existingPlot;
|
||||
if (plot == nullptr)
|
||||
{
|
||||
plot = createWellLogPlot();
|
||||
}
|
||||
|
||||
RimWellLogTrack* plotTrack = new RimWellLogTrack();
|
||||
plot->addTrack(plotTrack);
|
||||
plotTrack->setDescription(QString("Track %1").arg(plot->trackCount()));
|
||||
if (!trackDescription.isEmpty())
|
||||
{
|
||||
plotTrack->setDescription(trackDescription);
|
||||
}
|
||||
else
|
||||
{
|
||||
plotTrack->setDescription(QString("Track %1").arg(plot->trackCount()));
|
||||
}
|
||||
|
||||
plot->loadDataAndUpdate();
|
||||
plot->updateConnectedEditors();
|
||||
RiaApplication::instance()->project()->updateConnectedEditors();
|
||||
if (updateAfter)
|
||||
{
|
||||
updateAfterCreation(plot);
|
||||
}
|
||||
|
||||
return plotTrack;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellLogPlotFeatureImpl::updateAfterCreation(RimWellLogPlot* plot)
|
||||
{
|
||||
CVF_ASSERT(plot);
|
||||
plot->loadDataAndUpdate();
|
||||
plot->updateDepthZoom();
|
||||
plot->updateConnectedEditors();
|
||||
RiaApplication::instance()->project()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user