#4982 Preferences : Move Use Shaders to development tab

This commit is contained in:
Magne Sjaastad 2019-11-06 11:10:33 +01:00
parent be1781fd3b
commit 2aa704b18a
3 changed files with 26 additions and 6 deletions

View File

@ -539,7 +539,7 @@ RimViewWindow* RiaGuiApplication::activePlotWindow() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiaGuiApplication::useShaders() const bool RiaGuiApplication::useShaders() const
{ {
if ( !m_preferences->useShaders ) return false; if ( !m_preferences->useShaders() ) return false;
bool isShadersSupported = caf::Viewer::isShadersSupported(); bool isShadersSupported = caf::Viewer::isShadersSupported();
if ( !isShadersSupported ) return false; if ( !isShadersSupported ) return false;

View File

@ -177,8 +177,8 @@ RiaPreferences::RiaPreferences( void )
"" ); "" );
showLasCurveWithoutTvdWarning.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); showLasCurveWithoutTvdWarning.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
CAF_PDM_InitField( &useShaders, "useShaders", true, "Use Shaders", "", "", "" ); CAF_PDM_InitField( &m_useShaders, "useShaders", true, "Use Shaders", "", "", "" );
useShaders.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); m_useShaders.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
CAF_PDM_InitField( &showHud, "showHud", false, "Show 3D Information", "", "", "" ); CAF_PDM_InitField( &showHud, "showHud", false, "Show 3D Information", "", "", "" );
showHud.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); showHud.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
CAF_PDM_InitField( &m_appendClassNameToUiText, "appendClassNameToUiText", false, "Show Class Names", "", "", "" ); CAF_PDM_InitField( &m_appendClassNameToUiText, "appendClassNameToUiText", false, "Show Class Names", "", "", "" );
@ -360,7 +360,7 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field,
} }
if ( field == &octaveShowHeaderInfoWhenExecutingScripts || field == &autocomputeDepthRelatedProperties || if ( field == &octaveShowHeaderInfoWhenExecutingScripts || field == &autocomputeDepthRelatedProperties ||
field == &loadAndShowSoil || field == &useShaders || field == &showHud || field == &m_appendClassNameToUiText || field == &loadAndShowSoil || field == &m_useShaders || field == &showHud || field == &m_appendClassNameToUiText ||
field == &m_appendFieldKeywordToToolTipText || field == &m_showTestToolbar || field == &m_appendFieldKeywordToToolTipText || field == &m_showTestToolbar ||
field == &m_includeFractureDebugInfoFile || field == &showLasCurveWithoutTvdWarning || field == &m_includeFractureDebugInfoFile || field == &showLasCurveWithoutTvdWarning ||
field == &holoLensDisableCertificateVerification || field == &m_showProjectChangedDialog || field == &holoLensDisableCertificateVerification || field == &m_showProjectChangedDialog ||
@ -413,7 +413,6 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
viewsGroup->add( &navigationPolicy ); viewsGroup->add( &navigationPolicy );
viewsGroup->add( &defaultScaleFactorZ ); viewsGroup->add( &defaultScaleFactorZ );
viewsGroup->add( &showLegendBackground ); viewsGroup->add( &showLegendBackground );
viewsGroup->add( &useShaders );
viewsGroup->add( &showHud ); viewsGroup->add( &showHud );
caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup( "Other" ); caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup( "Other" );
@ -491,6 +490,8 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
uiOrdering.add( &m_showTestToolbar ); uiOrdering.add( &m_showTestToolbar );
uiOrdering.add( &m_includeFractureDebugInfoFile ); uiOrdering.add( &m_includeFractureDebugInfoFile );
uiOrdering.add( &m_holoLensExportFolder ); uiOrdering.add( &m_holoLensExportFolder );
uiOrdering.add( &m_useShaders );
} }
uiOrdering.skipRemainingFields( true ); uiOrdering.skipRemainingFields( true );
@ -702,6 +703,19 @@ QString RiaPreferences::holoLensExportFolder() const
return m_holoLensExportFolder(); return m_holoLensExportFolder();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences::useShaders() const
{
if ( !RiaApplication::enableDevelopmentFeatures() )
{
return true;
}
return m_useShaders();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -35,10 +35,15 @@
// Include to make Pdm work for cvf::Color // Include to make Pdm work for cvf::Color
#include "cafPdmFieldCvfColor.h" #include "cafPdmFieldCvfColor.h"
#include <QStringList>
#include <map> #include <map>
class RifReaderSettings; class RifReaderSettings;
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RiaPreferences : public caf::PdmObject class RiaPreferences : public caf::PdmObject
{ {
CAF_PDM_HEADER_INIT; CAF_PDM_HEADER_INIT;
@ -76,6 +81,7 @@ public:
bool includeFractureDebugInfoFile() const; bool includeFractureDebugInfoFile() const;
bool showProjectChangedDialog() const; bool showProjectChangedDialog() const;
QString holoLensExportFolder() const; QString holoLensExportFolder() const;
bool useShaders() const;
const QString& dateFormat() const; const QString& dateFormat() const;
const QString& timeFormat() const; const QString& timeFormat() const;
@ -124,7 +130,6 @@ public: // Pdm Fields
caf::PdmField<bool> showLegendBackground; caf::PdmField<bool> showLegendBackground;
caf::PdmField<bool> useShaders;
caf::PdmField<bool> showHud; caf::PdmField<bool> showHud;
caf::PdmField<QString> lastUsedProjectFileName; caf::PdmField<QString> lastUsedProjectFileName;
@ -165,6 +170,7 @@ private:
caf::PdmField<bool> m_appendClassNameToUiText; caf::PdmField<bool> m_appendClassNameToUiText;
caf::PdmField<bool> m_appendFieldKeywordToToolTipText; caf::PdmField<bool> m_appendFieldKeywordToToolTipText;
caf::PdmField<bool> m_showViewIdInProjectTree; caf::PdmField<bool> m_showViewIdInProjectTree;
caf::PdmField<bool> m_useShaders;
caf::PdmField<bool> m_showProjectChangedDialog; caf::PdmField<bool> m_showProjectChangedDialog;