Improve performance of contour line generation

This commit is contained in:
Gaute Lindkvist
2019-03-21 18:26:35 +01:00
parent e1d842d3a4
commit 64fc6447f4
2 changed files with 85 additions and 61 deletions

View File

@@ -21,6 +21,7 @@
#include "RimCheckableNamedObject.h"
#include "RimRegularLegendConfig.h"
#include "cafContourLines.h"
#include "cafDisplayCoordTransform.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
@@ -140,7 +141,7 @@ protected:
bool gridMappingNeedsUpdating() const;
bool resultsNeedsUpdating(int timeStep) const;
bool geometryNeedsUpdating() const;
bool timestepRangeNeedsUpdating() const;
bool resultRangeIsValid() const;
void clearGridMapping();
void clearResults();
void clearTimeStepRange();
@@ -158,7 +159,9 @@ protected:
void generateTrianglesWithVertexValues();
std::vector<cvf::Vec3d> generateVertices() const;
void generateContourPolygons();
void smoothContourPolygons(ContourPolygons* contourPolygons, const ContourPolygons* clipBy, bool favourExpansion);
ContourPolygons createContourPolygonsFromLineSegments(caf::ContourLines::ListOfLineSegments& unorderedLineSegments, double contourValue);
void smoothContourPolygons(ContourPolygons* contourPolygons, bool favourExpansion);
void clipContourPolygons(ContourPolygons* contourPolygons, const ContourPolygons* clipBy);
static double sumPolygonArea(const ContourPolygons& contourPolygons);
static double sumTriangleAreas(const std::vector<cvf::Vec4d>& triangles);