From 0e9cda8e846cdab00e7c3aa1a74b3817107adb57 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Fri, 25 Oct 2019 09:40:57 +0200 Subject: [PATCH] Fix update of fonts in summary and grid cross plot axes --- .../ProjectDataModel/CMakeLists_files.cmake | 1 - .../GridCrossPlots/RimGridCrossPlot.cpp | 6 +-- .../GridCrossPlots/RimGridCrossPlot.h | 3 +- .../RimPlotAxisAnnotation.cpp | 6 +-- .../RimPlotAxisProperties.cpp | 8 ++-- .../ProjectDataModel/RimPlotInterface.h | 1 + .../RimRiuQwtPlotOwnerInterface.h | 41 ------------------- .../ProjectDataModel/RimWellLogTrack.cpp | 8 ++++ .../ProjectDataModel/RimWellLogTrack.h | 2 + .../ProjectDataModel/Summary/RimSummaryPlot.h | 3 +- 10 files changed, 23 insertions(+), 56 deletions(-) delete mode 100644 ApplicationCode/ProjectDataModel/RimRiuQwtPlotOwnerInterface.h diff --git a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake index 055f2670e1..c4d57e00f8 100644 --- a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake @@ -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 diff --git a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp index e1cb786bd4..9101f32ae4 100644 --- a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp +++ b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.cpp @@ -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(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h index fe9a69ed44..6a2ae47f36 100644 --- a/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h +++ b/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlot.h @@ -25,7 +25,6 @@ #include "RimNameConfig.h" #include "RimPlotInterface.h" #include "RimPlotWindow.h" -#include "RimRiuQwtPlotOwnerInterface.h" #include @@ -123,7 +122,7 @@ protected: const QVariant& newValue ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; - void updateAxisDisplay(); + void updateAxes() override; void updatePlot(); virtual QString xAxisParameterString() const; diff --git a/ApplicationCode/ProjectDataModel/RimPlotAxisAnnotation.cpp b/ApplicationCode/ProjectDataModel/RimPlotAxisAnnotation.cpp index baf32bef7b..4966dfb011 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotAxisAnnotation.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotAxisAnnotation.cpp @@ -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(); } } diff --git a/ApplicationCode/ProjectDataModel/RimPlotAxisProperties.cpp b/ApplicationCode/ProjectDataModel/RimPlotAxisProperties.cpp index 1d5ff61555..c1328575b9 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotAxisProperties.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotAxisProperties.cpp @@ -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(); } } } diff --git a/ApplicationCode/ProjectDataModel/RimPlotInterface.h b/ApplicationCode/ProjectDataModel/RimPlotInterface.h index f328edd4af..d29c1d6ca6 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotInterface.h +++ b/ApplicationCode/ProjectDataModel/RimPlotInterface.h @@ -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; diff --git a/ApplicationCode/ProjectDataModel/RimRiuQwtPlotOwnerInterface.h b/ApplicationCode/ProjectDataModel/RimRiuQwtPlotOwnerInterface.h deleted file mode 100644 index bd090782cb..0000000000 --- a/ApplicationCode/ProjectDataModel/RimRiuQwtPlotOwnerInterface.h +++ /dev/null @@ -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 -// 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; -}; \ No newline at end of file diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp index 956841e16b..bc14e078a9 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.cpp @@ -923,6 +923,14 @@ void RimWellLogTrack::onAxisSelected( int axis, bool toggle ) } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogTrack::updateAxes() +{ + updateXZoom(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h index b9a6bbdd6f..f2f2ba0ab0 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogTrack.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogTrack.h @@ -202,6 +202,8 @@ public: void onAxisSelected( int axis, bool toggle ) override; + void updateAxes() override; + private: void calculateXZoomRange(); void calculateYZoomRange(); diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h index 4e99642aed..8cce2e8ef6 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -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;