From 052b3e0c7cbb7f1a56edd12d4e32a51be5d5b159 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Tue, 13 Nov 2018 14:31:08 +0100 Subject: [PATCH] 2d Maps: Remove volume adjustment code with little effect. --- .../RimContourMapProjection.cpp | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp b/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp index 70e13c9ca8..3bc0d387f8 100644 --- a/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp +++ b/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp @@ -684,9 +684,6 @@ std::vector> RimContourMapProjection::visibleCellsAndO KLayerCellWeightMap matchingVisibleCellsWeightPerKLayer; std::array hexCorners; - double sumOverlapVolumes = 0.0; - double maxHeight = -std::numeric_limits::infinity(); - double minHeight = std::numeric_limits::infinity(); for (size_t globalCellIdx : allCellIndices) { if ((*m_cellGridIdxVisibility)[globalCellIdx]) @@ -723,43 +720,18 @@ std::vector> RimContourMapProjection::visibleCellsAndO } if (weight > 0.0) { - double height = overlapBBox.max().z(); matchingVisibleCellsWeightPerKLayer[k].push_back(std::make_pair(globalCellIdx, weight)); - sumOverlapVolumes += overlapVolume; - maxHeight = std::max(maxHeight, height); - minHeight = std::min(minHeight, overlapBBox.min().z()); } } } } - double volAdjustmentFactor = 1.0; - - if (sumOverlapVolumes > 0.0) - { - cvf::Vec3d improvedBottomSwCorner = bottomSWCorner; - improvedBottomSwCorner.z() = minHeight; - - cvf::Vec3d improvedTopNECorner = topNECorner; - improvedTopNECorner.z() = maxHeight; - - cvf::BoundingBox improvedBbox2dElement = cvf::BoundingBox(improvedBottomSwCorner, improvedTopNECorner); - cvf::Vec3d improvedBboxExtent = improvedBbox2dElement.extent(); - double improvedBboxVolume = improvedBboxExtent.x() * improvedBboxExtent.y() * improvedBboxExtent.z(); - - if (sumOverlapVolumes > improvedBboxVolume) - { - // Total volume weights for 2d Element should never be larger than the volume of the extruded 2d element. - volAdjustmentFactor = improvedBboxVolume / sumOverlapVolumes; - } - } - std::vector> matchingVisibleCellsAndWeight; for (auto kLayerCellWeight : matchingVisibleCellsWeightPerKLayer) { for (auto cellWeight : kLayerCellWeight.second) { - matchingVisibleCellsAndWeight.push_back(std::make_pair(cellWeight.first, cellWeight.second * volAdjustmentFactor)); + matchingVisibleCellsAndWeight.push_back(std::make_pair(cellWeight.first, cellWeight.second)); } }