#4025 Show delayed action progress bar during contour map generation

This commit is contained in:
Gaute Lindkvist
2019-02-08 12:40:38 +01:00
parent 72e9683ac9
commit 0fd51b2088
5 changed files with 75 additions and 26 deletions

View File

@@ -34,6 +34,7 @@
#include "cafContourLines.h"
#include "cafPdmUiDoubleSliderEditor.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafProgressInfo.h"
#include "cvfArray.h"
#include "cvfCellRange.h"
@@ -98,20 +99,31 @@ RimContourMapProjection::RimContourMapProjection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimContourMapProjection::~RimContourMapProjection() {}
RimContourMapProjection::~RimContourMapProjection()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimContourMapProjection::generateResultsIfNecessary(int timeStep)
{
caf::ProgressInfo progress(100, "Generate Results", true);
updateGridInformation();
progress.setProgress(10);
if (gridMappingNeedsUpdating() || mapCellVisibilityNeedsUpdating())
{
clearResults();
m_projected3dGridIndices = generateGridMapping();
progress.setProgress(20);
m_mapCellVisibility = getMapCellVisibility();
progress.setProgress(30);
}
else
{
progress.setProgress(30);
}
if (resultVariableChanged())
@@ -124,8 +136,10 @@ void RimContourMapProjection::generateResultsIfNecessary(int timeStep)
{
clearGeometry();
m_aggregatedResults = generateResults(timeStep);
progress.setProgress(80);
generateVertexResults();
}
progress.setProgress(100);
m_currentResultTimestep = timeStep;
}
@@ -134,11 +148,15 @@ void RimContourMapProjection::generateResultsIfNecessary(int timeStep)
//--------------------------------------------------------------------------------------------------
void RimContourMapProjection::generateGeometryIfNecessary()
{
caf::ProgressInfo progress(100, "Generate Geometry", true);
if (geometryNeedsUpdating())
{
generateContourPolygons();
progress.setProgress(25);
generateTrianglesWithVertexValues();
}
progress.setProgress(100);
}
//--------------------------------------------------------------------------------------------------