Remove description-field from RimPlotWindow

* Leave it to sub-classes to deal with this
This commit is contained in:
Gaute Lindkvist 2019-11-13 11:44:54 +01:00
parent f6126497e7
commit 81db22586d
23 changed files with 155 additions and 172 deletions

View File

@ -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 );
}

View File

@ -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 );

View File

@ -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();
}

View File

@ -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<QString> 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";

View File

@ -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();

View File

@ -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();

View File

@ -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 );

View File

@ -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 )

View File

@ -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();

View File

@ -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;

View File

@ -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();

View File

@ -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<RimWellLogPlot&>( *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();

View File

@ -1102,14 +1102,6 @@ std::set<RimPlotAxisPropertiesInterface*> RimGridCrossPlot::allPlotAxes() const
return {m_xAxisProperties, m_yAxisProperties};
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlot::updatePlotTitle()
{
updateCurveNamesAndPlotTitle();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -151,8 +151,6 @@ protected:
std::set<RimPlotAxisPropertiesInterface*> allPlotAxes() const;
void updatePlotTitle() override;
private:
void cleanupBeforeClose();

View File

@ -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<caf::PdmObject*> 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<caf::PdmOptionItemInfo> 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();
}

View File

@ -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<bool> m_showPlotWindowTitle;
caf::PdmField<QString> m_plotWindowTitle;
caf::PdmField<ColumnCountEnum> m_columnCountEnum;
caf::PdmField<bool> m_showIndividualPlotTitles;

View File

@ -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<caf::PdmOptionItemInfo> RimPlotWindow::calculateValueOptions( const caf::P
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimPlotWindow::userDescriptionField()
{
return &m_description;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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<caf::PdmOptionItemInfo> 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<QString> m_description;
caf::PdmField<bool> m_showTitleInPlot;
caf::PdmField<bool> m_showPlotLegends;
caf::PdmField<bool> m_plotLegendsHorizontal;
caf::PdmField<int> m_legendFontSize;
caf::PdmField<bool> m_showPlotLegends;
caf::PdmField<bool> m_plotLegendsHorizontal;
caf::PdmField<int> m_legendFontSize;
};

View File

@ -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 )

View File

@ -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,

View File

@ -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 );
}

View File

@ -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<RimEnsembleCurveSet*> curveSets() const;
void updatePlotTitle() override;
void updatePlotTitle();
const RimSummaryPlotNameHelper* activePlotTitleHelperAllCurves() const;
void updateCurveNames();
@ -229,7 +232,9 @@ private:
private:
caf::PdmField<bool> m_normalizeCurveYValues;
caf::PdmField<bool> m_useAutoPlotTitle;
caf::PdmField<bool> m_showPlotTitle;
caf::PdmField<bool> m_useAutoPlotTitle;
caf::PdmField<QString> m_description;
caf::PdmField<RimPlotInterface::RowOrColSpanEnum> m_rowSpan;
caf::PdmField<RimPlotInterface::RowOrColSpanEnum> m_colSpan;
@ -261,6 +266,5 @@ private:
caf::PdmChildArrayField<RimSummaryCurveFilter_OBSOLETE*> m_curveFilters_OBSOLETE;
caf::PdmField<bool> m_isAutoZoom_OBSOLETE;
caf::PdmField<bool> m_showPlotTitle_OBSOLETE;
caf::PdmField<bool> m_showLegend_OBSOLETE;
};

View File

@ -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 );