#6497 Fix legends in Summary preview and clean up plot titles

This commit is contained in:
Gaute Lindkvist authored and Magne Sjaastad committed 2020-09-20 15:26:46 +02:00
1 parent 409db46ab3
commit a3161047af
20 files changed
+89 -131

No files matched your search

@@ -86,7 +86,7 @@ RimDepthTrackPlot::RimDepthTrackPlot()
m_commonDataSource.xmlCapability()->disableIO();
m_commonDataSource = new RimWellLogCurveCommonDataSource;
CAF_PDM_InitScriptableField( &m_showPlotWindowTitle, "ShowTitleInPlot", true, "Show Title", "", "", "" );
CAF_PDM_InitScriptableField( &m_showPlotWindowTitle_OBSOLETE, "ShowTitleInPlot", true, "Show Title", "", "", "" );
CAF_PDM_InitField( &m_plotWindowTitle, "PlotDescription", QString( "" ), "Name", "", "", "" );
m_plotWindowTitle.xmlCapability()->setIOWritable( false );
@@ -148,6 +148,48 @@ RimDepthTrackPlot::~RimDepthTrackPlot()
cleanupBeforeClose();
}
//--------------------------------------------------------------------------------------------------
/// Move-assignment operator. Argument has to be passed with std::move()
//--------------------------------------------------------------------------------------------------
RimDepthTrackPlot& RimDepthTrackPlot::operator=( RimDepthTrackPlot&& rhs )
{
RimPlotWindow::operator=( std::move( rhs ) );
// Move all tracks
std::vector<RimPlot*> plots = rhs.m_plots.childObjects();
rhs.m_plots.clear();
for ( RimPlot* plot : plots )
{
m_plots.push_back( plot );
}
// Deliberately don't set m_plotWindowTitle and m_nameConfig. This operator is used for copying parameters from
// children. This only happens for some plots that used to own a plot but now inherits the plot.
// They had their own description at top level which we don't want to overwrite.
m_showPlotWindowTitle_OBSOLETE = rhs.m_showPlotWindowTitle_OBSOLETE;
auto dataSource = rhs.m_commonDataSource();
rhs.m_commonDataSource.removeChildObject( dataSource );
m_commonDataSource = dataSource;
m_commonDataSourceEnabled = rhs.m_commonDataSourceEnabled;
m_depthType = rhs.m_depthType();
m_depthUnit = rhs.m_depthUnit();
m_minVisibleDepth = rhs.m_minVisibleDepth();
m_maxVisibleDepth = rhs.m_maxVisibleDepth();
m_depthAxisGridVisibility = rhs.m_depthAxisGridVisibility();
m_isAutoScaleDepthEnabled = rhs.m_isAutoScaleDepthEnabled();
m_subTitleFontSize = rhs.m_subTitleFontSize();
m_axisTitleFontSize = rhs.m_axisTitleFontSize();
m_axisValueFontSize = rhs.m_axisValueFontSize();
m_minAvailableDepth = rhs.m_minAvailableDepth;
m_maxAvailableDepth = rhs.m_maxAvailableDepth;
return *this;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -172,22 +214,6 @@ QString RimDepthTrackPlot::description() const
return m_plotWindowTitle;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimDepthTrackPlot::isPlotTitleVisible() const
{
return m_showPlotWindowTitle;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimDepthTrackPlot::setPlotTitleVisible( bool visible )
{
m_showPlotWindowTitle = visible;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -425,7 +451,7 @@ void RimDepthTrackPlot::uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUi
//--------------------------------------------------------------------------------------------------
void RimDepthTrackPlot::uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_showPlotWindowTitle );
uiOrdering.add( &m_showPlotTitle );
m_nameConfig->uiOrdering( uiConfigName, uiOrdering );
}
@@ -559,7 +585,7 @@ void RimDepthTrackPlot::performAutoNameUpdate()
m_plotWindowTitle = createAutoName();
if ( m_viewer )
{
m_viewer->setTitleVisible( m_showPlotWindowTitle() );
m_viewer->setTitleVisible( m_showPlotTitle() );
m_viewer->setPlotTitle( m_plotWindowTitle );
}
updateMdiWindowTitle();
@@ -826,7 +852,7 @@ void RimDepthTrackPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
{
updateFonts();
}
else if ( changedField == &m_showPlotWindowTitle )
else if ( changedField == &m_showPlotTitle )
{
performAutoNameUpdate();
}
@@ -910,6 +936,11 @@ void RimDepthTrackPlot::initAfterRead()
m_depthAxisGridVisibility = AXIS_GRID_MAJOR_AND_MINOR;
}
if ( !m_showPlotWindowTitle_OBSOLETE() )
{
m_showPlotTitle = false;
}
if ( !m_plotWindowTitle().isEmpty() )
{
m_nameConfig->setCustomName( m_plotWindowTitle );