From 0157181e5b1477d64d9db3cbe3fa1121298d49ef Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 7 Aug 2014 14:56:29 +0200 Subject: [PATCH] Removed setCellScalar and resultName from Resultaccessor --- .../RigActiveCellsResultAccessor.cpp | 25 ++----------------- .../RigActiveCellsResultAccessor.h | 5 +--- .../RigAllGridCellsResultAccessor.cpp | 23 ++--------------- .../RigAllGridCellsResultAccessor.h | 5 +--- .../RigCellEdgeResultAccessor.cpp | 21 +--------------- .../RigCellEdgeResultAccessor.h | 6 +---- .../RigCombTransResultAccessor.cpp | 23 ++--------------- .../RigCombTransResultAccessor.h | 5 +--- .../ReservoirDataModel/RigResultAccessor.h | 4 --- .../RigResultAccessorFactory.cpp | 6 ++--- 10 files changed, 14 insertions(+), 109 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.cpp b/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.cpp index edd5ae168c..a72a3b1ec4 100644 --- a/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.cpp @@ -24,11 +24,10 @@ #include -RigActiveCellsResultAccessor::RigActiveCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues, const RigActiveCellInfo* activeCellInfo, const QString& resultName) +RigActiveCellsResultAccessor::RigActiveCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues, const RigActiveCellInfo* activeCellInfo) : m_grid(grid), m_reservoirResultValues(reservoirResultValues), - m_activeCellInfo(activeCellInfo), - m_resultName(resultName) + m_activeCellInfo(activeCellInfo) { } @@ -57,23 +56,3 @@ double RigActiveCellsResultAccessor::cellFaceScalar(size_t localCellIndex, cvf:: return cellScalar(localCellIndex); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RigActiveCellsResultAccessor::resultName() const -{ - return m_resultName; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigActiveCellsResultAccessor::setCellScalar(size_t localCellIndex, double scalarValue) -{ - size_t globalGridCellIndex = m_grid->globalGridCellIndex(localCellIndex); - size_t resultValueIndex = m_activeCellInfo->cellResultIndex(globalGridCellIndex); - - CVF_TIGHT_ASSERT(m_reservoirResultValues != NULL && resultValueIndex < m_reservoirResultValues->size()); - - (*m_reservoirResultValues)[resultValueIndex] = scalarValue; -} diff --git a/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.h index 306b70fcda..9647033722 100644 --- a/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigActiveCellsResultAccessor.h @@ -30,17 +30,14 @@ class RigActiveCellInfo; class RigActiveCellsResultAccessor : public RigResultAccessor { public: - RigActiveCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues, const RigActiveCellInfo* activeCellInfo, const QString& resultName); + RigActiveCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues, const RigActiveCellInfo* activeCellInfo); virtual double cellScalar(size_t localCellIndex) const; virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const; - virtual QString resultName() const; - virtual void setCellScalar(size_t localCellIndex, double scalarValue); private: const RigActiveCellInfo* m_activeCellInfo; const RigGridBase* m_grid; std::vector* m_reservoirResultValues; - QString m_resultName; }; diff --git a/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.cpp b/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.cpp index 7e5762a184..5ba549176f 100644 --- a/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.cpp @@ -26,10 +26,9 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigAllGridCellsResultAccessor::RigAllGridCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues, const QString& resultName) +RigAllGridCellsResultAccessor::RigAllGridCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues) : m_grid(grid), - m_reservoirResultValues(reservoirResultValues), - m_resultName(resultName) + m_reservoirResultValues(reservoirResultValues) { } @@ -54,21 +53,3 @@ double RigAllGridCellsResultAccessor::cellFaceScalar(size_t localCellIndex, cvf: return cellScalar(localCellIndex); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RigAllGridCellsResultAccessor::resultName() const -{ - return m_resultName; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigAllGridCellsResultAccessor::setCellScalar(size_t localCellIndex, double scalarValue) -{ - size_t globalGridCellIndex = m_grid->globalGridCellIndex(localCellIndex); - CVF_TIGHT_ASSERT(globalGridCellIndex < m_reservoirResultValues->size()); - - (*m_reservoirResultValues)[globalGridCellIndex] = scalarValue; -} diff --git a/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.h index 1c4473daa0..840e3f46a7 100644 --- a/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigAllGridCellsResultAccessor.h @@ -29,17 +29,14 @@ class RigGridBase; class RigAllGridCellsResultAccessor : public RigResultAccessor { public: - RigAllGridCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues, const QString& resultName); + RigAllGridCellsResultAccessor(const RigGridBase* grid, std::vector* reservoirResultValues); virtual double cellScalar(size_t localCellIndex) const; virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const; - virtual QString resultName() const; - virtual void setCellScalar(size_t localCellIndex, double scalarValue); private: const RigGridBase* m_grid; std::vector* m_reservoirResultValues; - QString m_resultName; }; diff --git a/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.cpp b/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.cpp index a5dfc0ee28..f94aebe8c2 100644 --- a/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.cpp @@ -24,8 +24,7 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigCellEdgeResultAccessor::RigCellEdgeResultAccessor(const QString& resultName) - : m_resultName(resultName) +RigCellEdgeResultAccessor::RigCellEdgeResultAccessor() { m_resultAccessObjects.resize(6); } @@ -64,21 +63,3 @@ double RigCellEdgeResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::Str return HUGE_VAL; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RigCellEdgeResultAccessor::resultName() const -{ - return m_resultName; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigCellEdgeResultAccessor::setCellScalar(size_t localCellIndex, double scalarValue) -{ - // TODO: How to handle when we get here? - CVF_ASSERT(false); - -} - diff --git a/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.h index 73ea161fb8..cdc70c0937 100644 --- a/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigCellEdgeResultAccessor.h @@ -29,17 +29,13 @@ class RigCellEdgeResultAccessor : public RigResultAccessor { public: - RigCellEdgeResultAccessor(const QString& resultName); + RigCellEdgeResultAccessor(); void setDataAccessObjectForFace(cvf::StructGridInterface::FaceType faceId, RigResultAccessor* resultAccessObject); virtual double cellScalar(size_t localCellIndex) const; virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const; - virtual QString resultName() const; - virtual void setCellScalar(size_t localCellIndex, double scalarValue); private: cvf::Collection m_resultAccessObjects; - - QString m_resultName; }; diff --git a/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.cpp b/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.cpp index 86a27788b2..af7b992e7f 100644 --- a/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.cpp @@ -26,9 +26,8 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigCombTransResultAccessor::RigCombTransResultAccessor(const RigGridBase* grid, const QString& resultName) - : m_grid(grid), - m_resultName(resultName) +RigCombTransResultAccessor::RigCombTransResultAccessor(const RigGridBase* grid) + : m_grid(grid) { m_resultAccessObjects.resize(6); } @@ -140,21 +139,3 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t localCellIndex, cvf::St return HUGE_VAL; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RigCombTransResultAccessor::resultName() const -{ - return m_resultName; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigCombTransResultAccessor::setCellScalar(size_t localCellIndex, double scalarValue) -{ - // TODO: How to handle when we get here? - CVF_ASSERT(false); - -} - diff --git a/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.h index e99002d799..6a7a0b5cda 100644 --- a/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigCombTransResultAccessor.h @@ -31,18 +31,15 @@ class RigGridBase; class RigCombTransResultAccessor : public RigResultAccessor { public: - RigCombTransResultAccessor(const RigGridBase* grid, const QString& resultName); + RigCombTransResultAccessor(const RigGridBase* grid); void setDataAccessObjectForFace(cvf::StructGridInterface::FaceType faceId, RigResultAccessor* resultAccessObject); virtual double cellScalar(size_t localCellIndex) const; virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const; - virtual QString resultName() const; - virtual void setCellScalar(size_t localCellIndex, double scalarValue); private: cvf::Collection m_resultAccessObjects; const RigGridBase* m_grid; - QString m_resultName; }; diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessor.h b/ApplicationCode/ReservoirDataModel/RigResultAccessor.h index fb1837c3bb..a49bdc62da 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessor.h +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessor.h @@ -33,10 +33,6 @@ class RigResultAccessor : public cvf::Object public: virtual double cellScalar(size_t localCellIndex) const = 0; virtual double cellFaceScalar(size_t localCellIndex, cvf::StructGridInterface::FaceType faceId) const = 0; - - virtual QString resultName() const = 0; - - virtual void setCellScalar(size_t localCellIndex, double scalarValue) = 0; }; #if 0 diff --git a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp index 0e6fba79b9..66096010cd 100644 --- a/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp +++ b/ApplicationCode/ReservoirDataModel/RigResultAccessorFactory.cpp @@ -83,12 +83,12 @@ cvf::ref RigResultAccessorFactory::createNativeResultAccessor bool useGlobalActiveIndex = eclipseCase->results(porosityModel)->isUsingGlobalActiveIndex(scalarSetIndex); if (useGlobalActiveIndex) { - cvf::ref object = new RigActiveCellsResultAccessor(grid, resultValues, eclipseCase->activeCellInfo(porosityModel), uiResultName); + cvf::ref object = new RigActiveCellsResultAccessor(grid, resultValues, eclipseCase->activeCellInfo(porosityModel)); return object; } else { - cvf::ref object = new RigAllGridCellsResultAccessor(grid, resultValues, uiResultName); + cvf::ref object = new RigAllGridCellsResultAccessor(grid, resultValues); return object; } } @@ -122,7 +122,7 @@ cvf::ref RigResultAccessorFactory::createResultAccessor(RigCa // Taken from RivTransmissibilityColorMapper::updateCombinedTransmissibilityTextureCoordinates // - cvf::ref cellFaceAccessObject = new RigCombTransResultAccessor(grid, uiResultName); + cvf::ref cellFaceAccessObject = new RigCombTransResultAccessor(grid); { QString resultName = "TRANX";