From: mzn Date: Tue, 30 Aug 2005 10:04:41 +0000 (+0000) Subject: Preferences-Mesh-General tab: regressions and reorganization. X-Git-Tag: V_3_0_2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1809a8e762de0f37fee9bb2c43bdc7de34e558fa;p=modules%2Fsmesh.git Preferences-Mesh-General tab: regressions and reorganization. --- diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index bdadcf026..1d83c6501 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -116,7 +116,10 @@ SMESH_ActorDef::SMESH_ActorDef() myIsShrinkable = false; myIsShrunk = false; - myControlsPrecision = (long)SMESH::GetFloat( "SMESH:controls_precision", -1 ); + myControlsPrecision = -1; + SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); + if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) ) + myControlsPrecision = (long)SMESH::GetFloat( "SMESH", "controls_precision", -1 ); float aPointSize = SMESH::GetFloat("SMESH:node_size",3); float aLineWidth = SMESH::GetFloat("SMESH:element_width",1); @@ -278,7 +281,7 @@ SMESH_ActorDef::SMESH_ActorDef() myScalarBarActor->SetVisibility(false); myScalarBarActor->SetLookupTable(myLookupTable); - SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); + mgr = SUIT_Session::session()->resourceMgr(); if( !mgr ) return; @@ -743,18 +746,18 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj, if( !mgr ) return false; - QString aMode = mgr->stringValue( "SMESH", "display_mode" ); + int aMode = mgr->integerValue( "SMESH", "display_mode" ); SetRepresentation(-1); - if(aMode.compare("Wireframe") == 0){ + if(aMode == 0){ SetRepresentation(eEdge); - }else if(aMode.compare("Shading") == 0){ + }else if(aMode == 1){ SetRepresentation(eSurface); - }else if(aMode.compare("Nodes") == 0){ + }else if(aMode == 2){ SetRepresentation(ePoint); } - if(aMode == "Shrink"){ + if(aMode == 3){ SetShrink(); } diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index f92fdf067..074eb1fa4 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -2802,14 +2802,16 @@ void SMESHGUI::createPreferences() { int genTab = addPreference( tr( "PREF_TAB_GENERAL" ) ); + int updateGroup = addPreference( tr( "PREF_GROUP_UPDATE" ), genTab ); + addPreference( tr( "PREF_AUTO_UPDATE" ), updateGroup, SalomeApp_Preferences::Bool, "SMESH", "auto_update" ); + int qaGroup = addPreference( tr( "PREF_GROUP_QUALITY" ), genTab ); addPreference( tr( "PREF_DISPLAY_ENTITY" ), qaGroup, SalomeApp_Preferences::Bool, "SMESH", "display_entity" ); - addPreference( tr( "PREF_AUTO_UPDATE" ), qaGroup, SalomeApp_Preferences::Bool, "SMESH", "auto_update" ); - + addPreference( tr( "PREF_PRECISION_USE" ), qaGroup, SalomeApp_Preferences::Bool, "SMESH", "use_precision" ); + int precGroup = addPreference( tr( "PREF_GROUP_PRECISION" ), genTab ); setPreferenceProperty( precGroup, "columns", 1 ); - addPreference( tr( "PREF_PRECISION_USE" ), precGroup, SalomeApp_Preferences::Bool ); int prec = addPreference( tr( "PREF_PRECISION_VALUE" ), precGroup, SalomeApp_Preferences::IntSpin, "SMESH", "controls_precision" ); setPreferenceProperty( prec, "min", 0 ); @@ -2822,7 +2824,13 @@ void SMESHGUI::createPreferences() modes.append( "Shading" ); modes.append( "Shrink" ); modes.append( "Nodes" ); + QValueList indices; + indices.append( 0 ); + indices.append( 1 ); + indices.append( 2 ); + indices.append( 3 ); setPreferenceProperty( dispmode, "strings", modes ); + setPreferenceProperty( dispmode, "indexes", indices ); int meshTab = addPreference( tr( "PREF_TAB_MESH" ) ); int nodeGroup = addPreference( tr( "PREF_GROUP_NODES" ), meshTab ); @@ -2909,7 +2917,7 @@ void SMESHGUI::createPreferences() QStringList orients; orients.append( tr( "SMESH_VERTICAL" ) ); orients.append( tr( "SMESH_HORIZONTAL" ) ); - QValueList indices; indices.append( 0 ); indices.append( 1 ); + indices.clear(); indices.append( 0 ); indices.append( 1 ); setPreferenceProperty( orient, "strings", orients ); setPreferenceProperty( orient, "indexes", indices ); diff --git a/src/SMESHGUI/SMESH_msg_en.po b/src/SMESHGUI/SMESH_msg_en.po index 7f5fc68d8..2dcc85d54 100644 --- a/src/SMESHGUI/SMESH_msg_en.po +++ b/src/SMESHGUI/SMESH_msg_en.po @@ -2742,6 +2742,9 @@ msgstr "Display Mode Toolbar" msgid "SMESHGUI::PREF_TAB_GENERAL" msgstr "General" +msgid "SMESHGUI::PREF_GROUP_UPDATE" +msgstr "Update" + msgid "SMESHGUI::PREF_GROUP_QUALITY" msgstr "Quality controls"