Fix update of fonts in summary and grid cross plot axes

This commit is contained in:
Gaute Lindkvist 2019-10-25 09:40:57 +02:00
parent a4c78cb7c3
commit 0e9cda8e84
10 changed files with 23 additions and 56 deletions

View File

@ -132,7 +132,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimViewNameConfig.h
${CMAKE_CURRENT_LIST_DIR}/RimScaleLegendConfig.h
${CMAKE_CURRENT_LIST_DIR}/RimReloadCaseTools.h
${CMAKE_CURRENT_LIST_DIR}/RimRiuQwtPlotOwnerInterface.h
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisPropertiesInterface.h
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.h
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.h

View File

@ -511,7 +511,7 @@ void RimGridCrossPlot::performAutoNameUpdate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlot::updateAxisDisplay()
void RimGridCrossPlot::updateAxes()
{
if ( !m_plotWidget ) return;
@ -534,7 +534,7 @@ void RimGridCrossPlot::updatePlot()
RiuQwtPlotTools::setCommonPlotBehaviour( m_plotWidget );
RiuQwtPlotTools::setDefaultAxes( m_plotWidget );
updateAxisDisplay();
updateAxes();
for ( auto dataSet : m_crossPlotDataSets )
{
@ -602,7 +602,7 @@ void RimGridCrossPlot::swapAxes()
loadDataAndUpdate();
updateAxisDisplay();
updateAxes();
}
//--------------------------------------------------------------------------------------------------

View File

@ -25,7 +25,6 @@
#include "RimNameConfig.h"
#include "RimPlotInterface.h"
#include "RimPlotWindow.h"
#include "RimRiuQwtPlotOwnerInterface.h"
#include <QPointer>
@ -123,7 +122,7 @@ protected:
const QVariant& newValue ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void updateAxisDisplay();
void updateAxes() override;
void updatePlot();
virtual QString xAxisParameterString() const;

View File

@ -22,7 +22,7 @@
#include "RigEquil.h"
#include "RimEclipseCase.h"
#include "RimRiuQwtPlotOwnerInterface.h"
#include "RimPlotInterface.h"
#include "RimTools.h"
#include "RimViewWindow.h"
@ -158,11 +158,11 @@ void RimPlotAxisAnnotation::fieldChangedByUi( const caf::PdmFieldHandle* changed
const QVariant& oldValue,
const QVariant& newValue )
{
RimRiuQwtPlotOwnerInterface* parentPlot = nullptr;
RimPlotInterface* parentPlot = nullptr;
this->firstAncestorOrThisOfType( parentPlot );
if ( parentPlot )
{
parentPlot->updateAxisDisplay();
parentPlot->updateAxes();
}
}

View File

@ -26,7 +26,7 @@
#include "RigStatisticsCalculator.h"
#include "RimPlotAxisAnnotation.h"
#include "RimRiuQwtPlotOwnerInterface.h"
#include "RimPlotInterface.h"
#include "cafPdmUiSliderEditor.h"
@ -416,17 +416,17 @@ void RimPlotAxisProperties::fieldChangedByUi( const caf::PdmFieldHandle* changed
m_isAutoZoom = false;
}
RimRiuQwtPlotOwnerInterface* parentPlot = nullptr;
RimPlotInterface* parentPlot = nullptr;
this->firstAncestorOrThisOfType( parentPlot );
if ( parentPlot )
{
if ( changedField == &isLogarithmicScaleEnabled )
{
parentPlot->updateAxisScaling();
parentPlot->loadDataAndUpdate();
}
else
{
parentPlot->updateAxisDisplay();
parentPlot->updateAxes();
}
}
}

View File

@ -65,6 +65,7 @@ public:
virtual void setAutoScaleXEnabled( bool enabled ) = 0;
virtual void setAutoScaleYEnabled( bool enabled ) = 0;
virtual void updateAxes() = 0;
virtual void updateZoomInQwt() = 0;
virtual void updateZoomFromQwt() = 0;

View File

@ -1,41 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaFontCache.h"
#include "RimViewWindow.h"
namespace caf
{
class PdmObject;
}
class QwtPlotCurve;
class RimRiuQwtPlotOwnerInterface
{
public:
virtual void detachAllCurves() = 0;
virtual void updateAxisScaling() = 0;
virtual void updateAxisDisplay() = 0;
virtual void updateZoomWindowFromQwt() = 0;
virtual void selectAxisInPropertyEditor( int axis ) = 0;
virtual void setAutoZoomForAllAxes( bool enableAutoZoom ) = 0;
virtual caf::PdmObject* findRimPlotObjectFromQwtCurve( const QwtPlotCurve* curve ) const = 0;
};

View File

@ -923,6 +923,14 @@ void RimWellLogTrack::onAxisSelected( int axis, bool toggle )
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateAxes()
{
updateXZoom();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -202,6 +202,8 @@ public:
void onAxisSelected( int axis, bool toggle ) override;
void updateAxes() override;
private:
void calculateXZoomRange();
void calculateYZoomRange();

View File

@ -26,7 +26,6 @@
#include "RimPlotInterface.h"
#include "RimPlotWindow.h"
#include "RimRiuQwtPlotOwnerInterface.h"
#include "qwt_plot_textlabel.h"
@ -105,7 +104,7 @@ public:
void reattachAllCurves();
void updateCaseNameHasChanged();
void updateAxes();
void updateAxes() override;
bool isLogarithmicScaleEnabled( RiaDefines::PlotAxis plotAxis ) const;