diff --git a/ApplicationCode/Application/RiaGuiApplication.cpp b/ApplicationCode/Application/RiaGuiApplication.cpp index 199da55538..250e6f2985 100644 --- a/ApplicationCode/Application/RiaGuiApplication.cpp +++ b/ApplicationCode/Application/RiaGuiApplication.cpp @@ -1579,8 +1579,8 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* oldPreference existingViewsWithCustomColors = true; } if ( m_preferences->defaultScaleFactorZ() != oldPreferences->defaultScaleFactorZ() && - rim3dView->scaleZ() != static_cast( oldPreferences->defaultScaleFactorZ ) && - rim3dView->scaleZ() != static_cast( m_preferences->defaultScaleFactorZ ) ) + rim3dView->scaleZ() != static_cast( oldPreferences->defaultScaleFactorZ() ) && + rim3dView->scaleZ() != static_cast( m_preferences->defaultScaleFactorZ() ) ) { existingViewsWithCustomZScale = true; } diff --git a/ApplicationCode/Application/RiaPreferences.cpp b/ApplicationCode/Application/RiaPreferences.cpp index 332bd754d2..4019860dad 100644 --- a/ApplicationCode/Application/RiaPreferences.cpp +++ b/ApplicationCode/Application/RiaPreferences.cpp @@ -90,7 +90,7 @@ CAF_PDM_SOURCE_INIT( RiaPreferences, "RiaPreferences" ); //-------------------------------------------------------------------------------------------------- RiaPreferences::RiaPreferences( void ) { - CAF_PDM_InitField( &navigationPolicy, + CAF_PDM_InitField( &m_navigationPolicy, "navigationPolicy", caf::AppEnum( RiaGuiApplication::NAVIGATION_POLICY_RMS ), "Navigation Mode", @@ -151,7 +151,7 @@ RiaPreferences::RiaPreferences( void ) CAF_PDM_InitField( &ssihubAddress, "ssihubAddress", QString( "http://" ), "SSIHUB Address", "", "", "" ); ssihubAddress.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP ); - CAF_PDM_InitFieldNoDefault( &defaultMeshModeType, "defaultMeshModeType", "Show Grid Lines", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_defaultMeshModeType, "defaultMeshModeType", "Show Grid Lines", "", "", "" ); CAF_PDM_InitField( &defaultGridLineColors, "defaultGridLineColors", RiaColorTables::defaultGridLineColor(), @@ -182,7 +182,7 @@ RiaPreferences::RiaPreferences( void ) "The viewer background color for new views", "" ); - CAF_PDM_InitField( &defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z Scale Factor", "", "", "" ); + CAF_PDM_InitField( &m_defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z Scale Factor", "", "", "" ); caf::AppEnum fontSize = RiaFontCache::FONT_SIZE_8; caf::AppEnum plotFontSize = RiaFontCache::FONT_SIZE_10; @@ -234,8 +234,8 @@ RiaPreferences::RiaPreferences( void ) "" ); m_includeFractureDebugInfoFile.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); - CAF_PDM_InitField( &showLegendBackground, "showLegendBackground", true, "Show Box around Legends", "", "", "" ); - showLegendBackground.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); + CAF_PDM_InitField( &m_showLegendBackground, "showLegendBackground", true, "Show Box around Legends", "", "", "" ); + m_showLegendBackground.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); CAF_PDM_InitFieldNoDefault( &lastUsedProjectFileName, "lastUsedProjectFileName", "Last Used Project File", "", "", "" ); lastUsedProjectFileName.uiCapability()->setUiHidden( true ); @@ -434,7 +434,7 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field, field == &m_showTestToolbar || field == &m_includeFractureDebugInfoFile || field == &showLasCurveWithoutTvdWarning || field == &holoLensDisableCertificateVerification || field == &m_showProjectChangedDialog || field == &m_searchPlotTemplateFoldersRecursively || - field == &showLegendBackground || field == &m_showSummaryTimeAsLongString || + field == &m_showLegendBackground || field == &m_showSummaryTimeAsLongString || field == &m_showViewIdInProjectTree || field == &m_useMultipleThreadsWhenLoadingSummaryData ) { caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast( attribute ); @@ -479,10 +479,10 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& fontGroup->add( &defaultPlotFontSize, false ); caf::PdmUiGroup* viewsGroup = uiOrdering.addNewGroup( "3d Views" ); - viewsGroup->add( &defaultMeshModeType ); - viewsGroup->add( &navigationPolicy ); - viewsGroup->add( &defaultScaleFactorZ ); - viewsGroup->add( &showLegendBackground ); + viewsGroup->add( &m_defaultMeshModeType ); + viewsGroup->add( &m_navigationPolicy ); + viewsGroup->add( &m_defaultScaleFactorZ ); + viewsGroup->add( &m_showLegendBackground ); caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup( "Other" ); otherGroup->add( &ssihubAddress ); @@ -995,3 +995,35 @@ QMarginsF RiaPreferences::margins() const { return QMarginsF( m_pageLeftMargin, m_pageTopMargin, m_pageRightMargin, m_pageBottomMargin ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaDefines::MeshModeType RiaPreferences::defaultMeshModeType() const +{ + return m_defaultMeshModeType(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaGuiApplication::RINavigationPolicy RiaPreferences::navigationPolicy() const +{ + return m_navigationPolicy(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RiaPreferences::defaultScaleFactorZ() const +{ + return m_defaultScaleFactorZ(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaPreferences::showLegendBackground() const +{ + return m_showLegendBackground(); +} diff --git a/ApplicationCode/Application/RiaPreferences.h b/ApplicationCode/Application/RiaPreferences.h index d93e97dc4b..27d5440c39 100644 --- a/ApplicationCode/Application/RiaPreferences.h +++ b/ApplicationCode/Application/RiaPreferences.h @@ -107,9 +107,13 @@ public: QPageLayout defaultPageLayout() const; QMarginsF margins() const; -public: // Pdm Fields - caf::PdmField> navigationPolicy; + // 3D view + RiaDefines::MeshModeType defaultMeshModeType() const; + RiaGuiApplication::RINavigationPolicy navigationPolicy() const; + int defaultScaleFactorZ() const; + bool showLegendBackground() const; +public: // Pdm Fields caf::PdmField enableGrpcServer; caf::PdmField defaultGrpcPortNumber; @@ -124,9 +128,6 @@ public: // Pdm Fields caf::PdmField ssihubAddress; - caf::PdmField> defaultMeshModeType; - - caf::PdmField defaultScaleFactorZ; caf::PdmField defaultGridLineColors; caf::PdmField defaultFaultGridLineColors; caf::PdmField defaultViewerBackgroundColor; @@ -138,8 +139,6 @@ public: // Pdm Fields caf::PdmField defaultAnnotationFontSize; caf::PdmField defaultPlotFontSize; - caf::PdmField showLegendBackground; - caf::PdmField lastUsedProjectFileName; caf::PdmField autocomputeDepthRelatedProperties; @@ -208,6 +207,12 @@ private: caf::PdmField m_searchPlotTemplateFoldersRecursively; caf::PdmField m_defaultPlotTemplate; + // 3d view + caf::PdmField> m_defaultMeshModeType; + caf::PdmField> m_navigationPolicy; + caf::PdmField m_defaultScaleFactorZ; + caf::PdmField m_showLegendBackground; + QStringList m_tabNames; caf::PdmField m_defaultSceneFontSize_OBSOLETE; diff --git a/ApplicationCode/ProjectDataModel/Rim3dView.cpp b/ApplicationCode/ProjectDataModel/Rim3dView.cpp index c06a533c3c..9c40f5c934 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dView.cpp @@ -106,7 +106,7 @@ Rim3dView::Rim3dView( void ) CAF_PDM_InitField( &isPerspectiveView, "PerspectiveProjection", true, "Perspective Projection", "", "", "" ); - double defaultScaleFactor = preferences->defaultScaleFactorZ; + double defaultScaleFactor = preferences->defaultScaleFactorZ(); CAF_PDM_InitField( &scaleZ, "GridZScale", defaultScaleFactor, "Z Scale", "", "Scales the scene in the Z direction", "" ); cvf::Color3f defBackgColor = preferences->defaultViewerBackgroundColor();