From dbc2899f4645259c06985ff9e028d49f54bb40c7 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 9 Dec 2020 09:54:20 +0100 Subject: [PATCH] #6941 Rename and move RimHistogramData to RigHistogramData. --- .../Commands/RicGridStatisticsDialog.cpp | 4 ++-- .../Commands/RicGridStatisticsDialog.h | 4 ++-- .../ProjectDataModel/CMakeLists_files.cmake | 2 -- .../Rim3dOverlayInfoConfig.cpp | 14 ++++++------- .../ProjectDataModel/Rim3dOverlayInfoConfig.h | 10 +++++----- .../RimGridStatisticsPlot.cpp | 6 ++++-- .../RimHistogramCalculator.cpp | 20 +++++++++---------- .../ProjectDataModel/RimHistogramCalculator.h | 12 +++++------ .../ReservoirDataModel/CMakeLists_files.cmake | 2 ++ .../RigHistogramData.cpp} | 10 +++++----- .../RigHistogramData.h} | 4 ++-- 11 files changed, 45 insertions(+), 43 deletions(-) rename ApplicationCode/{ProjectDataModel/RimHistogramData.cpp => ReservoirDataModel/RigHistogramData.cpp} (90%) rename ApplicationCode/{ProjectDataModel/RimHistogramData.h => ReservoirDataModel/RigHistogramData.h} (96%) diff --git a/ApplicationCode/Commands/RicGridStatisticsDialog.cpp b/ApplicationCode/Commands/RicGridStatisticsDialog.cpp index e3a28b22df..1b2fd74e18 100644 --- a/ApplicationCode/Commands/RicGridStatisticsDialog.cpp +++ b/ApplicationCode/Commands/RicGridStatisticsDialog.cpp @@ -172,7 +172,7 @@ void RicGridStatisticsDialog::setHistogramData( RimGridView* view ) aggr->setStyle( QwtPlotCurve::Steps ); aggr->setCurveAttribute( QwtPlotCurve::Inverted ); - RimHistogramData histogramData = overlayInfo->histogramData(); + RigHistogramData histogramData = overlayInfo->histogramData(); if ( histogramData.isHistogramVectorValid() ) { @@ -257,7 +257,7 @@ void RicGridStatisticsDialog::deletePlotItems( QwtPlot* plot ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicGridStatisticsDialog::setMarkers( const RimHistogramData& histData, QwtPlot* plot ) +void RicGridStatisticsDialog::setMarkers( const RigHistogramData& histData, QwtPlot* plot ) { QwtPlotMarker* marker; diff --git a/ApplicationCode/Commands/RicGridStatisticsDialog.h b/ApplicationCode/Commands/RicGridStatisticsDialog.h index 61e0a0a1c1..60e560c106 100644 --- a/ApplicationCode/Commands/RicGridStatisticsDialog.h +++ b/ApplicationCode/Commands/RicGridStatisticsDialog.h @@ -31,7 +31,7 @@ class QMainWindow; class QToolBar; class RimEclipseView; class RimGridView; -class RimHistogramData; +class RigHistogramData; //================================================================================================== /// @@ -56,7 +56,7 @@ private: private: void createAndConnectToolbarActions(); void deletePlotItems( QwtPlot* plot ); - static void setMarkers( const RimHistogramData& histData, QwtPlot* plot ); + static void setMarkers( const RigHistogramData& histData, QwtPlot* plot ); static QwtPlotMarker* createVerticalPlotMarker( const QColor& color, double xValue ); void adjustTextEditHeightToContent(); diff --git a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake index e043b4ba21..a1557c2c65 100644 --- a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake @@ -38,7 +38,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCalcScript.h ${CMAKE_CURRENT_LIST_DIR}/RimExportInputPropertySettings.h ${CMAKE_CURRENT_LIST_DIR}/RimBinaryExportSettings.h ${CMAKE_CURRENT_LIST_DIR}/Rim3dOverlayInfoConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimHistogramData.h ${CMAKE_CURRENT_LIST_DIR}/RimHistogramCalculator.h ${CMAKE_CURRENT_LIST_DIR}/RimTensorResults.h ${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.h @@ -198,7 +197,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCalcScript.cpp ${CMAKE_CURRENT_LIST_DIR}/RimExportInputPropertySettings.cpp ${CMAKE_CURRENT_LIST_DIR}/RimBinaryExportSettings.cpp ${CMAKE_CURRENT_LIST_DIR}/Rim3dOverlayInfoConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimHistogramData.cpp ${CMAKE_CURRENT_LIST_DIR}/RimHistogramCalculator.cpp ${CMAKE_CURRENT_LIST_DIR}/RimTensorResults.cpp ${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.cpp diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index 5c8e2c6826..8cac31c411 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -156,7 +156,7 @@ void Rim3dOverlayInfoConfig::setPosition( cvf::Vec2ui position ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimHistogramData Rim3dOverlayInfoConfig::histogramData() +RigHistogramData Rim3dOverlayInfoConfig::histogramData() { auto eclipseView = dynamic_cast( m_viewDef.p() ); auto geoMechView = dynamic_cast( m_viewDef.p() ); @@ -171,7 +171,7 @@ RimHistogramData Rim3dOverlayInfoConfig::histogramData() return m_histogramCalculator->histogramData( eclipseView, m_statisticsCellRange(), m_statisticsTimeRange() ); else if ( geoMechView ) return m_histogramCalculator->histogramData( geoMechView, m_statisticsCellRange(), m_statisticsTimeRange() ); - return RimHistogramData(); + return RigHistogramData(); } //-------------------------------------------------------------------------------------------------- @@ -203,7 +203,7 @@ QString Rim3dOverlayInfoConfig::caseInfoText() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString Rim3dOverlayInfoConfig::resultInfoText( const RimHistogramData& histData ) +QString Rim3dOverlayInfoConfig::resultInfoText( const RigHistogramData& histData ) { auto eclipseView = dynamic_cast( m_viewDef.p() ); auto geoMechView = dynamic_cast( m_viewDef.p() ); @@ -394,7 +394,7 @@ QString Rim3dOverlayInfoConfig::caseInfoText( RimGeoMechView* geoMechView ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString Rim3dOverlayInfoConfig::resultInfoText( const RimHistogramData& histData, +QString Rim3dOverlayInfoConfig::resultInfoText( const RigHistogramData& histData, RimEclipseView* eclipseView, bool showVolumeWeightedMean ) { @@ -544,7 +544,7 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const RimHistogramData& histData //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString Rim3dOverlayInfoConfig::resultInfoText( const RimHistogramData& histData, RimGeoMechView* geoMechView ) +QString Rim3dOverlayInfoConfig::resultInfoText( const RigHistogramData& histData, RimGeoMechView* geoMechView ) { QString infoText; @@ -831,7 +831,7 @@ void Rim3dOverlayInfoConfig::setReservoirView( RimGridView* ownerReservoirView ) //-------------------------------------------------------------------------------------------------- void Rim3dOverlayInfoConfig::updateEclipse3DInfo( RimEclipseView* eclipseView ) { - RimHistogramData histData; + RigHistogramData histData; if ( m_showHistogram() || m_showResultInfo() ) { @@ -873,7 +873,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo( RimEclipseView* eclipseView ) //-------------------------------------------------------------------------------------------------- void Rim3dOverlayInfoConfig::updateGeoMech3DInfo( RimGeoMechView* geoMechView ) { - RimHistogramData histData; + RigHistogramData histData; if ( m_showResultInfo() || m_showHistogram() ) { diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.h b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.h index 1d66ee15cc..b200ed9575 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.h +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.h @@ -18,7 +18,7 @@ #pragma once -#include "RimHistogramData.h" +#include "RigHistogramData.h" #include "RimHistogramCalculator.h" @@ -60,10 +60,10 @@ public: void setPosition( cvf::Vec2ui position ); - RimHistogramData histogramData(); + RigHistogramData histogramData(); QString timeStepText(); QString caseInfoText(); - QString resultInfoText( const RimHistogramData& histData ); + QString resultInfoText( const RigHistogramData& histData ); RicGridStatisticsDialog* getOrCreateGridStatisticsDialog(); void showStatisticsInfoDialog( bool raise = true ); @@ -87,8 +87,8 @@ private: QString timeStepText( RimGeoMechView* geoMechView ); QString caseInfoText( RimEclipseView* eclipseView ); QString caseInfoText( RimGeoMechView* geoMechView ); - QString resultInfoText( const RimHistogramData& histData, RimEclipseView* eclipseView, bool showVolumeWeightedMean ); - QString resultInfoText( const RimHistogramData& histData, RimGeoMechView* geoMechView ); + QString resultInfoText( const RigHistogramData& histData, RimEclipseView* eclipseView, bool showVolumeWeightedMean ); + QString resultInfoText( const RigHistogramData& histData, RimGeoMechView* geoMechView ); void displayPropertyFilteredStatisticsMessage( bool showSwitchToCurrentTimestep ); bool hasInvalidStatisticsCombination(); diff --git a/ApplicationCode/ProjectDataModel/RimGridStatisticsPlot.cpp b/ApplicationCode/ProjectDataModel/RimGridStatisticsPlot.cpp index 819e65c4eb..7d49e858f1 100644 --- a/ApplicationCode/ProjectDataModel/RimGridStatisticsPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimGridStatisticsPlot.cpp @@ -29,12 +29,14 @@ #include "RimEclipseView.h" #include "RimGridView.h" #include "RimHistogramCalculator.h" -#include "RimHistogramData.h" #include "RimPlot.h" #include "RimProject.h" #include "RimTools.h" + #include "RiuPlotMainWindow.h" +#include "RigHistogramData.h" + #include "cafPdmFieldScriptingCapability.h" #include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiComboBoxEditor.h" @@ -345,7 +347,7 @@ void RimGridStatisticsPlot::updatePlots() std::unique_ptr histogramCalculator; histogramCalculator.reset( new RimHistogramCalculator ); - RimHistogramData histogramData; + RigHistogramData histogramData; RimHistogramCalculator::StatisticsCellRangeType cellRange = RimHistogramCalculator::StatisticsCellRangeType::ALL_CELLS; diff --git a/ApplicationCode/ProjectDataModel/RimHistogramCalculator.cpp b/ApplicationCode/ProjectDataModel/RimHistogramCalculator.cpp index 59c9763a0f..e3adc0ed5c 100644 --- a/ApplicationCode/ProjectDataModel/RimHistogramCalculator.cpp +++ b/ApplicationCode/ProjectDataModel/RimHistogramCalculator.cpp @@ -81,9 +81,9 @@ void RimHistogramCalculator::invalidateVisibleCellsCache() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimHistogramData RimHistogramCalculator::histogramData( RimEclipseContourMapView* contourMap ) +RigHistogramData RimHistogramCalculator::histogramData( RimEclipseContourMapView* contourMap ) { - RimHistogramData histData; + RigHistogramData histData; if ( contourMap ) { @@ -103,9 +103,9 @@ RimHistogramData RimHistogramCalculator::histogramData( RimEclipseContourMapView //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimHistogramData RimHistogramCalculator::histogramData( RimGeoMechContourMapView* contourMap ) +RigHistogramData RimHistogramCalculator::histogramData( RimGeoMechContourMapView* contourMap ) { - RimHistogramData histData; + RigHistogramData histData; if ( contourMap ) { @@ -125,7 +125,7 @@ RimHistogramData RimHistogramCalculator::histogramData( RimGeoMechContourMapView //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimHistogramData RimHistogramCalculator::histogramData( RimEclipseView* eclipseView, +RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView* eclipseView, StatisticsCellRangeType cellRange, StatisticsTimeRangeType timeRange ) { @@ -152,14 +152,14 @@ RimHistogramData RimHistogramCalculator::histogramData( RimEclipseView* } // - RimHistogramData data; + RigHistogramData data; return data; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimHistogramData RimHistogramCalculator::histogramData( RimEclipseView* eclipseView, +RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView* eclipseView, RimEclipseResultDefinition* eclResultDefinition, StatisticsCellRangeType cellRange, StatisticsTimeRangeType timeRange, @@ -167,7 +167,7 @@ RimHistogramData RimHistogramCalculator::histogramData( RimEclipseView* { CVF_ASSERT( eclResultDefinition ); - RimHistogramData histData; + RigHistogramData histData; eclResultDefinition->loadResult(); @@ -260,11 +260,11 @@ RimHistogramData RimHistogramCalculator::histogramData( RimEclipseView* //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimHistogramData RimHistogramCalculator::histogramData( RimGeoMechView* geoMechView, +RigHistogramData RimHistogramCalculator::histogramData( RimGeoMechView* geoMechView, StatisticsCellRangeType cellRange, StatisticsTimeRangeType timeRange ) { - RimHistogramData histData; + RigHistogramData histData; if ( geoMechView ) { diff --git a/ApplicationCode/ProjectDataModel/RimHistogramCalculator.h b/ApplicationCode/ProjectDataModel/RimHistogramCalculator.h index 1ad6e790cf..2195a9f9bc 100644 --- a/ApplicationCode/ProjectDataModel/RimHistogramCalculator.h +++ b/ApplicationCode/ProjectDataModel/RimHistogramCalculator.h @@ -20,7 +20,7 @@ #include "RigEclipseResultAddress.h" -#include "RimHistogramData.h" +#include "RigHistogramData.h" #include "RigStatisticsDataCache.h" @@ -53,15 +53,15 @@ public: RimHistogramCalculator(); - RimHistogramData histogramData( RimEclipseContourMapView* contourMap ); - RimHistogramData histogramData( RimGeoMechContourMapView* contourMap ); - RimHistogramData + RigHistogramData histogramData( RimEclipseContourMapView* contourMap ); + RigHistogramData histogramData( RimGeoMechContourMapView* contourMap ); + RigHistogramData histogramData( RimEclipseView* eclipseView, StatisticsCellRangeType cellRange, StatisticsTimeRangeType timeRange ); - RimHistogramData + RigHistogramData histogramData( RimGeoMechView* geoMechView, StatisticsCellRangeType cellRange, StatisticsTimeRangeType timeRange ); - RimHistogramData histogramData( RimEclipseView* eclipseView, + RigHistogramData histogramData( RimEclipseView* eclipseView, RimEclipseResultDefinition* eclResultDefinition, StatisticsCellRangeType cellRange, StatisticsTimeRangeType timeRange, diff --git a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake index 4282691c65..3ba4599a8b 100644 --- a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake @@ -81,6 +81,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigNncConnection.h ${CMAKE_CURRENT_LIST_DIR}/RigWellDiskData.h ${CMAKE_CURRENT_LIST_DIR}/RigGocadData.h ${CMAKE_CURRENT_LIST_DIR}/RigElasticProperties.h +${CMAKE_CURRENT_LIST_DIR}/RigHistogramData.h ) @@ -159,6 +160,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigNncConnection.cpp ${CMAKE_CURRENT_LIST_DIR}/RigWellDiskData.cpp ${CMAKE_CURRENT_LIST_DIR}/RigGocadData.cpp ${CMAKE_CURRENT_LIST_DIR}/RigElasticProperties.cpp +${CMAKE_CURRENT_LIST_DIR}/RigHistogramData.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/ProjectDataModel/RimHistogramData.cpp b/ApplicationCode/ReservoirDataModel/RigHistogramData.cpp similarity index 90% rename from ApplicationCode/ProjectDataModel/RimHistogramData.cpp rename to ApplicationCode/ReservoirDataModel/RigHistogramData.cpp index 36db35193c..0ec629ce26 100644 --- a/ApplicationCode/ProjectDataModel/RimHistogramData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigHistogramData.cpp @@ -16,14 +16,14 @@ // ///////////////////////////////////////////////////////////////////////////////// -#include "RimHistogramData.h" +#include "RigHistogramData.h" #include //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimHistogramData::RimHistogramData() +RigHistogramData::RigHistogramData() : min( std::numeric_limits::max() ) , max( std::numeric_limits::max() ) , p10( std::numeric_limits::max() ) @@ -38,7 +38,7 @@ RimHistogramData::RimHistogramData() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimHistogramData::isMinMaxValid() const +bool RigHistogramData::isMinMaxValid() const { return isValid( min ) && isValid( max ); } @@ -46,7 +46,7 @@ bool RimHistogramData::isMinMaxValid() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimHistogramData::isValid( double parameter ) const +bool RigHistogramData::isValid( double parameter ) const { return parameter != std::numeric_limits::max() && parameter != -std::numeric_limits::max(); } @@ -54,7 +54,7 @@ bool RimHistogramData::isValid( double parameter ) const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimHistogramData::isHistogramVectorValid() const +bool RigHistogramData::isHistogramVectorValid() const { return histogram && histogram->size() > 0 && isMinMaxValid(); } diff --git a/ApplicationCode/ProjectDataModel/RimHistogramData.h b/ApplicationCode/ReservoirDataModel/RigHistogramData.h similarity index 96% rename from ApplicationCode/ProjectDataModel/RimHistogramData.h rename to ApplicationCode/ReservoirDataModel/RigHistogramData.h index db16cefd76..f874af55e1 100644 --- a/ApplicationCode/ProjectDataModel/RimHistogramData.h +++ b/ApplicationCode/ReservoirDataModel/RigHistogramData.h @@ -24,10 +24,10 @@ /// /// //================================================================================================== -class RimHistogramData +class RigHistogramData { public: - RimHistogramData(); + RigHistogramData(); double min; double max;