#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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -34,7 +34,9 @@
#include "RimGridCollection.h"
#include "RimSimWellInViewCollection.h"
#include "RimScaleLegendConfig.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafProgressInfo.h"
#include "cvfCamera.h"
#include "cvfModelBasicList.h"
@@ -237,23 +239,32 @@ void RimEclipseContourMapView::updateCurrentTimeStep()
//--------------------------------------------------------------------------------------------------
void RimEclipseContourMapView::updateGeometry()
{
caf::ProgressInfo progress(100, "Generate Contour Map", true);
this->updateVisibleGeometriesAndCellColors();
if (m_contourMapProjection->isChecked())
{
m_contourMapProjection->generateResultsIfNecessary(m_currentTimeStep());
{ // Step 1: generate results and some minor updates. About 30% of the time.
if (m_contourMapProjection->isChecked())
{
m_contourMapProjection->generateResultsIfNecessary(m_currentTimeStep());
}
progress.setProgress(30);
}
updateLegends(); // To make sure the scalar mappers are set up correctly
appendWellsAndFracturesToModel();
createContourMapGeometry();
appendContourMapProjectionToModel();
appendContourLinesToModel();
appendPickPointVisToModel();
{ // Step 2: generate geometry. Takes about 60% of the time.
createContourMapGeometry();
progress.setProgress(90);
}
{ // Step 3: generate drawables. Takes about 10% of the time.
appendContourMapProjectionToModel();
appendContourLinesToModel();
appendPickPointVisToModel();
progress.setProgress(100);
}
m_overlayInfoConfig()->update3DInfo();
}

View File

@@ -29,7 +29,9 @@
#include "RimScaleLegendConfig.h"
#include "RimSimWellInViewCollection.h"
#include "RimViewNameConfig.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafProgressInfo.h"
#include "cvfCamera.h"
#include "cvfModelBasicList.h"
@@ -245,18 +247,29 @@ void RimGeoMechContourMapView::updateCurrentTimeStep()
//--------------------------------------------------------------------------------------------------
void RimGeoMechContourMapView::updateGeometry()
{
if (m_contourMapProjection->isChecked())
{
m_contourMapProjection->generateResultsIfNecessary(m_currentTimeStep());
}
updateLegends();
caf::ProgressInfo progress(100, "Generate Contour Map", true);
createContourMapGeometry();
appendContourMapProjectionToModel();
appendContourLinesToModel();
appendPickPointVisToModel();
{ // Step 1: generate results. About 30% of the time.
if (m_contourMapProjection->isChecked())
{
m_contourMapProjection->generateResultsIfNecessary(m_currentTimeStep());
}
updateLegends();
progress.setProgress(30);
}
{ // Step 2: generate geometry. Takes about 60% of the time.
createContourMapGeometry();
progress.setProgress(90);
}
{ // Step 3: generate drawables. About 10% of the time.
appendContourMapProjectionToModel();
appendContourLinesToModel();
appendPickPointVisToModel();
progress.setProgress(100);
}
m_overlayInfoConfig->update3DInfo();
}