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);