mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Well Log Plot and Well Distribution Plots no longer inherit Multiplot
* Also cleaned up RiuQwtPlotWidget
This commit is contained in:
@@ -245,7 +245,7 @@ void RicShowPlotDataFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
for ( RimWellLogPlot* wellLogPlot : wellLogPlots )
|
||||
{
|
||||
QString title = wellLogPlot->multiPlotTitle();
|
||||
QString title = wellLogPlot->description();
|
||||
QString text = wellLogPlot->asciiDataForPlotExport();
|
||||
RicShowPlotDataFeature::showTextWindow( title, text );
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "RiaPlotWindowRedrawScheduler.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiPlotWindow.h"
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimViewWindow.h"
|
||||
@@ -106,7 +106,7 @@ void RicSnapshotViewToFileFeature::savePlotPDFReportAs( const QString& fileName,
|
||||
pdfPrinter.setResolution( resolution );
|
||||
QRect widgetRect = plot->viewWidget()->contentsRect();
|
||||
|
||||
RimMultiPlotWindow* multiPlot = dynamic_cast<RimMultiPlotWindow*>( plot );
|
||||
RimMultiPlot* multiPlot = dynamic_cast<RimMultiPlot*>( plot );
|
||||
if ( multiPlot && multiPlot->previewModeEnabled() )
|
||||
{
|
||||
QRect pageRect = pdfPrinter.pageLayout().fullRectPixels( resolution );
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "RimGridTimeHistoryCurve.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimIntersectionResultDefinition.h"
|
||||
#include "RimMultiPlotWindow.h"
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimPolylinesAnnotation.h"
|
||||
#include "RimReachCircleAnnotation.h"
|
||||
@@ -112,7 +112,7 @@ bool isDeletable( caf::PdmUiItem* uiItem )
|
||||
if ( dynamic_cast<RimWellLogCurve*>( uiItem ) ) return true;
|
||||
if ( dynamic_cast<RimSummaryPlot*>( uiItem ) )
|
||||
{
|
||||
RimMultiPlotWindow* plotWindow = nullptr;
|
||||
RimMultiPlot* plotWindow = nullptr;
|
||||
static_cast<RimSummaryPlot*>( uiItem )->firstAncestorOrThisOfType( plotWindow );
|
||||
return plotWindow == nullptr;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ bool isDeletable( caf::PdmUiItem* uiItem )
|
||||
|
||||
if ( dynamic_cast<RimGridCrossPlot*>( uiItem ) )
|
||||
{
|
||||
RimMultiPlotWindow* plotWindow = nullptr;
|
||||
RimMultiPlot* plotWindow = nullptr;
|
||||
static_cast<RimGridCrossPlot*>( uiItem )->firstAncestorOrThisOfType( plotWindow );
|
||||
return plotWindow == nullptr;
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimMultiPlotCollection.h"
|
||||
#include "RimMultiPlotWindow.h"
|
||||
#include "RimPlot.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
@@ -53,7 +53,7 @@ RicfCommandResponse RicNewMultiPlotFeature::execute()
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
RimMultiPlotCollection* plotCollection = project->mainPlotCollection()->multiPlotCollection();
|
||||
|
||||
RimMultiPlotWindow* plotWindow = new RimMultiPlotWindow;
|
||||
RimMultiPlot* plotWindow = new RimMultiPlot;
|
||||
plotWindow->setMultiPlotTitle( QString( "Multi Plot %1" ).arg( plotCollection->multiPlots().size() + 1 ) );
|
||||
plotWindow->setAsPlotMdiWindow();
|
||||
plotCollection->addMultiPlot( plotWindow );
|
||||
@@ -68,7 +68,7 @@ RicfCommandResponse RicNewMultiPlotFeature::execute()
|
||||
plotWindow->movePlotsToThis( plots, nullptr );
|
||||
}
|
||||
|
||||
plotCollection->updateAllRequiredEditors();
|
||||
project->updateAllRequiredEditors();
|
||||
plotWindow->loadDataAndUpdate();
|
||||
|
||||
RiuPlotMainWindowTools::setExpanded( plotCollection, true );
|
||||
@@ -82,13 +82,6 @@ RicfCommandResponse RicNewMultiPlotFeature::execute()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewMultiPlotFeature::isCommandEnabled()
|
||||
{
|
||||
RimMultiPlotCollection* multiPlotCollection =
|
||||
caf::SelectionManager::instance()->selectedItemOfType<RimMultiPlotCollection>();
|
||||
if ( multiPlotCollection )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
auto plots = selectedPlots();
|
||||
|
||||
std::vector<caf::PdmUiItem*> selectedUiItems;
|
||||
@@ -116,16 +109,8 @@ void RicNewMultiPlotFeature::onActionTriggered( bool isChecked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewMultiPlotFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
if ( selectedPlots().empty() )
|
||||
{
|
||||
actionToSetup->setText( "New Empty Multi Plot" );
|
||||
actionToSetup->setIcon( QIcon( ":/WellLogPlot16x16.png" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
actionToSetup->setText( "Create Multi Plot from Selected Plots" );
|
||||
actionToSetup->setIcon( QIcon( ":/WellLogPlot16x16.png" ) );
|
||||
}
|
||||
actionToSetup->setText( "Create Multi Plot from Selected Plots" );
|
||||
actionToSetup->setIcon( QIcon( ":/WellLogPlot16x16.png" ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -97,7 +97,6 @@ RicSummaryCurveCreator::RicSummaryCurveCreator()
|
||||
CAF_PDM_InitFieldNoDefault( &m_regionAppearanceType, "RegionAppearanceType", "Region", "", "", "" );
|
||||
|
||||
m_previewPlot.reset( new RimSummaryPlot() );
|
||||
m_previewPlot->setDraggable( false );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_useAutoPlotTitleProxy, "UseAutoPlotTitle", "Auto Plot Title", "", "", "" );
|
||||
m_useAutoPlotTitleProxy.registerGetMethod( this, &RicSummaryCurveCreator::proxyPlotAutoTitle );
|
||||
|
||||
@@ -240,7 +240,7 @@ QWidget* RicSummaryCurveCreatorSplitterUi::getOrCreatePlotWidget()
|
||||
if ( m_summaryCurveCreator )
|
||||
{
|
||||
// TODO: Rename previewPlot()->createViewWidget to getOrCreateViewWidget
|
||||
return m_summaryCurveCreator->previewPlot()->createViewWidget( this->widget() );
|
||||
return m_summaryCurveCreator->previewPlot()->createPlotWidget( this->widget() );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -65,7 +65,7 @@ void RicAsciiExportWellLogPlotFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimWellLogPlot* wellLogPlot = selectedWellLogPlots.at( 0 );
|
||||
QString defaultFileName = defaultDir + "/" +
|
||||
caf::Utils::makeValidFileBasename( ( wellLogPlot->multiPlotTitle() ) ) + ".ascii";
|
||||
caf::Utils::makeValidFileBasename( ( wellLogPlot->description() ) ) + ".ascii";
|
||||
QString fileName = QFileDialog::getSaveFileName( nullptr,
|
||||
"Select File for Plot Data Export",
|
||||
defaultFileName,
|
||||
@@ -81,7 +81,7 @@ void RicAsciiExportWellLogPlotFeature::onActionTriggered( bool isChecked )
|
||||
std::vector<QString> fileNames;
|
||||
for ( RimWellLogPlot* wellLogPlot : selectedWellLogPlots )
|
||||
{
|
||||
QString fileName = caf::Utils::makeValidFileBasename( wellLogPlot->multiPlotTitle() ) + ".ascii";
|
||||
QString fileName = caf::Utils::makeValidFileBasename( wellLogPlot->description() ) + ".ascii";
|
||||
fileNames.push_back( fileName );
|
||||
}
|
||||
|
||||
@@ -92,8 +92,7 @@ void RicAsciiExportWellLogPlotFeature::onActionTriggered( bool isChecked )
|
||||
RiaLogging::info( QString( "Writing to directory %!" ).arg( saveDir ) );
|
||||
for ( RimWellLogPlot* wellLogPlot : selectedWellLogPlots )
|
||||
{
|
||||
QString fileName = saveDir + "/" + caf::Utils::makeValidFileBasename( wellLogPlot->multiPlotTitle() ) +
|
||||
".ascii";
|
||||
QString fileName = saveDir + "/" + caf::Utils::makeValidFileBasename( wellLogPlot->description() ) + ".ascii";
|
||||
RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot( fileName, wellLogPlot );
|
||||
|
||||
progress++;
|
||||
@@ -119,8 +118,7 @@ QString RicAsciiExportWellLogPlotFeature::makeValidExportFileName( const RimWell
|
||||
const QString& prefix,
|
||||
bool capitalizeFileName )
|
||||
{
|
||||
QString fileName = folder + "/" + prefix + caf::Utils::makeValidFileBasename( wellLogPlot->multiPlotTitle() ) +
|
||||
".ascii";
|
||||
QString fileName = folder + "/" + prefix + caf::Utils::makeValidFileBasename( wellLogPlot->description() ) + ".ascii";
|
||||
if ( capitalizeFileName ) fileName = fileName.toUpper();
|
||||
|
||||
QDir dir( folder );
|
||||
@@ -143,7 +141,7 @@ bool RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot( const QString&
|
||||
|
||||
QTextStream out( &file );
|
||||
|
||||
out << wellLogPlot->multiPlotTitle();
|
||||
out << wellLogPlot->description();
|
||||
out << "\n";
|
||||
out << wellLogPlot->asciiDataForPlotExport();
|
||||
out << "\n\n";
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
|
||||
#include "RimMultiPlotWindow.h"
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
@@ -50,7 +50,7 @@ bool RicDeleteSubPlotFeature::isCommandEnabled()
|
||||
size_t plotsSelected = 0;
|
||||
for ( caf::PdmObject* object : selection )
|
||||
{
|
||||
RimMultiPlotWindow* multiPlot = nullptr;
|
||||
RimMultiPlot* multiPlot = nullptr;
|
||||
object->firstAncestorOrThisOfType( multiPlot );
|
||||
if ( dynamic_cast<RimPlotWindow*>( object ) && multiPlot )
|
||||
{
|
||||
@@ -72,11 +72,11 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
std::vector<RimPlot*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType( &selection );
|
||||
std::set<RimMultiPlotWindow*> alteredPlotWindows;
|
||||
std::set<RimMultiPlot*> alteredPlotWindows;
|
||||
|
||||
for ( RimPlot* plot : selection )
|
||||
{
|
||||
RimMultiPlotWindow* plotWindow = nullptr;
|
||||
RimMultiPlot* plotWindow = nullptr;
|
||||
plot->firstAncestorOrThisOfType( plotWindow );
|
||||
if ( plot && plotWindow )
|
||||
{
|
||||
@@ -89,7 +89,7 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
}
|
||||
|
||||
for ( RimMultiPlotWindow* plotWindow : alteredPlotWindows )
|
||||
for ( RimMultiPlot* plotWindow : alteredPlotWindows )
|
||||
{
|
||||
plotWindow->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void RicNewPltPlotFeature::onActionTriggered( bool isChecked )
|
||||
plotTrack->setDescription( QString( "Track %1" ).arg( pltPlot->plotCount() ) );
|
||||
|
||||
pltPlotColl->addPlot( pltPlot );
|
||||
pltPlot->setMultiPlotTitle( plotName );
|
||||
pltPlot->nameConfig()->setCustomName( plotName );
|
||||
|
||||
// pltPlot->applyInitialSelections();
|
||||
pltPlot->loadDataAndUpdate();
|
||||
|
||||
@@ -81,7 +81,7 @@ void RicNewRftPlotFeature::onActionTriggered( bool isChecked )
|
||||
wellName = rftPlot->simWellOrWellPathName(); // We may have been given a default well name
|
||||
QString plotName = QString( RimWellRftPlot::plotNameFormatString() ).arg( wellName );
|
||||
|
||||
rftPlot->setMultiPlotTitle( plotName );
|
||||
rftPlot->nameConfig()->setCustomName( plotName );
|
||||
|
||||
rftPlot->loadDataAndUpdate();
|
||||
rftPlotColl->updateConnectedEditors();
|
||||
|
||||
@@ -102,11 +102,11 @@ RimWellBoreStabilityPlot*
|
||||
auto task = progInfo.task( "Updating all tracks", 5 );
|
||||
|
||||
plot->nameConfig()->setAutoNameTags( true, true, true, false, true );
|
||||
plot->setMultiPlotTitleVisible( true );
|
||||
plot->setPlotTitleVisible( true );
|
||||
plot->setLegendsVisible( true );
|
||||
plot->setLegendsHorizontal( true );
|
||||
plot->setDepthType( RiaDefines::TRUE_VERTICAL_DEPTH );
|
||||
plot->setAutoScaleYEnabled( true );
|
||||
plot->setAutoScaleDepthEnabled( true );
|
||||
|
||||
RicNewWellLogPlotFeatureImpl::updateAfterCreation( plot );
|
||||
}
|
||||
|
||||
@@ -58,11 +58,11 @@ RimWellBoreStabilityPlot*
|
||||
|
||||
if ( !plotDescription.isEmpty() )
|
||||
{
|
||||
plot->setMultiPlotTitle( plotDescription );
|
||||
plot->nameConfig()->setCustomName( plotDescription );
|
||||
}
|
||||
else
|
||||
{
|
||||
plot->setMultiPlotTitle(
|
||||
plot->nameConfig()->setCustomName(
|
||||
QString( "Well Bore Stability Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) );
|
||||
}
|
||||
|
||||
@@ -92,11 +92,12 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot( bool showAfterC
|
||||
|
||||
if ( !plotDescription.isEmpty() )
|
||||
{
|
||||
plot->setMultiPlotTitle( plotDescription );
|
||||
plot->nameConfig()->setCustomName( plotDescription );
|
||||
}
|
||||
else
|
||||
{
|
||||
plot->setMultiPlotTitle( QString( "Well Log Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) );
|
||||
plot->nameConfig()->setCustomName(
|
||||
QString( "Well Log Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) );
|
||||
}
|
||||
|
||||
if ( showAfterCreation )
|
||||
|
||||
@@ -85,8 +85,8 @@ void RicPasteWellLogPlotFeature::onActionTriggered( bool isChecked )
|
||||
newObject->resolveReferencesRecursively();
|
||||
newObject->initAfterReadRecursively();
|
||||
|
||||
QString description = "Copy of " + newObject->multiPlotTitle();
|
||||
newObject->setMultiPlotTitle( description );
|
||||
QString customName = "Copy of " + newObject->nameConfig()->customName();
|
||||
newObject->nameConfig()->setCustomName( customName );
|
||||
|
||||
newObject->loadDataAndUpdate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user