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:
jonjenssen
2023-06-05 07:33:04 +02:00
committed by GitHub
parent 576156763a
commit 17f09878d2
36 changed files with 562 additions and 240 deletions

View File

@@ -267,7 +267,7 @@ void RimBoxIntersection::appendManipulatorPartsToModel( cvf::ModelBasicList* mod
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimBoxIntersection::rebuildGeometry()
void RimBoxIntersection::clearGeometry()
{
m_intersectionBoxPartMgr = nullptr;
}

View File

@@ -73,7 +73,7 @@ public:
RivBoxIntersectionPartMgr* intersectionBoxPartMgr();
void appendManipulatorPartsToModel( cvf::ModelBasicList* model );
void rebuildGeometry();
void clearGeometry();
void setToDefaultSizeBox();
void setToDefaultSizeSlice( SinglePlaneState plane, const cvf::Vec3d& position );

View File

@@ -844,7 +844,7 @@ RivExtrudedCurveIntersectionPartMgr* RimExtrudedCurveIntersection::intersectionP
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimExtrudedCurveIntersection::rebuildGeometry()
void RimExtrudedCurveIntersection::clearGeometry()
{
m_crossSectionPartMgr = nullptr;
}

View File

@@ -109,7 +109,7 @@ public:
Rim2dIntersectionView* correspondingIntersectionView() const;
RivExtrudedCurveIntersectionPartMgr* intersectionPartMgr();
void rebuildGeometry();
void clearGeometry();
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override;
std::vector<cvf::Vec3d> polyLinesForExtrusionDirection() const;

View File

@@ -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();
}

View File

@@ -23,6 +23,8 @@
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cvfArray.h"
#include "RimIntersectionEnums.h"
class Rim3dView;
@@ -53,8 +55,6 @@ public:
RimIntersectionCollection();
~RimIntersectionCollection() override;
caf::PdmField<bool> isActive;
void appendIntersectionAndUpdate( RimExtrudedCurveIntersection* intersection, bool allowActiveViewChange = true );
void appendIntersectionNoUpdate( RimExtrudedCurveIntersection* intersection );
@@ -70,12 +70,18 @@ public:
void scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
void recomputeSimWellBranchData();
bool shouldApplyCellFiltersToIntersections() const;
// Visualization interface
void applySingleColorEffect();
void updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex );
void appendPartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
void rebuildGeometry();
void appendDynamicPartsToModel( cvf::ModelBasicList* model,
cvf::Transform* scaleTransform,
size_t timeStepIndex,
cvf::UByteArray* visibleCells = nullptr );
void clearGeometry();
std::vector<RimExtrudedCurveIntersection*> intersections() const;
std::vector<RimBoxIntersection*> intersectionBoxes() const;
@@ -84,6 +90,8 @@ public:
void onChildAdded( caf::PdmFieldHandle* containerForNewObject ) override;
bool isActive() const;
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
caf::PdmFieldHandle* objectToggleField() override;
@@ -96,6 +104,8 @@ private:
RimEclipseView* eclipseView() const;
void rebuild3dView() const;
caf::PdmField<bool> m_isActive;
caf::PdmChildArrayField<RimExtrudedCurveIntersection*> m_intersections;
caf::PdmChildArrayField<RimBoxIntersection*> m_intersectionBoxes;
@@ -104,6 +114,8 @@ private:
caf::PdmField<double> m_depthLowerThreshold;
caf::PdmField<caf::AppEnum<RimIntersectionFilterEnum>> m_depthFilterType;
caf::PdmField<bool> m_applyCellFilters;
caf::PdmField<bool> m_kFilterOverridden;
caf::PdmField<QString> m_kFilterStr;
};