mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add a few more tiny scales. Allow user to input doubles in preferences.
This commit is contained in:
parent
4f9cbe8e97
commit
e70cc85db6
@ -355,5 +355,5 @@ QString RiaDefines::stringListSeparator()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<double> RiaDefines::viewScaleOptions()
|
std::vector<double> RiaDefines::viewScaleOptions()
|
||||||
{
|
{
|
||||||
return { 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0, 15.0, 20.0, 50.0 };
|
return { 0.005, 0.01, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0, 15.0, 20.0, 50.0 };
|
||||||
}
|
}
|
||||||
|
@ -1403,8 +1403,8 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
|
|||||||
existingViewsWithCustomColors = true;
|
existingViewsWithCustomColors = true;
|
||||||
}
|
}
|
||||||
if ( m_preferences->defaultScaleFactorZ() != oldPreferences->defaultScaleFactorZ() &&
|
if ( m_preferences->defaultScaleFactorZ() != oldPreferences->defaultScaleFactorZ() &&
|
||||||
rim3dView->scaleZ() != static_cast<double>( oldPreferences->defaultScaleFactorZ() ) &&
|
rim3dView->scaleZ() != oldPreferences->defaultScaleFactorZ() &&
|
||||||
rim3dView->scaleZ() != static_cast<double>( m_preferences->defaultScaleFactorZ() ) )
|
rim3dView->scaleZ() != m_preferences->defaultScaleFactorZ() )
|
||||||
{
|
{
|
||||||
existingViewsWithCustomZScale = true;
|
existingViewsWithCustomZScale = true;
|
||||||
}
|
}
|
||||||
@ -1471,10 +1471,9 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
|
|||||||
rim3dView->applyBackgroundColorAndFontChanges();
|
rim3dView->applyBackgroundColorAndFontChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( oldPreferences &&
|
if ( oldPreferences && ( applySettingsToAllViews || rim3dView->scaleZ() == oldPreferences->defaultScaleFactorZ() ) )
|
||||||
( applySettingsToAllViews || rim3dView->scaleZ() == static_cast<double>( oldPreferences->defaultScaleFactorZ() ) ) )
|
|
||||||
{
|
{
|
||||||
rim3dView->setScaleZ( static_cast<double>( m_preferences->defaultScaleFactorZ() ) );
|
rim3dView->setScaleZ( m_preferences->defaultScaleFactorZ() );
|
||||||
rim3dView->updateScaling();
|
rim3dView->updateScaling();
|
||||||
if ( rim3dView == activeViewWindow() )
|
if ( rim3dView == activeViewWindow() )
|
||||||
{
|
{
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
#include <QValidator>
|
||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
@ -149,7 +150,7 @@ RiaPreferences::RiaPreferences()
|
|||||||
"The viewer background color for new views",
|
"The viewer background color for new views",
|
||||||
"" );
|
"" );
|
||||||
|
|
||||||
CAF_PDM_InitField( &m_defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z Scale Factor" );
|
CAF_PDM_InitField( &m_defaultScaleFactorZ, "defaultScaleFactorZ", 5.0, "Default Z Scale Factor" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &defaultSceneFontSize, "defaultSceneFontSizePt", "Viewer Font Size" );
|
CAF_PDM_InitFieldNoDefault( &defaultSceneFontSize, "defaultSceneFontSizePt", "Viewer Font Size" );
|
||||||
CAF_PDM_InitFieldNoDefault( &defaultAnnotationFontSize, "defaultAnnotationFontSizePt", "Annotation Font Size" );
|
CAF_PDM_InitFieldNoDefault( &defaultAnnotationFontSize, "defaultAnnotationFontSizePt", "Annotation Font Size" );
|
||||||
@ -301,7 +302,7 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field, QS
|
|||||||
myAttr->minimumContentsLength = 2;
|
myAttr->minimumContentsLength = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( field == &m_multiLateralWellPattern )
|
else if ( field == &m_multiLateralWellPattern )
|
||||||
{
|
{
|
||||||
caf::PdmUiLineEditorAttribute* myAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
|
caf::PdmUiLineEditorAttribute* myAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
|
||||||
if ( myAttr )
|
if ( myAttr )
|
||||||
@ -309,6 +310,14 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field, QS
|
|||||||
myAttr->validator = new RiaValidRegExpValidator( RiaPreferences::current()->defaultMultiLateralWellNamePattern() );
|
myAttr->validator = new RiaValidRegExpValidator( RiaPreferences::current()->defaultMultiLateralWellNamePattern() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ( field == &m_defaultScaleFactorZ )
|
||||||
|
{
|
||||||
|
auto myAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
|
||||||
|
if ( myAttr )
|
||||||
|
{
|
||||||
|
myAttr->validator = new QDoubleValidator( 0.000001, 100000.0, 6 );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -836,8 +845,9 @@ RiaDefines::RINavigationPolicy RiaPreferences::navigationPolicy() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
int RiaPreferences::defaultScaleFactorZ() const
|
double RiaPreferences::defaultScaleFactorZ() const
|
||||||
{
|
{
|
||||||
|
if ( m_defaultScaleFactorZ < 0.000001 ) return 0.000001;
|
||||||
return m_defaultScaleFactorZ();
|
return m_defaultScaleFactorZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public:
|
|||||||
// 3D view
|
// 3D view
|
||||||
RiaDefines::MeshModeType defaultMeshModeType() const;
|
RiaDefines::MeshModeType defaultMeshModeType() const;
|
||||||
RiaDefines::RINavigationPolicy navigationPolicy() const;
|
RiaDefines::RINavigationPolicy navigationPolicy() const;
|
||||||
int defaultScaleFactorZ() const;
|
double defaultScaleFactorZ() const;
|
||||||
bool showLegendBackground() const;
|
bool showLegendBackground() const;
|
||||||
bool showInfoBox() const;
|
bool showInfoBox() const;
|
||||||
bool showGridBox() const;
|
bool showGridBox() const;
|
||||||
@ -212,7 +212,7 @@ private:
|
|||||||
// 3d view
|
// 3d view
|
||||||
caf::PdmField<caf::AppEnum<RiaDefines::MeshModeType>> m_defaultMeshModeType;
|
caf::PdmField<caf::AppEnum<RiaDefines::MeshModeType>> m_defaultMeshModeType;
|
||||||
caf::PdmField<caf::AppEnum<RiaDefines::RINavigationPolicy>> m_navigationPolicy;
|
caf::PdmField<caf::AppEnum<RiaDefines::RINavigationPolicy>> m_navigationPolicy;
|
||||||
caf::PdmField<int> m_defaultScaleFactorZ;
|
caf::PdmField<double> m_defaultScaleFactorZ;
|
||||||
caf::PdmField<bool> m_showLegendBackground;
|
caf::PdmField<bool> m_showLegendBackground;
|
||||||
caf::PdmField<bool> m_enableFaultsByDefault;
|
caf::PdmField<bool> m_enableFaultsByDefault;
|
||||||
caf::PdmField<bool> m_showInfoBox;
|
caf::PdmField<bool> m_showInfoBox;
|
||||||
|
Loading…
Reference in New Issue
Block a user