diff --git a/ApplicationCode/Commands/ApplicationCommands/RicShowPlotDataFeature.cpp b/ApplicationCode/Commands/ApplicationCommands/RicShowPlotDataFeature.cpp index 8ff88d3b27..7e50dd66ef 100644 --- a/ApplicationCode/Commands/ApplicationCommands/RicShowPlotDataFeature.cpp +++ b/ApplicationCode/Commands/ApplicationCommands/RicShowPlotDataFeature.cpp @@ -245,7 +245,7 @@ void RicShowPlotDataFeature::onActionTriggered( bool isChecked ) for ( RimWellLogPlot* wellLogPlot : wellLogPlots ) { - QString title = wellLogPlot->description(); + QString title = wellLogPlot->multiPlotTitle(); QString text = wellLogPlot->asciiDataForPlotExport(); RicShowPlotDataFeature::showTextWindow( title, text ); } diff --git a/ApplicationCode/Commands/RicNewGridPlotWindowFeature.cpp b/ApplicationCode/Commands/RicNewGridPlotWindowFeature.cpp index b8122362bf..9f315649d1 100644 --- a/ApplicationCode/Commands/RicNewGridPlotWindowFeature.cpp +++ b/ApplicationCode/Commands/RicNewGridPlotWindowFeature.cpp @@ -54,7 +54,7 @@ RicfCommandResponse RicNewGridPlotWindowFeature::execute() RimGridPlotWindowCollection* plotCollection = project->mainPlotCollection()->combinationPlotCollection(); RimGridPlotWindow* plotWindow = new RimGridPlotWindow; - plotWindow->setDescription( QString( "Combination Plot %1" ).arg( plotCollection->gridPlotWindows().size() + 1 ) ); + plotWindow->setMultiPlotTitle( QString( "Combination Plot %1" ).arg( plotCollection->gridPlotWindows().size() + 1 ) ); plotWindow->setAsPlotMdiWindow(); plotCollection->addGridPlotWindow( plotWindow ); diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp index 2cbbd80f33..ebbdbc8c8b 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp @@ -910,7 +910,7 @@ void RicSummaryCurveCreator::selectionEditorFieldChanged() void RicSummaryCurveCreator::proxyEnablePlotAutoTitle( const bool& enable ) { m_previewPlot->enableAutoPlotTitle( enable ); - m_previewPlot->setPlotTitleVisible( enable ); + m_previewPlot->setShowPlotTitle( enable ); m_previewPlot->updateCurveNames(); m_previewPlot->loadDataAndUpdate(); } diff --git a/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp index de72c012a7..0d7ef55fd0 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp @@ -65,7 +65,7 @@ void RicAsciiExportWellLogPlotFeature::onActionTriggered( bool isChecked ) { RimWellLogPlot* wellLogPlot = selectedWellLogPlots.at( 0 ); QString defaultFileName = defaultDir + "/" + - caf::Utils::makeValidFileBasename( ( wellLogPlot->description() ) ) + ".ascii"; + caf::Utils::makeValidFileBasename( ( wellLogPlot->multiPlotTitle() ) ) + ".ascii"; QString fileName = QFileDialog::getSaveFileName( nullptr, "Select File for Plot Data Export", defaultFileName, @@ -81,7 +81,7 @@ void RicAsciiExportWellLogPlotFeature::onActionTriggered( bool isChecked ) std::vector fileNames; for ( RimWellLogPlot* wellLogPlot : selectedWellLogPlots ) { - QString fileName = caf::Utils::makeValidFileBasename( wellLogPlot->description() ) + ".ascii"; + QString fileName = caf::Utils::makeValidFileBasename( wellLogPlot->multiPlotTitle() ) + ".ascii"; fileNames.push_back( fileName ); } @@ -92,7 +92,8 @@ void RicAsciiExportWellLogPlotFeature::onActionTriggered( bool isChecked ) RiaLogging::info( QString( "Writing to directory %!" ).arg( saveDir ) ); for ( RimWellLogPlot* wellLogPlot : selectedWellLogPlots ) { - QString fileName = saveDir + "/" + caf::Utils::makeValidFileBasename( wellLogPlot->description() ) + ".ascii"; + QString fileName = saveDir + "/" + caf::Utils::makeValidFileBasename( wellLogPlot->multiPlotTitle() ) + + ".ascii"; RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot( fileName, wellLogPlot ); progress++; @@ -118,7 +119,8 @@ QString RicAsciiExportWellLogPlotFeature::makeValidExportFileName( const RimWell const QString& prefix, bool capitalizeFileName ) { - QString fileName = folder + "/" + prefix + caf::Utils::makeValidFileBasename( wellLogPlot->description() ) + ".ascii"; + QString fileName = folder + "/" + prefix + caf::Utils::makeValidFileBasename( wellLogPlot->multiPlotTitle() ) + + ".ascii"; if ( capitalizeFileName ) fileName = fileName.toUpper(); QDir dir( folder ); @@ -141,7 +143,7 @@ bool RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot( const QString& QTextStream out( &file ); - out << wellLogPlot->description(); + out << wellLogPlot->multiPlotTitle(); out << "\n"; out << wellLogPlot->asciiDataForPlotExport(); out << "\n\n"; diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewPltPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewPltPlotFeature.cpp index 42d0810c6d..9d00f11a9f 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewPltPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewPltPlotFeature.cpp @@ -116,7 +116,7 @@ void RicNewPltPlotFeature::onActionTriggered( bool isChecked ) plotTrack->setDescription( QString( "Track %1" ).arg( pltPlot->plotCount() ) ); pltPlotColl->addPlot( pltPlot ); - pltPlot->setDescription( plotName ); + pltPlot->setMultiPlotTitle( plotName ); // pltPlot->applyInitialSelections(); pltPlot->loadDataAndUpdate(); diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewRftPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewRftPlotFeature.cpp index 80e51a486b..147ca9f30a 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewRftPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewRftPlotFeature.cpp @@ -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->setDescription( plotName ); + rftPlot->setMultiPlotTitle( plotName ); rftPlot->loadDataAndUpdate(); rftPlotColl->updateConnectedEditors(); diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp index 1e9b3fad9a..9b6aa34c40 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp @@ -98,7 +98,7 @@ RimWellBoreStabilityPlot* auto task = progInfo.task( "Updating all tracks", 5 ); plot->enableAllAutoNameTags( true ); - plot->setPlotTitleVisible( true ); + plot->setMultiPlotTitleVisible( true ); plot->setLegendsVisible( true ); plot->setLegendsHorizontal( true ); plot->setDepthType( RiaDefines::TRUE_VERTICAL_DEPTH ); diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeatureImpl.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeatureImpl.cpp index 81c2e7ba05..3b26b74276 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeatureImpl.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeatureImpl.cpp @@ -58,11 +58,11 @@ RimWellBoreStabilityPlot* if ( !plotDescription.isEmpty() ) { - plot->setDescription( plotDescription ); + plot->setMultiPlotTitle( plotDescription ); } else { - plot->setDescription( + plot->setMultiPlotTitle( QString( "Well Bore Stability Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) ); } @@ -92,11 +92,11 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot( bool showAfterC if ( !plotDescription.isEmpty() ) { - plot->setDescription( plotDescription ); + plot->setMultiPlotTitle( plotDescription ); } else { - plot->setDescription( QString( "Well Log Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) ); + plot->setMultiPlotTitle( QString( "Well Log Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) ); } if ( showAfterCreation ) diff --git a/ApplicationCode/Commands/WellLogCommands/RicPasteWellLogPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicPasteWellLogPlotFeature.cpp index 0ba089d542..33a9afdaf3 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicPasteWellLogPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicPasteWellLogPlotFeature.cpp @@ -83,8 +83,8 @@ void RicPasteWellLogPlotFeature::onActionTriggered( bool isChecked ) newObject->resolveReferencesRecursively(); newObject->initAfterReadRecursively(); - QString description = "Copy of " + newObject->description(); - newObject->setDescription( description ); + QString description = "Copy of " + newObject->multiPlotTitle(); + newObject->setMultiPlotTitle( description ); newObject->loadDataAndUpdate(); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index 69bab4bf77..97b63b0f35 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -210,7 +210,7 @@ void RimWellAllocationPlot::updateFromWell() if ( m_flowType() == ACCUMULATED ) description = "Accumulated Flow"; if ( m_flowType() == INFLOW ) description = "Inflow Rates"; - accumulatedWellFlowPlot()->setDescription( description + " (" + m_wellName + ")" ); + accumulatedWellFlowPlot()->setMultiPlotTitle( description + " (" + m_wellName + ")" ); if ( !m_case ) return; diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index c589c01dcb..e09b654939 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -891,7 +891,7 @@ void RimWellPltPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, if ( changedField == &m_wellPathName ) { - setDescription( QString( plotNameFormatString() ).arg( m_wellPathName ) ); + setMultiPlotTitle( QString( plotNameFormatString() ).arg( m_wellPathName ) ); } if ( changedField == &m_wellPathName ) @@ -1039,9 +1039,9 @@ void RimWellPltPlot::initAfterRead() wellLogPlot = std::move( *m_wellLogPlot_OBSOLETE.value() ); } - if ( m_showPlotTitle_OBSOLETE() && !m_showTitleInPlot() ) + if ( m_showPlotTitle_OBSOLETE() && !m_showPlotWindowTitle() ) { - m_showTitleInPlot = m_showPlotTitle_OBSOLETE(); + m_showPlotWindowTitle = m_showPlotTitle_OBSOLETE(); } RimWellLogPlot::initAfterRead(); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp index 15547e6692..55ca942082 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellRftPlot.cpp @@ -851,7 +851,7 @@ void RimWellRftPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, if ( changedField == &m_wellPathNameOrSimWellName ) { - setDescription( QString( plotNameFormatString() ).arg( m_wellPathNameOrSimWellName ) ); + setMultiPlotTitle( QString( plotNameFormatString() ).arg( m_wellPathNameOrSimWellName ) ); m_branchIndex = 0; @@ -886,7 +886,7 @@ void RimWellRftPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, syncCurvesFromUiSelection(); } - else if ( changedField == &m_showTitleInPlot ) + else if ( changedField == &m_showPlotWindowTitle ) { // m_wellLogPlot->setShowDescription(m_showPlotTitle); } @@ -1071,9 +1071,9 @@ void RimWellRftPlot::initAfterRead() RimWellLogPlot& wellLogPlot = dynamic_cast( *this ); wellLogPlot = std::move( *m_wellLogPlot_OBSOLETE.value() ); } - if ( m_showPlotTitle_OBSOLETE() && !m_showTitleInPlot() ) + if ( m_showPlotTitle_OBSOLETE() && !m_showPlotWindowTitle() ) { - m_showTitleInPlot = m_showPlotTitle_OBSOLETE(); + m_showPlotWindowTitle = m_showPlotTitle_OBSOLETE(); } RimWellLogPlot::initAfterRead(); diff --git a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp index c3ed8f08a3..dc277fb25c 100644 --- a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp +++ b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp @@ -1102,14 +1102,6 @@ std::set RimGridCrossPlot::allPlotAxes() const return {m_xAxisProperties, m_yAxisProperties}; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimGridCrossPlot::updatePlotTitle() -{ - updateCurveNamesAndPlotTitle(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h index bd403aad96..04f3176e52 100644 --- a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h +++ b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h @@ -151,8 +151,6 @@ protected: std::set allPlotAxes() const; - void updatePlotTitle() override; - private: void cleanupBeforeClose(); diff --git a/ApplicationCode/ProjectDataModel/RimGridPlotWindow.cpp b/ApplicationCode/ProjectDataModel/RimGridPlotWindow.cpp index 35223e6b19..a44d31f620 100644 --- a/ApplicationCode/ProjectDataModel/RimGridPlotWindow.cpp +++ b/ApplicationCode/ProjectDataModel/RimGridPlotWindow.cpp @@ -48,6 +48,9 @@ RimGridPlotWindow::RimGridPlotWindow() { CAF_PDM_InitObject( "Plot Report", ":/WellLogPlot16x16.png", "", "" ); + CAF_PDM_InitField( &m_showPlotWindowTitle, "ShowTitleInPlot", true, "Show Title", "", "", "" ); + CAF_PDM_InitField( &m_plotWindowTitle, "PlotDescription", QString( "" ), "Name", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_plots, "Tracks", "", "", "", "" ); m_plots.uiCapability()->setUiHidden( true ); @@ -76,6 +79,9 @@ RimGridPlotWindow& RimGridPlotWindow::operator=( RimGridPlotWindow&& rhs ) { RimPlotWindow::operator=( std::move( rhs ) ); + m_showPlotWindowTitle = rhs.m_showPlotWindowTitle; + m_plotWindowTitle = rhs.m_plotWindowTitle; + // Move all tracks std::vector plots = rhs.m_plots.childObjects(); rhs.m_plots.clear(); @@ -98,6 +104,38 @@ QWidget* RimGridPlotWindow::viewWidget() return m_viewer; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimGridPlotWindow::isMultiPlotTitleVisible() const +{ + return m_showPlotWindowTitle; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimGridPlotWindow::setMultiPlotTitleVisible( bool visible ) +{ + m_showPlotWindowTitle = visible; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimGridPlotWindow::multiPlotTitle() const +{ + return m_plotWindowTitle; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimGridPlotWindow::setMultiPlotTitle( const QString& title ) +{ + m_plotWindowTitle = title; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -330,7 +368,7 @@ void RimGridPlotWindow::zoomAll() //-------------------------------------------------------------------------------------------------- QString RimGridPlotWindow::asciiDataForPlotExport() const { - QString out = description() + "\n"; + QString out = multiPlotTitle() + "\n"; for ( RimPlotInterface* plot : plots() ) { @@ -390,6 +428,14 @@ void RimGridPlotWindow::deleteViewWidget() cleanupBeforeClose(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* RimGridPlotWindow::userDescriptionField() +{ + return &m_plotWindowTitle; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -403,7 +449,11 @@ void RimGridPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel { updateLayout(); } - if ( changedField == &m_columnCountEnum ) + else if ( changedField == &m_showPlotWindowTitle || changedField == &m_plotWindowTitle ) + { + updatePlotTitleInWidgets(); + } + else if ( changedField == &m_columnCountEnum ) { updateLayout(); RiuPlotMainWindowTools::refreshToolbars(); @@ -425,8 +475,8 @@ void RimGridPlotWindow::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi //-------------------------------------------------------------------------------------------------- void RimGridPlotWindow::uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering ) { - uiOrdering.add( &m_showTitleInPlot ); - uiOrdering.add( &m_description ); + uiOrdering.add( &m_showPlotWindowTitle ); + uiOrdering.add( &m_plotWindowTitle ); uiOrdering.add( &m_showIndividualPlotTitles ); RimPlotWindow::uiOrderingForPlotLayout( uiOrdering ); uiOrdering.add( &m_columnCountEnum ); @@ -472,7 +522,7 @@ QList RimGridPlotWindow::calculateValueOptions( const ca void RimGridPlotWindow::onLoadDataAndUpdate() { updateMdiWindowVisibility(); - updatePlotTitle(); + updatePlotTitleInWidgets(); updatePlots(); updateLayout(); } @@ -488,12 +538,12 @@ void RimGridPlotWindow::initAfterRead() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimGridPlotWindow::updatePlotTitle() +void RimGridPlotWindow::updatePlotTitleInWidgets() { if ( m_viewer ) { - m_viewer->setTitleVisible( m_showTitleInPlot() ); - m_viewer->setPlotTitle( fullPlotTitle() ); + m_viewer->setTitleVisible( m_showPlotWindowTitle() ); + m_viewer->setPlotTitle( multiPlotTitle() ); } updateMdiWindowTitle(); } diff --git a/ApplicationCode/ProjectDataModel/RimGridPlotWindow.h b/ApplicationCode/ProjectDataModel/RimGridPlotWindow.h index a3b89f6174..6b7938fd43 100644 --- a/ApplicationCode/ProjectDataModel/RimGridPlotWindow.h +++ b/ApplicationCode/ProjectDataModel/RimGridPlotWindow.h @@ -57,6 +57,11 @@ public: QWidget* viewWidget() override; + bool isMultiPlotTitleVisible() const; + void setMultiPlotTitleVisible( bool visible ); + QString multiPlotTitle() const; + void setMultiPlotTitle( const QString& title ); + void addPlot( RimPlotInterface* plot ); void insertPlot( RimPlotInterface* plot, size_t index ); void removePlot( RimPlotInterface* plot ); @@ -92,6 +97,8 @@ protected: QWidget* createViewWidget( QWidget* mainWindowParent ) override; void deleteViewWidget() override; + caf::PdmFieldHandle* userDescriptionField() override; + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; @@ -104,7 +111,7 @@ protected: void onLoadDataAndUpdate() override; void initAfterRead() override; - void updatePlotTitle() override; + void updatePlotTitleInWidgets(); void updatePlots(); virtual void updateZoom(); void recreatePlotWidgets(); @@ -124,6 +131,8 @@ private: static const caf::PdmObject* toPdmObjectAsserted( const RimPlotInterface* plotInterface ); protected: + caf::PdmField m_showPlotWindowTitle; + caf::PdmField m_plotWindowTitle; caf::PdmField m_columnCountEnum; caf::PdmField m_showIndividualPlotTitles; diff --git a/ApplicationCode/ProjectDataModel/RimPlotWindow.cpp b/ApplicationCode/ProjectDataModel/RimPlotWindow.cpp index 9e4acbf1b6..6ea0da4bda 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotWindow.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotWindow.cpp @@ -31,9 +31,6 @@ RimPlotWindow::RimPlotWindow() { CAF_PDM_InitObject( "Plot", "", "", "" ); - CAF_PDM_InitField( &m_description, "PlotDescription", QString( "" ), "Name", "", "", "" ); - - CAF_PDM_InitField( &m_showTitleInPlot, "ShowTitleInPlot", true, "Show Title", "", "", "" ); CAF_PDM_InitField( &m_showPlotLegends, "ShowTrackLegends", true, "Show Legends", "", "", "" ); CAF_PDM_InitField( &m_plotLegendsHorizontal, "TrackLegendsHorizontal", true, "Legend Orientation", "", "", "" ); m_plotLegendsHorizontal.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() ); @@ -52,52 +49,11 @@ RimPlotWindow::~RimPlotWindow() {} //-------------------------------------------------------------------------------------------------- RimPlotWindow& RimPlotWindow::operator=( RimPlotWindow&& rhs ) { - m_showTitleInPlot = rhs.m_showTitleInPlot(); m_showPlotLegends = rhs.m_showPlotLegends(); m_plotLegendsHorizontal = rhs.m_plotLegendsHorizontal(); return *this; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimPlotWindow::setDescription( const QString& description ) -{ - m_description = description; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimPlotWindow::description() const -{ - return m_description; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimPlotWindow::fullPlotTitle() const -{ - return m_description; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimPlotWindow::isPlotTitleVisible() const -{ - return m_showTitleInPlot(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimPlotWindow::setPlotTitleVisible( bool visible ) -{ - m_showTitleInPlot = visible; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -159,10 +115,6 @@ void RimPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedField, { updateLayout(); } - else if ( changedField == &m_showTitleInPlot || changedField == &m_description ) - { - updatePlotTitle(); - } else if ( changedField == &m_legendFontSize ) { updateLayout(); @@ -205,14 +157,6 @@ QList RimPlotWindow::calculateValueOptions( const caf::P return options; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmFieldHandle* RimPlotWindow::userDescriptionField() -{ - return &m_description; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimPlotWindow.h b/ApplicationCode/ProjectDataModel/RimPlotWindow.h index b40cd431b1..17047dc98e 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotWindow.h +++ b/ApplicationCode/ProjectDataModel/RimPlotWindow.h @@ -36,12 +36,6 @@ public: RimPlotWindow& operator=( RimPlotWindow&& rhs ); - virtual void setDescription( const QString& description ); - QString description() const; - virtual QString fullPlotTitle() const; - - bool isPlotTitleVisible() const; - void setPlotTitleVisible( bool visible ); bool legendsVisible() const; void setLegendsVisible( bool doShow ); bool legendsHorizontal() const; @@ -58,15 +52,11 @@ protected: const QVariant& newValue ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; - caf::PdmFieldHandle* userDescriptionField() override; virtual void uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering ); - virtual void updatePlotTitle() = 0; protected: - caf::PdmField m_description; - caf::PdmField m_showTitleInPlot; - caf::PdmField m_showPlotLegends; - caf::PdmField m_plotLegendsHorizontal; - caf::PdmField m_legendFontSize; + caf::PdmField m_showPlotLegends; + caf::PdmField m_plotLegendsHorizontal; + caf::PdmField m_legendFontSize; }; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index 07b06aaf77..a3d2e5464f 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -104,8 +104,9 @@ RimWellLogPlot::RimWellLogPlot() m_maxAvailableDepth = -HUGE_VAL; m_commonDataSourceEnabled = true; - m_showTitleInPlot = false; m_columnCountEnum = RimGridPlotWindow::COLUMNS_UNLIMITED; + + setMultiPlotTitleVisible( false ); } //-------------------------------------------------------------------------------------------------- @@ -152,14 +153,6 @@ QWidget* RimWellLogPlot::createPlotWidget( QWidget* mainWindowParent /*= nullptr return createViewWidget( mainWindowParent ); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimWellLogPlot::fullPlotTitle() const -{ - return createAutoName(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -315,7 +308,7 @@ void RimWellLogPlot::uiOrderingForDepthAxis( caf::PdmUiOrdering& uiOrdering ) //-------------------------------------------------------------------------------------------------- void RimWellLogPlot::uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering ) { - uiOrdering.add( &m_showTitleInPlot ); + uiOrdering.add( &m_showPlotWindowTitle ); m_nameConfig->uiOrdering( "", uiOrdering ); uiOrdering.add( &m_showIndividualPlotTitles ); RimPlotWindow::uiOrderingForPlotLayout( uiOrdering ); @@ -416,7 +409,8 @@ QWidget* RimWellLogPlot::createViewWidget( QWidget* mainWindowParent ) void RimWellLogPlot::performAutoNameUpdate() { updateCommonDataSource(); - updatePlotTitle(); + setMultiPlotTitle( m_nameConfig->name() ); + updatePlotTitleInWidgets(); } //-------------------------------------------------------------------------------------------------- @@ -532,14 +526,6 @@ void RimWellLogPlot::updatePlotNames() } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmFieldHandle* RimWellLogPlot::userDescriptionField() -{ - return m_nameConfig->nameField(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -650,9 +636,9 @@ void RimWellLogPlot::initAfterRead() RimGridPlotWindow::initAfterRead(); updateCommonDataSource(); - if ( !m_description().isEmpty() ) + if ( !m_plotWindowTitle().isEmpty() ) { - m_nameConfig->setCustomName( m_description() ); + m_nameConfig->setCustomName( m_plotWindowTitle() ); } if ( m_depthAxisGridVisibility() == AXIS_GRID_MINOR ) diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h index a6cf3fcb6a..fadcc9ab82 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.h @@ -64,7 +64,6 @@ public: ~RimWellLogPlot() override; QWidget* createPlotWidget( QWidget* mainWindowParent = nullptr ); - QString fullPlotTitle() const override; RimWellLogPlot& operator=( RimWellLogPlot&& rhs ); @@ -106,10 +105,9 @@ public: void updatePlotNames() override; protected: - QWidget* createViewWidget( QWidget* mainWindowParent ) override; - void performAutoNameUpdate() override; - void handleKeyPressEvent( QKeyEvent* keyEvent ) override; - caf::PdmFieldHandle* userDescriptionField() override; + QWidget* createViewWidget( QWidget* mainWindowParent ) override; + void performAutoNameUpdate() override; + void handleKeyPressEvent( QKeyEvent* keyEvent ) override; // Overridden PDM methods void fieldChangedByUi( const caf::PdmFieldHandle* changedField, diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 568f90892f..884205cd92 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -145,23 +145,18 @@ RimSummaryPlot::RimSummaryPlot() { CAF_PDM_InitObject( "Summary Plot", ":/SummaryPlotLight16x16.png", "", "" ); - m_description = "Summary Plot"; - - CAF_PDM_InitField( &m_showPlotTitle_OBSOLETE, "ShowPlotTitle", true, "Plot Title", "", "", "" ); - m_showPlotTitle_OBSOLETE.xmlCapability()->setIOWritable( false ); - CAF_PDM_InitField( &m_showLegend_OBSOLETE, "ShowLegend", true, "Legend", "", "", "" ); - m_showLegend_OBSOLETE.xmlCapability()->setIOWritable( false ); + CAF_PDM_InitField( &m_showPlotTitle, "ShowPlotTitle", true, "Plot Title", "", "", "" ); + m_showPlotTitle.xmlCapability()->setIOWritable( false ); CAF_PDM_InitField( &m_useAutoPlotTitle, "IsUsingAutoName", true, "Auto Title", "", "", "" ); + CAF_PDM_InitField( &m_description, "PlotDescription", QString( "Summary Plot" ), "Name", "", "", "" ); + CAF_PDM_InitField( &m_normalizeCurveYValues, "normalizeCurveYValues", false, "Normalize all curves", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_rowSpan, "RowSpan", "Row Span", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_colSpan, "ColSpan", "Col Span", "", "", "" ); - CAF_PDM_InitFieldNoDefault( &m_curveFilters_OBSOLETE, "SummaryCurveFilters", "", "", "", "" ); - m_curveFilters_OBSOLETE.uiCapability()->setUiTreeHidden( true ); - CAF_PDM_InitFieldNoDefault( &m_summaryCurveCollection, "SummaryCurveCollection", "", "", "", "" ); m_summaryCurveCollection.uiCapability()->setUiTreeHidden( true ); m_summaryCurveCollection = new RimSummaryCurveCollection; @@ -171,9 +166,6 @@ RimSummaryPlot::RimSummaryPlot() m_ensembleCurveSetCollection.uiCapability()->setUiHidden( true ); m_ensembleCurveSetCollection = new RimEnsembleCurveSetCollection(); - CAF_PDM_InitFieldNoDefault( &m_summaryCurves_OBSOLETE, "SummaryCurves", "", "", "", "" ); - m_summaryCurves_OBSOLETE.uiCapability()->setUiTreeHidden( true ); - CAF_PDM_InitFieldNoDefault( &m_gridTimeHistoryCurves, "GridTimeHistoryCurves", "", "", "", "" ); m_gridTimeHistoryCurves.uiCapability()->setUiTreeHidden( true ); @@ -199,9 +191,6 @@ RimSummaryPlot::RimSummaryPlot() m_timeAxisProperties.uiCapability()->setUiTreeHidden( true ); m_timeAxisProperties = new RimSummaryTimeAxisProperties; - CAF_PDM_InitField( &m_isAutoZoom_OBSOLETE, "AutoZoom", true, "Auto Zoom", "", "", "" ); - RiaFieldhandleTools::disableWriteAndSetFieldHidden( &m_isAutoZoom_OBSOLETE ); - CAF_PDM_InitFieldNoDefault( &m_textCurveSetEditor, "SummaryPlotFilterTextCurveSetEditor", "Text Filter Curve Creator", @@ -211,6 +200,16 @@ RimSummaryPlot::RimSummaryPlot() m_textCurveSetEditor.uiCapability()->setUiTreeHidden( true ); m_textCurveSetEditor = new RimSummaryPlotFilterTextCurveSetEditor; + // Obsolete fields + CAF_PDM_InitField( &m_isAutoZoom_OBSOLETE, "AutoZoom", true, "Auto Zoom", "", "", "" ); + RiaFieldhandleTools::disableWriteAndSetFieldHidden( &m_isAutoZoom_OBSOLETE ); + CAF_PDM_InitField( &m_showLegend_OBSOLETE, "ShowLegend", true, "Legend", "", "", "" ); + m_showLegend_OBSOLETE.xmlCapability()->setIOWritable( false ); + CAF_PDM_InitFieldNoDefault( &m_curveFilters_OBSOLETE, "SummaryCurveFilters", "", "", "", "" ); + m_curveFilters_OBSOLETE.uiCapability()->setUiTreeHidden( true ); + CAF_PDM_InitFieldNoDefault( &m_summaryCurves_OBSOLETE, "SummaryCurves", "", "", "", "" ); + m_summaryCurves_OBSOLETE.uiCapability()->setUiTreeHidden( true ); + m_isCrossPlot = false; m_isDraggable = true; @@ -234,6 +233,22 @@ RimSummaryPlot::~RimSummaryPlot() delete m_ensembleCurveSetCollection; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimSummaryPlot::showPlotTitle() const +{ + return m_showPlotTitle; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::setShowPlotTitle( bool showTitle ) +{ + m_showPlotTitle = showTitle; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1330,7 +1345,7 @@ void RimSummaryPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, updateWindowVisibility(); } - if ( changedField == &m_useAutoPlotTitle ) + if ( changedField == &m_showPlotTitle || changedField == &m_description || changedField == &m_useAutoPlotTitle ) { updatePlotTitle(); updateConnectedEditors(); @@ -1681,8 +1696,8 @@ void RimSummaryPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& if ( isStandalonePlot() ) { - mainOptions->add( &m_showTitleInPlot ); - if ( m_showTitleInPlot ) + mainOptions->add( &m_showPlotTitle ); + if ( m_showPlotTitle ) { mainOptions->add( &m_useAutoPlotTitle ); mainOptions->add( &m_description ); @@ -1795,11 +1810,6 @@ void RimSummaryPlot::initAfterRead() } } - if ( m_showPlotTitle_OBSOLETE() ) - { - m_showTitleInPlot = true; - } - if ( m_showLegend_OBSOLETE() ) { m_showPlotLegends = true; @@ -1813,11 +1823,11 @@ void RimSummaryPlot::updateMdiWindowTitle() { if ( m_plotWidget && isStandalonePlot() ) { - QString plotTitle = fullPlotTitle(); + QString plotTitle = description(); m_plotWidget->setWindowTitle( plotTitle ); - if ( m_showTitleInPlot ) + if ( m_showPlotTitle ) { m_plotWidget->setTitle( plotTitle ); } diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h index ce97bd4809..bc710bb46c 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -72,11 +72,14 @@ public: RimSummaryPlot(); ~RimSummaryPlot() override; - void setDescription( const QString& description ) override; + bool showPlotTitle() const; + void setShowPlotTitle( bool showTitle ); + void setDescription( const QString& description ); QString description() const override; - bool isChecked() const override; - void setChecked( bool checked ) override; - void setDraggable( bool draggable ); + + bool isChecked() const override; + void setChecked( bool checked ) override; + void setDraggable( bool draggable ); void enableAutoPlotTitle( bool enable ); bool autoPlotTitle() const; @@ -125,7 +128,7 @@ public: std::vector curveSets() const; - void updatePlotTitle() override; + void updatePlotTitle(); const RimSummaryPlotNameHelper* activePlotTitleHelperAllCurves() const; void updateCurveNames(); @@ -229,7 +232,9 @@ private: private: caf::PdmField m_normalizeCurveYValues; - caf::PdmField m_useAutoPlotTitle; + caf::PdmField m_showPlotTitle; + caf::PdmField m_useAutoPlotTitle; + caf::PdmField m_description; caf::PdmField m_rowSpan; caf::PdmField m_colSpan; @@ -261,6 +266,5 @@ private: caf::PdmChildArrayField m_curveFilters_OBSOLETE; caf::PdmField m_isAutoZoom_OBSOLETE; - caf::PdmField m_showPlotTitle_OBSOLETE; caf::PdmField m_showLegend_OBSOLETE; }; diff --git a/ApplicationCode/UserInterface/RiuGridPlotWindow.cpp b/ApplicationCode/UserInterface/RiuGridPlotWindow.cpp index c913ced916..7088614210 100644 --- a/ApplicationCode/UserInterface/RiuGridPlotWindow.cpp +++ b/ApplicationCode/UserInterface/RiuGridPlotWindow.cpp @@ -311,7 +311,7 @@ void RiuGridPlotWindow::keyPressEvent( QKeyEvent* keyEvent ) QLabel* RiuGridPlotWindow::createTitleLabel() const { QLabel* plotTitle = new QLabel( "PLOT TITLE HERE", nullptr ); - plotTitle->setVisible( m_plotDefinition->isPlotTitleVisible() ); + plotTitle->setVisible( m_plotDefinition->isMultiPlotTitleVisible() ); plotTitle->setAlignment( Qt::AlignHCenter ); plotTitle->setWordWrap( true ); plotTitle->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );