#5377 Deeper : Add preference for visibility of faults when creating a new view

This commit is contained in:
Magne Sjaastad 2020-01-25 12:04:16 +01:00
parent 26a96f8e41
commit 4b04e58607
3 changed files with 22 additions and 2 deletions

View File

@ -237,6 +237,9 @@ RiaPreferences::RiaPreferences( void )
CAF_PDM_InitField( &m_showLegendBackground, "showLegendBackground", true, "Show Box around Legends", "", "", "" ); CAF_PDM_InitField( &m_showLegendBackground, "showLegendBackground", true, "Show Box around Legends", "", "", "" );
m_showLegendBackground.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); m_showLegendBackground.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
CAF_PDM_InitField( &m_enableFaultsByDefault, "enableFaultsByDefault", true, "Enable Faults By Default", "", "", "" );
m_enableFaultsByDefault.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
CAF_PDM_InitFieldNoDefault( &lastUsedProjectFileName, "lastUsedProjectFileName", "Last Used Project File", "", "", "" ); CAF_PDM_InitFieldNoDefault( &lastUsedProjectFileName, "lastUsedProjectFileName", "Last Used Project File", "", "", "" );
lastUsedProjectFileName.uiCapability()->setUiHidden( true ); lastUsedProjectFileName.uiCapability()->setUiHidden( true );
@ -435,7 +438,8 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field,
field == &showLasCurveWithoutTvdWarning || field == &holoLensDisableCertificateVerification || field == &showLasCurveWithoutTvdWarning || field == &holoLensDisableCertificateVerification ||
field == &m_showProjectChangedDialog || field == &m_searchPlotTemplateFoldersRecursively || field == &m_showProjectChangedDialog || field == &m_searchPlotTemplateFoldersRecursively ||
field == &m_showLegendBackground || field == &m_showSummaryTimeAsLongString || field == &m_showLegendBackground || field == &m_showSummaryTimeAsLongString ||
field == &m_showViewIdInProjectTree || field == &m_useMultipleThreadsWhenLoadingSummaryData ) field == &m_showViewIdInProjectTree || field == &m_useMultipleThreadsWhenLoadingSummaryData ||
field == &m_enableFaultsByDefault )
{ {
caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>( attribute ); caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>( attribute );
if ( myAttr ) if ( myAttr )
@ -483,6 +487,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
viewsGroup->add( &m_navigationPolicy ); viewsGroup->add( &m_navigationPolicy );
viewsGroup->add( &m_defaultScaleFactorZ ); viewsGroup->add( &m_defaultScaleFactorZ );
viewsGroup->add( &m_showLegendBackground ); viewsGroup->add( &m_showLegendBackground );
viewsGroup->add( &m_enableFaultsByDefault );
caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup( "Other" ); caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup( "Other" );
otherGroup->add( &ssihubAddress ); otherGroup->add( &ssihubAddress );
@ -1027,3 +1032,11 @@ bool RiaPreferences::showLegendBackground() const
{ {
return m_showLegendBackground(); return m_showLegendBackground();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences::enableFaultsByDefault() const
{
return m_enableFaultsByDefault;
}

View File

@ -71,6 +71,8 @@ public:
typedef caf::AppEnum<QPageSize::PageSizeId> PageSizeEnum; typedef caf::AppEnum<QPageSize::PageSizeId> PageSizeEnum;
typedef caf::AppEnum<QPageLayout::Orientation> PageOrientationEnum; typedef caf::AppEnum<QPageLayout::Orientation> PageOrientationEnum;
bool enableFaultsByDefault() const;
public: public:
RiaPreferences( void ); RiaPreferences( void );
~RiaPreferences( void ) override; ~RiaPreferences( void ) override;
@ -212,6 +214,7 @@ private:
caf::PdmField<caf::AppEnum<RiaGuiApplication::RINavigationPolicy>> m_navigationPolicy; caf::PdmField<caf::AppEnum<RiaGuiApplication::RINavigationPolicy>> m_navigationPolicy;
caf::PdmField<int> m_defaultScaleFactorZ; caf::PdmField<int> m_defaultScaleFactorZ;
caf::PdmField<bool> m_showLegendBackground; caf::PdmField<bool> m_showLegendBackground;
caf::PdmField<bool> m_enableFaultsByDefault;
QStringList m_tabNames; QStringList m_tabNames;

View File

@ -48,6 +48,7 @@
#include "RimEclipsePropertyFilterCollection.h" #include "RimEclipsePropertyFilterCollection.h"
#include "RimEclipseStatisticsCase.h" #include "RimEclipseStatisticsCase.h"
#include "RimEclipseView.h" #include "RimEclipseView.h"
#include "RimFaultInViewCollection.h"
#include "RimFormationNames.h" #include "RimFormationNames.h"
#include "RimGridCollection.h" #include "RimGridCollection.h"
#include "RimIntersectionCollection.h" #include "RimIntersectionCollection.h"
@ -288,11 +289,14 @@ RimEclipseView* RimEclipseCase::createAndAddReservoirView()
{ {
rimEclipseView->cellResult()->setResultType( RiaDefines::DYNAMIC_NATIVE ); rimEclipseView->cellResult()->setResultType( RiaDefines::DYNAMIC_NATIVE );
if ( RiaApplication::instance()->preferences()->loadAndShowSoil ) auto prefs = RiaApplication::instance()->preferences();
if ( prefs->loadAndShowSoil )
{ {
rimEclipseView->cellResult()->setResultVariable( "SOIL" ); rimEclipseView->cellResult()->setResultVariable( "SOIL" );
} }
rimEclipseView->faultCollection()->showFaultCollection = prefs->enableFaultsByDefault();
rimEclipseView->hasUserRequestedAnimation = true; rimEclipseView->hasUserRequestedAnimation = true;
rimEclipseView->cellEdgeResult()->setResultVariable( "MULT" ); rimEclipseView->cellEdgeResult()->setResultVariable( "MULT" );