Merge pull request #5000 from OPM/move-3d-settings-to-system-tab

Move 3d settings to system tab
This commit is contained in:
Magne Sjaastad 2019-11-06 12:45:34 +01:00 committed by GitHub
commit 9f320c1dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 34 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;
@ -555,14 +555,6 @@ RiaGuiApplication::RINavigationPolicy RiaGuiApplication::navigationPolicy() cons
return m_preferences->navigationPolicy(); return m_preferences->navigationPolicy();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaGuiApplication::showPerformanceInfo() const
{
return m_preferences->showHud;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1529,7 +1521,7 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* oldPreference
if ( m_activeReservoirView && m_activeReservoirView->viewer() ) if ( m_activeReservoirView && m_activeReservoirView->viewer() )
{ {
m_activeReservoirView->viewer()->updateNavigationPolicy(); m_activeReservoirView->viewer()->updateNavigationPolicy();
m_activeReservoirView->viewer()->enablePerfInfoHud( m_preferences->showHud() ); m_activeReservoirView->viewer()->enablePerfInfoHud( m_preferences->show3dInformation() );
} }
if ( useShaders() ) if ( useShaders() )

View File

@ -100,7 +100,6 @@ public:
std::vector<QString> gridFileNames, std::vector<QString> gridFileNames,
const QString& snapshotFolderName ); const QString& snapshotFolderName );
bool useShaders() const; bool useShaders() const;
bool showPerformanceInfo() const;
RINavigationPolicy navigationPolicy() const; RINavigationPolicy navigationPolicy() const;

View File

@ -177,10 +177,10 @@ 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( &m_showHud, "showHud", false, "Show 3D Information", "", "", "" );
showHud.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); m_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", "", "", "" );
m_appendClassNameToUiText.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); m_appendClassNameToUiText.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
CAF_PDM_InitField( &m_appendFieldKeywordToToolTipText, CAF_PDM_InitField( &m_appendFieldKeywordToToolTipText,
@ -360,12 +360,12 @@ 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 == &m_showHud ||
field == &m_appendFieldKeywordToToolTipText || field == &m_showTestToolbar || field == &m_appendClassNameToUiText || field == &m_appendFieldKeywordToToolTipText ||
field == &m_includeFractureDebugInfoFile || field == &showLasCurveWithoutTvdWarning || field == &m_showTestToolbar || field == &m_includeFractureDebugInfoFile ||
field == &holoLensDisableCertificateVerification || field == &m_showProjectChangedDialog || field == &showLasCurveWithoutTvdWarning || field == &holoLensDisableCertificateVerification ||
field == &m_searchPlotTemplateFoldersRecursively || field == &showLegendBackground || field == &m_showProjectChangedDialog || field == &m_searchPlotTemplateFoldersRecursively ||
field == &m_showSummaryTimeAsLongString || field == &m_showViewIdInProjectTree ) field == &showLegendBackground || field == &m_showSummaryTimeAsLongString || field == &m_showViewIdInProjectTree )
{ {
caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>( attribute ); caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>( attribute );
if ( myAttr ) if ( myAttr )
@ -413,8 +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 );
caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup( "Other" ); caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup( "Other" );
otherGroup->add( &ssihubAddress ); otherGroup->add( &ssihubAddress );
@ -482,12 +480,20 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
} }
else if ( RiaApplication::enableDevelopmentFeatures() && uiConfigName == RiaPreferences::tabNameSystem() ) else if ( RiaApplication::enableDevelopmentFeatures() && uiConfigName == RiaPreferences::tabNameSystem() )
{ {
uiOrdering.add( &m_appendClassNameToUiText ); {
uiOrdering.add( &m_appendFieldKeywordToToolTipText ); caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Project Tree" );
uiOrdering.add( &m_showViewIdInProjectTree ); group->add( &m_appendClassNameToUiText );
group->add( &m_appendFieldKeywordToToolTipText );
group->add( &m_showViewIdInProjectTree );
}
{
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "3D View" );
group->add( &m_useShaders );
group->add( &m_showHud );
}
uiOrdering.add( &m_showProjectChangedDialog ); uiOrdering.add( &m_showProjectChangedDialog );
uiOrdering.add( &m_showTestToolbar ); uiOrdering.add( &m_showTestToolbar );
uiOrdering.add( &m_includeFractureDebugInfoFile ); uiOrdering.add( &m_includeFractureDebugInfoFile );
uiOrdering.add( &m_holoLensExportFolder ); uiOrdering.add( &m_holoLensExportFolder );
@ -702,6 +708,27 @@ QString RiaPreferences::holoLensExportFolder() const
return m_holoLensExportFolder(); return m_holoLensExportFolder();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences::useShaders() const
{
if ( !RiaApplication::enableDevelopmentFeatures() )
{
return true;
}
return m_useShaders();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences::show3dInformation() const
{
return RiaApplication::enableDevelopmentFeatures() && m_showHud();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

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,8 @@ public:
bool includeFractureDebugInfoFile() const; bool includeFractureDebugInfoFile() const;
bool showProjectChangedDialog() const; bool showProjectChangedDialog() const;
QString holoLensExportFolder() const; QString holoLensExportFolder() const;
bool useShaders() const;
bool show3dInformation() const;
const QString& dateFormat() const; const QString& dateFormat() const;
const QString& timeFormat() const; const QString& timeFormat() const;
@ -124,9 +131,6 @@ public: // Pdm Fields
caf::PdmField<bool> showLegendBackground; caf::PdmField<bool> showLegendBackground;
caf::PdmField<bool> useShaders;
caf::PdmField<bool> showHud;
caf::PdmField<QString> lastUsedProjectFileName; caf::PdmField<QString> lastUsedProjectFileName;
caf::PdmField<bool> autocomputeDepthRelatedProperties; caf::PdmField<bool> autocomputeDepthRelatedProperties;
@ -162,9 +166,12 @@ private:
private: private:
caf::PdmChildField<RifReaderSettings*> m_readerSettings; caf::PdmChildField<RifReaderSettings*> m_readerSettings;
caf::PdmField<bool> m_appendClassNameToUiText;
caf::PdmField<bool> m_appendFieldKeywordToToolTipText; caf::PdmField<bool> m_appendClassNameToUiText;
caf::PdmField<bool> m_showViewIdInProjectTree; caf::PdmField<bool> m_appendFieldKeywordToToolTipText;
caf::PdmField<bool> m_showViewIdInProjectTree;
caf::PdmField<bool> m_useShaders;
caf::PdmField<bool> m_showHud;
caf::PdmField<bool> m_showProjectChangedDialog; caf::PdmField<bool> m_showProjectChangedDialog;

View File

@ -265,7 +265,7 @@ void Rim3dView::updateViewWidgetAfterCreation()
this->onResetLegendsInViewer(); this->onResetLegendsInViewer();
m_viewer->updateNavigationPolicy(); m_viewer->updateNavigationPolicy();
m_viewer->enablePerfInfoHud( RiaGuiApplication::instance()->showPerformanceInfo() ); m_viewer->enablePerfInfoHud( RiaGuiApplication::instance()->preferences()->show3dInformation() );
m_viewer->mainCamera()->setViewMatrix( m_cameraPosition ); m_viewer->mainCamera()->setViewMatrix( m_cameraPosition );
m_viewer->setPointOfInterest( m_cameraPointOfInterest() ); m_viewer->setPointOfInterest( m_cameraPointOfInterest() );