Improve draw performance for active cell grid

* Show timing for geoBuilder.generateSurface()
* Check state of element vector result before geometry is created

* Improve performance for isFaceVisible
Avoid calling costly function cell() when possible
Remove check on fault geometry as this does not affect the visualization

* Performance: Avoid traversal of all cells when computing visibility
When we have an active cell grid, we can skip checking for inactive and invalid state.
Use the list of active grid cells when looping through cells.
This commit is contained in:
Magne Sjaastad
2024-11-03 13:38:03 +01:00
committed by GitHub
parent 9a1c54c7d6
commit 4cf6a26083
6 changed files with 92 additions and 27 deletions

View File

@@ -20,6 +20,7 @@
#include "RivGridPartMgr.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaRegressionTestRunner.h"
@@ -66,6 +67,32 @@
#include "cvfTransform.h"
#include "cvfUniform.h"
namespace caf
{
template <>
void caf::AppEnum<RivCellSetEnum>::setUp()
{
addItem( RivCellSetEnum::OVERRIDDEN_CELL_VISIBILITY, "OVERRIDDEN_CELL_VISIBILITY", "OVERRIDDEN_CELL_VISIBILITY" );
addItem( RivCellSetEnum::ALL_CELLS, "ALL_CELLS", "ALL_CELLS" );
addItem( RivCellSetEnum::ACTIVE, "ACTIVE", "ACTIVE" );
addItem( RivCellSetEnum::ALL_WELL_CELLS, "ALL_WELL_CELLS", "ALL_WELL_CELLS" );
addItem( RivCellSetEnum::VISIBLE_WELL_CELLS, "VISIBLE_WELL_CELLS", "VISIBLE_WELL_CELLS" );
addItem( RivCellSetEnum::VISIBLE_WELL_FENCE_CELLS, "VISIBLE_WELL_FENCE_CELLS", "VISIBLE_WELL_FENCE_CELLS" );
addItem( RivCellSetEnum::INACTIVE, "INACTIVE", "INACTIVE" );
addItem( RivCellSetEnum::RANGE_FILTERED, "RANGE_FILTERED", "RANGE_FILTERED" );
addItem( RivCellSetEnum::RANGE_FILTERED_INACTIVE, "RANGE_FILTERED_INACTIVE", "RANGE_FILTERED_INACTIVE" );
addItem( RivCellSetEnum::RANGE_FILTERED_WELL_CELLS, "RANGE_FILTERED_WELL_CELLS", "RANGE_FILTERED_WELL_CELLS" );
addItem( RivCellSetEnum::VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER,
"VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER",
"VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER" );
addItem( RivCellSetEnum::VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER,
"VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER",
"VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER" );
addItem( RivCellSetEnum::PROPERTY_FILTERED, "PROPERTY_FILTERED", "PROPERTY_FILTERED" );
addItem( RivCellSetEnum::PROPERTY_FILTERED_WELL_CELLS, "PROPERTY_FILTERED_WELL_CELLS", "PROPERTY_FILTERED_WELL_CELLS" );
}
} // namespace caf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -117,7 +144,11 @@ void RivGridPartMgr::generatePartGeometry( cvf::StructGridGeometryGenerator& geo
// Surface geometry
{
auto text = caf::AppEnum<RivCellSetEnum>::text( m_cellSetType );
RiaLogging::resetTimer( "Compute surface for " + text );
cvf::ref<cvf::DrawableGeo> geo = geoBuilder.generateSurface();
RiaLogging::logTimeElapsed( "" );
if ( geo.notNull() )
{
geo->computeNormals();