mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05:00
#14198 Exclude ResInsight-generated faults from default fault distance selection
When a new Fault Distance defaults to all faults, the ResInsight-generated undefined grid faults were ticked by default. Add RimFaultInView::isGeneratedFault and filter these faults out of the default selection in both the UI feature and the Python command. An explicit fault selection is still honored.
This commit is contained in:
1 parent
5b6658f099
commit
b274641e0c
4 files changed
+23
-2
No files matched your search
@@ -97,7 +97,10 @@ void RicNewFaultDistanceResultFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
else if ( eclipseView->faultCollection() )
|
||||
{
|
||||
newResult->setSelectedFaults( eclipseView->faultCollection()->faults() );
|
||||
// Default to all faults, but leave the ResInsight-generated faults unticked.
|
||||
std::vector<RimFaultInView*> defaultFaults = eclipseView->faultCollection()->faults();
|
||||
std::erase_if( defaultFaults, []( RimFaultInView* fault ) { return fault && fault->isGeneratedFault(); } );
|
||||
newResult->setSelectedFaults( defaultFaults );
|
||||
}
|
||||
|
||||
eclipseView->updateConnectedEditors();
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "RimFaultInView.h"
|
||||
|
||||
#include "RiaResultNames.h"
|
||||
|
||||
#include "RigFault.h"
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
@@ -121,6 +123,15 @@ const RigFault* RimFaultInView::faultGeometry() const
|
||||
return m_rigFault;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// True for the faults synthesized by ResInsight (undefined grid faults), as opposed to faults
|
||||
/// imported from the Eclipse model.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFaultInView::isGeneratedFault() const
|
||||
{
|
||||
return name() == RiaResultNames::undefinedGridFaultName() || name() == RiaResultNames::undefinedGridFaultWithInactiveName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -48,6 +48,8 @@ public:
|
||||
void setFaultGeometry( const RigFault* faultGeometry );
|
||||
const RigFault* faultGeometry() const;
|
||||
|
||||
bool isGeneratedFault() const;
|
||||
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
|
||||
@@ -58,7 +58,12 @@ std::expected<caf::PdmObjectHandle*, QString> RimcEclipseView_addFaultDistance::
|
||||
if ( !m_resultName().isEmpty() ) newResult->setResultName( m_resultName() );
|
||||
|
||||
std::vector<RimFaultInView*> selected = m_faults.ptrReferencedObjectsByType();
|
||||
if ( selected.empty() && eclipseView->faultCollection() ) selected = eclipseView->faultCollection()->faults();
|
||||
if ( selected.empty() && eclipseView->faultCollection() )
|
||||
{
|
||||
// Default to all faults, but leave the ResInsight-generated faults unticked.
|
||||
selected = eclipseView->faultCollection()->faults();
|
||||
std::erase_if( selected, []( RimFaultInView* fault ) { return fault && fault->isGeneratedFault(); } );
|
||||
}
|
||||
|
||||
newResult->setSelectedFaults( selected );
|
||||
|
||||
|
||||
Reference in new issue
Block a user