2013-12-03 13:30:32 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-24 00:14:52 -05:00
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2013-12-03 13:30:32 -06:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2013-12-03 13:30:32 -06:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2013-12-03 13:30:32 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-10-15 14:20:03 -05:00
|
|
|
#include "RimFaultInViewCollection.h"
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2017-02-10 01:36:32 -06:00
|
|
|
#include "RiaColorTables.h"
|
2021-01-21 05:58:46 -06:00
|
|
|
#include "RiaDefines.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RiaPreferences.h"
|
2021-01-21 05:58:46 -06:00
|
|
|
#include "RiaResultNames.h"
|
2016-07-16 09:31:55 -05:00
|
|
|
|
2017-01-09 12:04:45 -06:00
|
|
|
#include "RigMainGrid.h"
|
2016-07-16 09:31:55 -05:00
|
|
|
|
2015-05-15 02:16:33 -05:00
|
|
|
#include "RimEclipseCase.h"
|
2021-10-05 07:28:00 -05:00
|
|
|
#include "RimEclipseFaultColors.h"
|
2021-05-18 07:28:54 -05:00
|
|
|
#include "RimEclipseInputCase.h"
|
2016-07-16 09:31:55 -05:00
|
|
|
#include "RimEclipseView.h"
|
2017-10-13 08:01:52 -05:00
|
|
|
#include "RimFaultInView.h"
|
2018-05-07 11:06:09 -05:00
|
|
|
#include "RimIntersectionCollection.h"
|
2016-07-16 09:31:55 -05:00
|
|
|
|
2014-01-23 00:31:07 -06:00
|
|
|
#include "RiuMainWindow.h"
|
2016-07-16 09:31:55 -05:00
|
|
|
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "cafAppEnum.h"
|
|
|
|
#include "cafPdmFieldCvfColor.h"
|
|
|
|
#include "cafPdmFieldCvfMat4d.h"
|
2021-12-17 08:39:22 -06:00
|
|
|
#include "cafPdmUiCheckBoxEditor.h"
|
2021-05-18 07:28:54 -05:00
|
|
|
#include "cafPdmUiTreeOrdering.h"
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2013-12-18 01:57:22 -06:00
|
|
|
namespace caf
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
template <>
|
|
|
|
void AppEnum<RimFaultInViewCollection::FaultFaceCullingMode>::setUp()
|
|
|
|
{
|
|
|
|
addItem( RimFaultInViewCollection::FAULT_BACK_FACE_CULLING, "FAULT_BACK_FACE_CULLING", "Cell behind fault" );
|
|
|
|
addItem( RimFaultInViewCollection::FAULT_FRONT_FACE_CULLING, "FAULT_FRONT_FACE_CULLING", "Cell in front of fault" );
|
|
|
|
addItem( RimFaultInViewCollection::FAULT_NO_FACE_CULLING, "FAULT_NO_FACE_CULLING", "Show both" );
|
|
|
|
setDefault( RimFaultInViewCollection::FAULT_NO_FACE_CULLING );
|
2013-12-18 01:57:22 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
} // namespace caf
|
2013-12-18 01:57:22 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimFaultInViewCollection, "Faults" );
|
2013-12-03 13:30:32 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-15 14:20:03 -05:00
|
|
|
RimFaultInViewCollection::RimFaultInViewCollection()
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
2022-01-07 01:31:52 -06:00
|
|
|
CAF_PDM_InitObject( "Faults", ":/draw_style_faults_24x24.png" );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &showFaultCollection, "Active", true, "Active" );
|
2019-09-06 03:40:57 -05:00
|
|
|
showFaultCollection.uiCapability()->setUiHidden( true );
|
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &showFaultFaces, "ShowFaultFaces", true, "Show Defined faces" );
|
2021-12-17 08:39:22 -06:00
|
|
|
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showFaultFaces );
|
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &showOppositeFaultFaces, "ShowOppositeFaultFaces", true, "Show Opposite Faces" );
|
2021-12-17 08:39:22 -06:00
|
|
|
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showOppositeFaultFaces );
|
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &m_showFaultsOutsideFilters, "ShowFaultsOutsideFilters", true, "Show Faults Outside Filters" );
|
2021-12-17 08:39:22 -06:00
|
|
|
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showFaultsOutsideFilters );
|
|
|
|
|
2022-01-14 09:44:00 -06:00
|
|
|
CAF_PDM_InitField( &m_onlyShowWithNeighbor, "OnlyShowWithDefNeighbor", false, "Show Only Faces with Juxtaposition" );
|
2021-12-17 08:39:22 -06:00
|
|
|
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_onlyShowWithNeighbor );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
CAF_PDM_InitField( &faultResult,
|
|
|
|
"FaultFaceCulling",
|
2023-02-26 03:48:40 -06:00
|
|
|
caf::AppEnum<RimFaultInViewCollection::FaultFaceCullingMode>( RimFaultInViewCollection::FAULT_BACK_FACE_CULLING ),
|
2021-12-17 08:39:22 -06:00
|
|
|
"Dynamic Face Selection" );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &showFaultLabel, "ShowFaultLabel", false, "Show Labels" );
|
2021-12-17 08:39:22 -06:00
|
|
|
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showFaultLabel );
|
|
|
|
|
2021-04-28 03:29:53 -05:00
|
|
|
cvf::Color3f defWellLabelColor = RiaPreferences::current()->defaultWellLabelColor();
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &faultLabelColor, "FaultLabelColor", defWellLabelColor, "Label Color" );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &showNNCs, "ShowNNCs", true, "Show NNCs" );
|
2021-12-17 08:39:22 -06:00
|
|
|
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showNNCs );
|
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
CAF_PDM_InitField( &hideNncsWhenNoResultIsAvailable, "HideNncsWhenNoResultIsAvailable", true, "Hide NNC Geometry if No NNC Result is Available" );
|
2021-12-17 08:39:22 -06:00
|
|
|
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &hideNncsWhenNoResultIsAvailable );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &faults, "Faults", "Faults" );
|
2021-10-13 06:39:46 -05:00
|
|
|
faults.uiCapability()->setUiTreeHidden( true );
|
2013-12-03 13:30:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-15 14:20:03 -05:00
|
|
|
RimFaultInViewCollection::~RimFaultInViewCollection()
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
2022-05-31 06:08:07 -05:00
|
|
|
faults.deleteChildren();
|
2013-12-03 13:30:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
void RimFaultInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
2014-08-01 06:35:52 -05:00
|
|
|
this->updateUiIconFromToggleField();
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
if ( &faultLabelColor == changedField )
|
2013-12-10 00:43:17 -06:00
|
|
|
{
|
2018-09-14 02:30:05 -05:00
|
|
|
parentView()->scheduleReservoirGridGeometryRegen();
|
2019-11-26 05:30:44 -06:00
|
|
|
parentView()->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
2013-12-10 00:43:17 -06:00
|
|
|
}
|
|
|
|
|
2021-12-17 08:39:22 -06:00
|
|
|
if ( changedField == &m_onlyShowWithNeighbor )
|
|
|
|
{
|
|
|
|
parentView()->scheduleReservoirGridGeometryRegen();
|
|
|
|
}
|
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
if ( &showFaultFaces == changedField || &showOppositeFaultFaces == changedField || &showFaultCollection == changedField ||
|
|
|
|
&showFaultLabel == changedField || &m_showFaultsOutsideFilters == changedField || &faultLabelColor == changedField ||
|
2021-12-17 08:39:22 -06:00
|
|
|
&m_onlyShowWithNeighbor == changedField || &faultResult == changedField || &showNNCs == changedField ||
|
|
|
|
&hideNncsWhenNoResultIsAvailable == changedField )
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
2018-09-14 02:30:05 -05:00
|
|
|
parentView()->scheduleCreateDisplayModelAndRedraw();
|
2019-11-26 05:30:44 -06:00
|
|
|
parentView()->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
2013-12-03 13:30:32 -06:00
|
|
|
}
|
2014-01-23 00:31:07 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( &showFaultLabel == changedField )
|
2014-01-23 00:31:07 -06:00
|
|
|
{
|
|
|
|
RiuMainWindow::instance()->refreshDrawStyleActions();
|
|
|
|
}
|
2013-12-03 13:30:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-15 14:20:03 -05:00
|
|
|
caf::PdmFieldHandle* RimFaultInViewCollection::objectToggleField()
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
return &showFaultCollection;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimFaultInView* RimFaultInViewCollection::findFaultByName( QString name )
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 0; i < this->faults().size(); ++i )
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( this->faults()[i]->name() == name )
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
return this->faults()[i];
|
|
|
|
}
|
|
|
|
}
|
2018-02-18 11:56:43 -06:00
|
|
|
return nullptr;
|
2013-12-03 13:30:32 -06:00
|
|
|
}
|
|
|
|
|
2013-12-05 03:48:57 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
/// A comparing function used to sort Faults in the RimFaultCollection::syncronizeFaults() method
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool faultComparator( const cvf::ref<RigFault>& a, const cvf::ref<RigFault>& b )
|
2013-12-05 03:48:57 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_TIGHT_ASSERT( a.notNull() && b.notNull() );
|
2013-12-05 03:48:57 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
int compareValue = a->name().compare( b->name(), Qt::CaseInsensitive );
|
2014-01-22 07:05:20 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
return ( compareValue < 0 );
|
2013-12-05 03:48:57 -06:00
|
|
|
}
|
2013-12-05 02:59:05 -06:00
|
|
|
|
2013-12-04 05:13:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-04 05:13:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-15 14:20:03 -05:00
|
|
|
void RimFaultInViewCollection::syncronizeFaults()
|
2013-12-04 05:13:01 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !( parentView() && parentView()->mainGrid() ) ) return;
|
2013-12-04 05:13:01 -06:00
|
|
|
|
2017-02-10 01:36:32 -06:00
|
|
|
const caf::ColorTable& colorTable = RiaColorTables::faultsPaletteColors();
|
2013-12-04 05:13:01 -06:00
|
|
|
|
2018-09-14 02:30:05 -05:00
|
|
|
const cvf::Collection<RigFault> constRigFaults = parentView()->mainGrid()->faults();
|
2013-12-05 02:59:05 -06:00
|
|
|
|
2014-01-22 07:05:20 -06:00
|
|
|
cvf::Collection<RigFault> rigFaults;
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::Collection<RigFault> sortedFaults( constRigFaults );
|
2013-12-05 02:59:05 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::sort( sortedFaults.begin(), sortedFaults.end(), faultComparator );
|
2014-01-22 07:05:20 -06:00
|
|
|
|
|
|
|
cvf::ref<RigFault> undefinedFaults;
|
2016-08-22 06:24:46 -05:00
|
|
|
cvf::ref<RigFault> undefinedFaultsWInactive;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 0; i < sortedFaults.size(); i++ )
|
2014-01-22 07:05:20 -06:00
|
|
|
{
|
2016-08-22 06:24:46 -05:00
|
|
|
QString faultName = sortedFaults[i]->name();
|
2021-01-21 05:58:46 -06:00
|
|
|
if ( faultName.compare( RiaResultNames::undefinedGridFaultName(), Qt::CaseInsensitive ) == 0 )
|
2014-01-22 07:05:20 -06:00
|
|
|
{
|
|
|
|
undefinedFaults = sortedFaults[i];
|
|
|
|
}
|
2016-08-22 06:24:46 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
if ( faultName.startsWith( RiaResultNames::undefinedGridFaultName(), Qt::CaseInsensitive ) && faultName.contains( "Inactive" ) )
|
2016-08-22 06:24:46 -05:00
|
|
|
{
|
|
|
|
undefinedFaultsWInactive = sortedFaults[i];
|
|
|
|
}
|
2014-01-22 07:05:20 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( undefinedFaults.notNull() )
|
2014-01-22 07:05:20 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
sortedFaults.erase( undefinedFaults.p() );
|
|
|
|
rigFaults.push_back( undefinedFaults.p() );
|
2014-01-22 07:05:20 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( undefinedFaultsWInactive.notNull() )
|
2016-08-22 06:24:46 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
sortedFaults.erase( undefinedFaultsWInactive.p() );
|
|
|
|
rigFaults.push_back( undefinedFaultsWInactive.p() );
|
2016-08-22 06:24:46 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 0; i < sortedFaults.size(); i++ )
|
2014-01-22 07:05:20 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
rigFaults.push_back( sortedFaults[i].p() );
|
2014-01-22 07:05:20 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<caf::PdmPointer<RimFaultInView>> newFaults;
|
2013-12-04 05:13:01 -06:00
|
|
|
|
|
|
|
// Find corresponding fault from data model, or create a new
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t fIdx = 0; fIdx < rigFaults.size(); ++fIdx )
|
2013-12-04 05:13:01 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimFaultInView* rimFault = this->findFaultByName( rigFaults[fIdx]->name() );
|
2013-12-04 05:13:01 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !rimFault )
|
2013-12-04 05:13:01 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
rimFault = new RimFaultInView();
|
|
|
|
rimFault->faultColor = colorTable.cycledColor3f( fIdx );
|
|
|
|
QString faultName = rigFaults[fIdx]->name();
|
2016-09-16 05:04:20 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
if ( faultName.startsWith( RiaResultNames::undefinedGridFaultName(), Qt::CaseInsensitive ) && faultName.contains( "Inactive" ) )
|
2016-09-16 05:04:20 -05:00
|
|
|
{
|
|
|
|
rimFault->showFault = false; // Turn fault against inactive cells off by default
|
|
|
|
}
|
2013-12-04 05:13:01 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
rimFault->setFaultGeometry( rigFaults[fIdx].p() );
|
2013-12-04 05:13:01 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
newFaults.push_back( rimFault );
|
2013-12-04 05:13:01 -06:00
|
|
|
}
|
|
|
|
|
2022-05-31 06:08:07 -05:00
|
|
|
this->faults().clearWithoutDelete();
|
2019-09-06 03:40:57 -05:00
|
|
|
this->faults().insert( 0, newFaults );
|
2014-01-03 02:40:39 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QString toolTip = QString( "Fault count (%1)" ).arg( newFaults.size() );
|
|
|
|
setUiToolTip( toolTip );
|
2013-12-04 05:13:01 -06:00
|
|
|
}
|
|
|
|
|
2013-12-18 02:26:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-18 02:26:06 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-15 14:20:03 -05:00
|
|
|
bool RimFaultInViewCollection::isGridVisualizationMode() const
|
2013-12-18 02:26:06 -06:00
|
|
|
{
|
2018-09-14 02:30:05 -05:00
|
|
|
return parentView()->isGridVisualizationMode();
|
2013-12-18 02:26:06 -06:00
|
|
|
}
|
2014-01-03 01:38:09 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2014-01-03 01:38:09 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-01-29 07:50:41 -06:00
|
|
|
void RimFaultInViewCollection::uiOrderingFaults( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2014-01-03 01:38:09 -06:00
|
|
|
{
|
|
|
|
bool isGridVizMode = isGridVisualizationMode();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
faultResult.uiCapability()->setUiReadOnly( isGridVizMode );
|
|
|
|
showFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode );
|
|
|
|
showOppositeFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode );
|
2014-01-03 06:42:33 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* ffviz = uiOrdering.addNewGroup( "Fault Face Visibility" );
|
2022-08-19 07:18:36 -05:00
|
|
|
ffviz->setCollapsedByDefault();
|
2019-09-06 03:40:57 -05:00
|
|
|
ffviz->add( &showFaultFaces );
|
|
|
|
ffviz->add( &showOppositeFaultFaces );
|
|
|
|
ffviz->add( &faultResult );
|
2021-12-17 08:39:22 -06:00
|
|
|
ffviz->add( &m_onlyShowWithNeighbor );
|
2014-09-09 06:07:01 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* nncViz = uiOrdering.addNewGroup( "NNC Visibility" );
|
2022-08-19 07:18:36 -05:00
|
|
|
nncViz->setCollapsedByDefault();
|
2019-09-06 03:40:57 -05:00
|
|
|
nncViz->add( &showNNCs );
|
|
|
|
nncViz->add( &hideNncsWhenNoResultIsAvailable );
|
2014-01-03 01:38:09 -06:00
|
|
|
}
|
|
|
|
|
2018-09-14 02:30:05 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-01-29 07:50:41 -06:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFaultInViewCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
|
|
|
{
|
|
|
|
caf::PdmUiGroup* labs = uiOrdering.addNewGroup( "Fault Labels" );
|
|
|
|
labs->add( &showFaultLabel );
|
|
|
|
labs->add( &faultLabelColor );
|
|
|
|
|
|
|
|
caf::PdmUiGroup* adv = uiOrdering.addNewGroup( "Fault Options" );
|
|
|
|
adv->add( &m_showFaultsOutsideFilters );
|
|
|
|
|
|
|
|
uiOrderingFaults( uiConfigName, uiOrdering );
|
|
|
|
}
|
|
|
|
|
2021-05-18 07:28:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFaultInViewCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName )
|
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
auto eclipseView = firstAncestorOfType<RimEclipseView>();
|
2021-10-05 07:28:00 -05:00
|
|
|
if ( eclipseView )
|
|
|
|
{
|
|
|
|
auto uiTree = eclipseView->faultResultSettings()->uiTreeOrdering();
|
|
|
|
uiTreeOrdering.appendChild( uiTree );
|
|
|
|
}
|
2021-10-25 11:06:38 -05:00
|
|
|
|
|
|
|
for ( const auto& fault : faults )
|
|
|
|
{
|
|
|
|
uiTreeOrdering.add( fault );
|
|
|
|
}
|
|
|
|
|
|
|
|
uiTreeOrdering.skipRemainingChildren( true );
|
2021-05-18 07:28:54 -05:00
|
|
|
}
|
|
|
|
|
2020-01-29 07:50:41 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-09-14 02:30:05 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimEclipseView* RimFaultInViewCollection::parentView() const
|
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
return firstAncestorOrThisOfTypeAsserted<RimEclipseView>();
|
2018-09-14 02:30:05 -05:00
|
|
|
}
|
|
|
|
|
2014-08-01 07:48:37 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2014-08-01 07:48:37 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-04-04 15:34:41 -05:00
|
|
|
bool RimFaultInViewCollection::isShowingFaultsAndFaultsOutsideFilters() const
|
2014-08-01 07:48:37 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !showFaultCollection ) return false;
|
2014-08-01 07:48:37 -05:00
|
|
|
|
|
|
|
return m_showFaultsOutsideFilters;
|
|
|
|
}
|
|
|
|
|
2018-11-19 01:28:45 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimFaultInViewCollection::setShowFaultsOutsideFilter( bool show )
|
2018-11-19 01:28:45 -06:00
|
|
|
{
|
|
|
|
m_showFaultsOutsideFilters = show;
|
|
|
|
}
|
2021-05-18 07:28:54 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-12-17 08:39:22 -06:00
|
|
|
bool RimFaultInViewCollection::onlyShowFacesWithDefinedNeighbor() const
|
|
|
|
{
|
|
|
|
return m_onlyShowWithNeighbor;
|
|
|
|
}
|