mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Enable filters for curve intersections (#10329)
* Enable cell filters * Enable property filters * Clean up fault collection interface and use similar setting for controlling filters as in intersection collection * Enable cell/property filters on geomech intersections * Enable cell and property filters for box intersections
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include "cvfModelBasicList.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimIntersectionCollection, "IntersectionCollection", "CrossSectionCollection" );
|
||||
@@ -59,8 +60,8 @@ RimIntersectionCollection::RimIntersectionCollection()
|
||||
CAF_PDM_InitFieldNoDefault( &m_intersectionBoxes, "IntersectionBoxes", "IntersectionBoxes" );
|
||||
m_intersectionBoxes.uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &isActive, "Active", true, "Active" );
|
||||
isActive.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitField( &m_isActive, "Active", true, "Active" );
|
||||
m_isActive.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_depthUpperThreshold, "UpperDepthThreshold", "Upper Threshold" );
|
||||
m_depthUpperThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
@@ -75,6 +76,8 @@ RimIntersectionCollection::RimIntersectionCollection()
|
||||
CAF_PDM_InitField( &m_kFilterOverridden, "OverrideKFilter", false, "Override K Range Filter" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_kFilterStr, "KRangeFilter", "K Range Filter", "", "Example: 2,4-6,10-30:2", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_applyCellFilters, "ApplyCellFilters", true, "Use Cell Filters" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -91,7 +94,15 @@ RimIntersectionCollection::~RimIntersectionCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimIntersectionCollection::objectToggleField()
|
||||
{
|
||||
return &isActive;
|
||||
return &m_isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimIntersectionCollection::isActive() const
|
||||
{
|
||||
return m_isActive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -209,9 +220,36 @@ void RimIntersectionCollection::appendPartsToModel( Rim3dView& view, cvf::ModelB
|
||||
{
|
||||
if ( cs->isActive() )
|
||||
{
|
||||
cs->intersectionPartMgr()->appendPolylinePartsToModel( view, model, scaleTransform );
|
||||
}
|
||||
}
|
||||
|
||||
for ( RimBoxIntersection* cs : m_intersectionBoxes )
|
||||
{
|
||||
if ( cs->isActive() && cs->show3dManipulator() )
|
||||
{
|
||||
cs->appendManipulatorPartsToModel( model );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionCollection::appendDynamicPartsToModel( cvf::ModelBasicList* model,
|
||||
cvf::Transform* scaleTransform,
|
||||
size_t timeStepIndex,
|
||||
cvf::UByteArray* visibleCells )
|
||||
{
|
||||
if ( !isActive() ) return;
|
||||
|
||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||
{
|
||||
if ( cs->isActive() )
|
||||
{
|
||||
cs->intersectionPartMgr()->generatePartGeometry( visibleCells );
|
||||
cs->intersectionPartMgr()->appendIntersectionFacesToModel( model, scaleTransform );
|
||||
cs->intersectionPartMgr()->appendMeshLinePartsToModel( model, scaleTransform );
|
||||
cs->intersectionPartMgr()->appendPolylinePartsToModel( view, model, scaleTransform );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,32 +257,26 @@ void RimIntersectionCollection::appendPartsToModel( Rim3dView& view, cvf::ModelB
|
||||
{
|
||||
if ( cs->isActive() )
|
||||
{
|
||||
cs->intersectionBoxPartMgr()->generatePartGeometry( visibleCells );
|
||||
cs->intersectionBoxPartMgr()->appendNativeIntersectionFacesToModel( model, scaleTransform );
|
||||
cs->intersectionBoxPartMgr()->appendMeshLinePartsToModel( model, scaleTransform );
|
||||
|
||||
if ( cs->show3dManipulator() )
|
||||
{
|
||||
cs->appendManipulatorPartsToModel( model );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
model->updateBoundingBoxesRecursive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionCollection::rebuildGeometry()
|
||||
void RimIntersectionCollection::clearGeometry()
|
||||
{
|
||||
for ( RimExtrudedCurveIntersection* intersection : m_intersections )
|
||||
{
|
||||
intersection->rebuildGeometry();
|
||||
intersection->clearGeometry();
|
||||
}
|
||||
|
||||
for ( RimBoxIntersection* intersectionBox : m_intersectionBoxes )
|
||||
{
|
||||
intersectionBox->rebuildGeometry();
|
||||
intersectionBox->clearGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,12 +386,12 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
{
|
||||
bool rebuildView = false;
|
||||
|
||||
if ( changedField == &isActive )
|
||||
if ( changedField == &m_isActive )
|
||||
{
|
||||
updateUiIconFromToggleField();
|
||||
rebuildView = true;
|
||||
}
|
||||
if ( changedField == &m_depthThresholdOverridden )
|
||||
else if ( changedField == &m_depthThresholdOverridden )
|
||||
{
|
||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||
{
|
||||
@@ -372,8 +404,8 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
}
|
||||
rebuildView = true;
|
||||
}
|
||||
|
||||
if ( ( changedField == &m_depthUpperThreshold ) || ( changedField == &m_depthLowerThreshold ) || ( changedField == &m_depthFilterType ) )
|
||||
else if ( ( changedField == &m_depthUpperThreshold ) || ( changedField == &m_depthLowerThreshold ) ||
|
||||
( changedField == &m_depthFilterType ) )
|
||||
{
|
||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||
{
|
||||
@@ -382,8 +414,7 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
}
|
||||
rebuildView = true;
|
||||
}
|
||||
|
||||
if ( changedField == &m_kFilterOverridden || changedField == &m_kFilterStr )
|
||||
else if ( changedField == &m_kFilterOverridden || changedField == &m_kFilterStr )
|
||||
{
|
||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||
{
|
||||
@@ -392,6 +423,10 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
}
|
||||
rebuildView = true;
|
||||
}
|
||||
else if ( changedField == &m_applyCellFilters )
|
||||
{
|
||||
rebuildView = true;
|
||||
}
|
||||
|
||||
if ( rebuildView )
|
||||
{
|
||||
@@ -452,7 +487,11 @@ void RimIntersectionCollection::updateIntersectionBoxGeometry()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* genGroup = uiOrdering.addNewGroup( "General" );
|
||||
genGroup->add( &m_applyCellFilters );
|
||||
|
||||
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "Depth Filter - Curve Intersections" );
|
||||
filterGroup->setCollapsedByDefault();
|
||||
|
||||
m_depthFilterType.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
|
||||
m_depthUpperThreshold.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
|
||||
@@ -486,12 +525,13 @@ void RimIntersectionCollection::defineUiOrdering( QString uiConfigName, caf::Pdm
|
||||
}
|
||||
if ( eclipseView() )
|
||||
{
|
||||
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "K Filter - Curve Intersections" );
|
||||
caf::PdmUiGroup* kfilterGroup = uiOrdering.addNewGroup( "K Filter - Curve Intersections" );
|
||||
kfilterGroup->setCollapsedByDefault();
|
||||
|
||||
m_kFilterStr.uiCapability()->setUiReadOnly( !m_kFilterOverridden() );
|
||||
|
||||
filterGroup->add( &m_kFilterOverridden );
|
||||
filterGroup->add( &m_kFilterStr );
|
||||
kfilterGroup->add( &m_kFilterOverridden );
|
||||
kfilterGroup->add( &m_kFilterStr );
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
@@ -539,3 +579,11 @@ void RimIntersectionCollection::rebuild3dView() const
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimIntersectionCollection::shouldApplyCellFiltersToIntersections() const
|
||||
{
|
||||
return m_applyCellFilters();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user