Skip to content

Commit

Permalink
Intersection: Make sure property filtered geometry is visible
Browse files Browse the repository at this point in the history
When an intersection geometry is filtered by property filters, make sure that the static geometry is hidden.
  • Loading branch information
magnesj committed Sep 24, 2024
1 parent 19354ac commit a870fce
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions ApplicationLibCode/ProjectDataModel/RimGridView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,21 @@ void RimGridView::appendIntersectionsToModel( bool cellFiltersActive, bool prope
{
m_intersectionCollection->clearGeometry();

bool addStaticModel = true;

if ( m_intersectionCollection->shouldApplyCellFiltersToIntersections() && ( cellFiltersActive || propertyFiltersActive ) )
{
if ( !propertyFiltersActive )
if ( propertyFiltersActive )
{
cvf::UByteArray visibleCells;
calculateCellVisibility( &visibleCells, { PROPERTY_FILTERED, PROPERTY_FILTERED_WELL_CELLS } );
m_intersectionCollection->appendDynamicPartsToModel( m_intersectionVizModel.p(), scaleTransform(), currentTimeStep(), &visibleCells );

// If property filters are active, we do not want to add the static model as the static parts can cover the dynamic parts in
// some cases
addStaticModel = false;
}
else
{
cvf::UByteArray visibleCells;
calculateCellVisibility( &visibleCells, { RANGE_FILTERED_WELL_CELLS, RANGE_FILTERED } );
Expand All @@ -592,7 +604,16 @@ void RimGridView::appendIntersectionsToModel( bool cellFiltersActive, bool prope
// appendPartsToModel() after appendDynamicPartsToModel()
m_intersectionCollection->appendPartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );
}

if ( addStaticModel )
{
nativeOrOverrideViewer()->addStaticModelOnce( m_intersectionVizModel.p(), isUsingOverrideViewer() );
}
else
{
nativeOrOverrideViewer()->removeStaticModel( m_intersectionVizModel.p() );
}

m_intersectionVizModel->updateBoundingBoxesRecursive();
nativeOrOverrideViewer()->addStaticModelOnce( m_intersectionVizModel.p(), isUsingOverrideViewer() );
}
}

0 comments on commit a870fce

Please sign in to comment.