#3934 Implement area threshold for contour polygons

This commit is contained in:
Gaute Lindkvist committed 2019-01-09 08:42:20 +01:00
1 parent c8f9505d1e
commit 7fccdf7153
3 files changed
+18 -11

No files matched your search

@@ -268,6 +268,8 @@ void RimContourMapProjection::generateContourPolygons()
{
std::vector<ContourPolygons> contourPolygons;
const double areaTreshold = 1.5 * m_sampleSpacing * m_sampleSpacing;
if (minValue() != std::numeric_limits<double>::infinity() &&
maxValue() != -std::numeric_limits<double>::infinity() &&
std::fabs(maxValue() - minValue()) > 1.0e-8)
@@ -280,7 +282,7 @@ void RimContourMapProjection::generateContourPolygons()
if (nContourLevels > 2)
{
std::vector<caf::ContourLines::ClosedPolygons> closedContourLines =
caf::ContourLines::create(m_aggregatedVertexResults, xVertexPositions(), yVertexPositions(), contourLevels);
caf::ContourLines::create(m_aggregatedVertexResults, xVertexPositions(), yVertexPositions(), contourLevels, areaTreshold);
contourPolygons.resize(closedContourLines.size());
@@ -300,7 +302,6 @@ void RimContourMapProjection::generateContourPolygons()
contourPolygons[i].push_back(contourPolygon);
}
}
smoothPolygonLoops(&contourPolygons[0]);
}
}