mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-01 03:37:15 -06:00
Refresh cell filters when geomech grid is reloaded (#10924)
* Make sure the cell filters are refreshed when the geomech grid is reloaded to handle grid changes
This commit is contained in:
parent
0a2f2da8b9
commit
ea56ceaea0
@ -91,6 +91,7 @@ public:
|
||||
virtual void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter, int gridIndex ){};
|
||||
virtual void updateCellIndexFilter( cvf::UByteArray* includeVisibility, cvf::UByteArray* excludeVisibility, int gridIndex ){};
|
||||
virtual QString fullName() const;
|
||||
virtual void onGridChanged(){};
|
||||
|
||||
protected:
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
@ -384,6 +384,17 @@ void RimCellFilterCollection::removeFilter( RimCellFilter* filter )
|
||||
m_cellFilters.removeChild( filter );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCellFilterCollection::notifyGridReload()
|
||||
{
|
||||
for ( RimCellFilter* filter : m_cellFilters )
|
||||
{
|
||||
filter->onGridChanged();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -59,6 +59,7 @@ public:
|
||||
RimUserDefinedIndexFilter* addNewUserDefinedIndexFilter( RimCase* srcCase, const std::vector<size_t>& defCellIndexes = {} );
|
||||
|
||||
void removeFilter( RimCellFilter* filter );
|
||||
void notifyGridReload();
|
||||
|
||||
bool isEmpty() const;
|
||||
bool isActive() const;
|
||||
|
@ -176,3 +176,11 @@ void RimCellIndexFilter::updateCells()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCellIndexFilter::onGridChanged()
|
||||
{
|
||||
m_cells.clear();
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ public:
|
||||
|
||||
void updateCellIndexFilter( cvf::UByteArray* includeVisibility, cvf::UByteArray* excludeVisibility, int gridIndex ) override;
|
||||
|
||||
void onGridChanged() override;
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
@ -452,6 +452,14 @@ caf::PickEventHandler* RimPolygonFilter::pickEventHandler() const
|
||||
return m_pickTargetsEventHandler.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPolygonFilter::onGridChanged()
|
||||
{
|
||||
m_cells.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -89,6 +89,7 @@ public:
|
||||
caf::PickEventHandler* pickEventHandler() const override;
|
||||
|
||||
void updateCellIndexFilter( cvf::UByteArray* includeVisibility, cvf::UByteArray* excludeVisibility, int gridIndex ) override;
|
||||
void onGridChanged() override;
|
||||
|
||||
cvf::ref<RigPolyLinesData> polyLinesData() const override;
|
||||
|
||||
|
@ -101,10 +101,13 @@ void RimUserDefinedIndexFilter::updateCellIndexFilter( cvf::UByteArray* includeV
|
||||
{
|
||||
if ( gridIndex != m_gridIndex() ) return;
|
||||
|
||||
const auto filterSize = (int)includeVisibility->size();
|
||||
|
||||
if ( m_filterMode == FilterModeType::INCLUDE )
|
||||
{
|
||||
for ( auto cellIdx : m_individualCellIndexes() )
|
||||
{
|
||||
if ( cellIdx >= filterSize ) continue;
|
||||
( *includeVisibility )[cellIdx] = true;
|
||||
}
|
||||
}
|
||||
@ -112,6 +115,7 @@ void RimUserDefinedIndexFilter::updateCellIndexFilter( cvf::UByteArray* includeV
|
||||
{
|
||||
for ( auto cellIdx : m_individualCellIndexes() )
|
||||
{
|
||||
if ( cellIdx >= filterSize ) continue;
|
||||
( *excludeVisibility )[cellIdx] = false;
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "RigGeoMechCaseData.h"
|
||||
|
||||
#include "Rim2dIntersectionViewCollection.h"
|
||||
#include "RimCellFilterCollection.h"
|
||||
#include "RimFormationNames.h"
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RimGeoMechContourMapView.h"
|
||||
@ -216,6 +217,7 @@ void RimGeoMechCase::reloadDataAndUpdate()
|
||||
{
|
||||
v->resetVizLogic();
|
||||
v->loadDataAndUpdate();
|
||||
v->cellFilterCollection()->notifyGridReload();
|
||||
v->setCurrentTimeStep( v->currentTimeStep() );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user