#4033 Fix glitch with large padding for GeoMech

* Off by one error in distance transform
* Need a larger bounding box to allow for full padding.
This commit is contained in:
Gaute Lindkvist 2019-02-04 10:07:46 +01:00
parent 78b31db3b8
commit 1171884c1b
2 changed files with 6 additions and 6 deletions

View File

@ -49,7 +49,7 @@ void RiaImageTools::distanceTransform2d(std::vector<std::vector<unsigned int>>&
g[x][y] = 1 + g[x][y - 1];
}
}
for (int64_t y = N - 2; y > 0; --y)
for (int64_t y = N - 2; y >= 0; --y)
{
if (g[x][y + 1] < g[x][y])
{
@ -100,7 +100,7 @@ void RiaImageTools::distanceTransform2d(std::vector<std::vector<unsigned int>>&
}
}
}
for (int64_t u = M - 1; u > 0; --u)
for (int64_t u = M - 1; u >= 0; --u)
{
int64_t fVal = f(u, s[q], g, y);
CVF_ASSERT(fVal <= std::numeric_limits<double>::max());

View File

@ -162,11 +162,11 @@ cvf::BoundingBox RimGeoMechContourMapProjection::calculateExpandedPorBarBBox(int
cvf::Vec3d boxMin = boundingBox.min();
cvf::Vec3d boxMax = boundingBox.max();
cvf::Vec3d boxExtent = boundingBox.extent();
boxMin.x() -= boxExtent.x() * 0.5;
boxMin.y() -= boxExtent.y() * 0.5;
boxMin.x() -= boxExtent.x() * 0.5 * m_paddingAroundPorePressureRegion();
boxMin.y() -= boxExtent.y() * 0.5 * m_paddingAroundPorePressureRegion();
boxMin.z() -= geoMechCase()->characteristicCellSize();
boxMax.x() += boxExtent.x() * 0.5;
boxMax.y() += boxExtent.y() * 0.5;
boxMax.x() += boxExtent.x() * 0.5 * m_paddingAroundPorePressureRegion();
boxMax.y() += boxExtent.y() * 0.5 * m_paddingAroundPorePressureRegion();
boxMax.z() += geoMechCase()->characteristicCellSize();
return cvf::BoundingBox(boxMin, boxMax);
}