From 186867a8313e05c34370d3c32796d88139375445 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 11 Aug 2014 14:51:27 +0200 Subject: [PATCH] Removed unused code --- .../ModelVisualization/RivGridPartMgr.cpp | 101 ------------------ .../ModelVisualization/RivGridPartMgr.h | 18 ---- 2 files changed, 119 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp index b4a3068d13..f06db186b1 100644 --- a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp @@ -383,104 +383,3 @@ public: }; -//-------------------------------------------------------------------------------------------------- -/// Creates and assigns a ternary saturation color for all four vertices of a quad representing a cell face -/// -/// Loads ternary saturation results SOIL, SWAT and SGAS -/// If any of these are not present, the values for a missing component is set to 0.0 -//-------------------------------------------------------------------------------------------------- -void RivTransmissibilityColorMapper::updateTernarySaturationColorArray(size_t timeStepIndex, RimResultSlot* cellResultSlot, - const RigGridBase* grid, cvf::Color3ubArray* colorArray, - const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper) -{ - RimReservoirCellResultsStorage* gridCellResults = cellResultSlot->currentGridCellResults(); - if (!gridCellResults) return; - - RigCaseData* eclipseCase = cellResultSlot->reservoirView()->eclipseCase()->reservoirData(); - if (!eclipseCase) return; - - size_t soilScalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SOIL"); - size_t sgasScalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SGAS"); - size_t swatScalarSetIndex = gridCellResults->findOrLoadScalarResult(RimDefines::DYNAMIC_NATIVE, "SWAT"); - - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel()); - - double soilMin = 0.0; - double soilMax = 1.0; - double sgasMin = 0.0; - double sgasMax = 1.0; - double swatMin = 0.0; - double swatMax = 1.0; - - cellResultSlot->ternaryLegendConfig()->ternaryRanges(soilMin, soilMax, sgasMin, sgasMax, swatMin, swatMax); - - cvf::ref dataAccessObjectSoil = eclipseCase->TO_BE_DELETED_resultAccessor(grid, porosityModel, timeStepIndex, soilScalarSetIndex); - if (dataAccessObjectSoil.isNull()) - { - dataAccessObjectSoil = new ScalarDataAccessZeroForAllCells; - } - - cvf::ref dataAccessObjectSgas = eclipseCase->TO_BE_DELETED_resultAccessor(grid, porosityModel, timeStepIndex, sgasScalarSetIndex); - if (dataAccessObjectSgas.isNull()) - { - dataAccessObjectSgas = new ScalarDataAccessZeroForAllCells; - } - - cvf::ref dataAccessObjectSwat = eclipseCase->TO_BE_DELETED_resultAccessor(grid, porosityModel, timeStepIndex, swatScalarSetIndex); - if (dataAccessObjectSwat.isNull()) - { - dataAccessObjectSwat = new ScalarDataAccessZeroForAllCells; - } - - double soilRange = soilMax - soilMin; - double soilFactor = 255.0 / soilRange; - - double sgasRange = sgasMax - sgasMin; - double sgasFactor = 255.0 / sgasRange; - - double swatRange = swatMax - swatMin; - double swatFactor = 255.0 / swatRange; - - size_t numVertices = quadToCellFaceMapper->quadCount()*4; - - colorArray->resize(numVertices); - - cvf::Color3ub ternaryColorByte; - double v, vNormalized; - -#pragma omp parallel for private(ternaryColorByte, v, vNormalized) - for (int quadIdx = 0; quadIdx < static_cast(quadToCellFaceMapper->quadCount()); quadIdx++) - { - size_t gridCellIndex = quadToCellFaceMapper->cellIndex(quadIdx); - - { - v = dataAccessObjectSgas->cellScalar(gridCellIndex); - vNormalized = (v - sgasMin) * sgasFactor; - - vNormalized = cvf::Math::clamp(vNormalized, 0.0, 255.0); - ternaryColorByte.r() = vNormalized; - } - - { - v = dataAccessObjectSoil->cellScalar(gridCellIndex); - vNormalized = (v - soilMin) * soilFactor; - - vNormalized = cvf::Math::clamp(vNormalized, 0.0, 255.0); - ternaryColorByte.g() = vNormalized; - } - - { - v = dataAccessObjectSwat->cellScalar(gridCellIndex); - vNormalized = (v - swatMin) * swatFactor; - - vNormalized = cvf::Math::clamp(vNormalized, 0.0, 255.0); - ternaryColorByte.b() = vNormalized; - } - - size_t j; - for (j = 0; j < 4; j++) - { - colorArray->set(quadIdx*4 + j, ternaryColorByte); - } - } -} diff --git a/ApplicationCode/ModelVisualization/RivGridPartMgr.h b/ApplicationCode/ModelVisualization/RivGridPartMgr.h index 54bde9110c..711d276135 100644 --- a/ApplicationCode/ModelVisualization/RivGridPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivGridPartMgr.h @@ -37,24 +37,6 @@ class RimCellEdgeResultSlot; -//================================================================================================== -/// -/// -//================================================================================================== -class RivTransmissibilityColorMapper -{ -public: - - static void updateTernarySaturationColorArray( - size_t timeStepIndex, - RimResultSlot* cellResultSlot, - const RigGridBase* grid, - cvf::Color3ubArray* colorArray, - const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper); -}; - - - //================================================================================================== /// /// RivGridGeometry: Class to handle visualization structures that embodies a specific grid at a specific time step.