2d Maps: Fix bug when there's no range filters active

This commit is contained in:
Gaute Lindkvist
2018-10-17 13:51:19 +02:00
parent 39ed7ad5d3
commit 075c3eb627
2 changed files with 12 additions and 7 deletions

View File

@@ -79,17 +79,17 @@ void Riv2dGridProjectionPartMgr::removeTrianglesWithNoResult(cvf::UIntArray* ver
for (size_t n = 0; n < vertices->size(); n += 3)
{
bool anyInvalid = false;
for (size_t t = 0; !anyInvalid && t < 3; ++t)
bool anyValid = false;
for (size_t t = 0; !anyValid && t < 3; ++t)
{
cvf::uint vertexNumber = (*vertices)[n + t];
cvf::Vec2ui ij = m_2dGridProjection->ijFromGridIndex(vertexNumber);
if (!m_2dGridProjection->hasResultAt(ij.x(), ij.y()))
if (m_2dGridProjection->hasResultAt(ij.x(), ij.y()))
{
anyInvalid = true;
anyValid = true;
}
}
for (size_t t = 0; !anyInvalid && t < 3; ++t)
for (size_t t = 0; anyValid && t < 3; ++t)
{
cvf::uint vertexNumber = (*vertices)[n + t];
trianglesWithResult.push_back(vertexNumber);

View File

@@ -312,8 +312,13 @@ std::vector<std::pair<size_t, float>> Rim2dGridProjection::visibleCellsAndWeight
std::vector<RimCellRangeFilterCollection*> rangeFilterCollections;
view->descendantsIncludingThisOfType(rangeFilterCollections);
bool hasActiveFilters = rangeFilterCollections.front()->hasActiveFilters();
cvf::CellRangeFilter cellRangeFilter;
rangeFilterCollections.front()->compoundCellRangeFilter(&cellRangeFilter, mainGrid()->gridIndex());
if (hasActiveFilters)
{
rangeFilterCollections.front()->compoundCellRangeFilter(&cellRangeFilter, mainGrid()->gridIndex());
}
const RigActiveCellInfo* activeCellInfo = eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
@@ -338,7 +343,7 @@ std::vector<std::pair<size_t, float>> Rim2dGridProjection::visibleCellsAndWeight
RigGridBase* localGrid = mainGrid()->gridAndGridLocalIdxFromGlobalCellIdx(globalCellIdx, &localCellIdx);
size_t i, j, k;
localGrid->ijkFromCellIndex(localCellIdx, &i, &j, &k);
if (cellRangeFilter.isCellVisible(i, j, k, !localGrid->isMainGrid()))
if (!hasActiveFilters || cellRangeFilter.isCellVisible(i, j, k, !localGrid->isMainGrid()))
{
localGrid->cellCornerVertices(localCellIdx, hexCorners);
std::vector<HexIntersectionInfo> intersections;