From fd13e26d1ef5b2bae1584cacba4236d16dabd23c Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 16 Jan 2009 14:54:33 +0000 Subject: [PATCH] 0019923: EDF 765 SMESH : default values of hypothesis add preference parameter to control number of segments per diagonal of boundary box of geometry by which default segment length of appropriate 1D hypotheses is defined --- resources/SalomeApp.xml | 1 + src/SMESHGUI/SMESHGUI.cxx | 22 +++++++++++++++++++++- src/SMESHGUI/SMESH_msg_en.ts | 8 ++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 6846d0008..668115a67 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -43,6 +43,7 @@ +
diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 88042cf96..af2200895 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1069,6 +1069,11 @@ SalomeApp_Module( "SMESH" ) { CORBA::Boolean anIsEmbeddedMode; myComponentSMESH = SMESH_Client::GetSMESHGen(getApp()->orb(),anIsEmbeddedMode); + + // 0019923: EDF 765 SMESH : default values of hypothesis + SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this); + int nbSeg = aResourceMgr->integerValue( "SMESH", "segmentation" ); + myComponentSMESH->SetBoundaryBoxSegmentation( nbSeg ); } myActiveDialogBox = 0; @@ -3404,6 +3409,7 @@ void SMESHGUI::onViewManagerActivated( SUIT_ViewManager* mgr ) void SMESHGUI::createPreferences() { + // General tab ------------------------------------------------------------------------ int genTab = addPreference( tr( "PREF_TAB_GENERAL" ) ); int updateGroup = addPreference( tr( "PREF_GROUP_UPDATE" ), genTab ); @@ -3457,6 +3463,14 @@ void SMESHGUI::createPreferences() setPreferenceProperty( notifyMode, "strings", modes ); setPreferenceProperty( notifyMode, "indexes", indices ); + int segGroup = addPreference( tr( "PREF_GROUP_SEGMENT_LENGTH" ), genTab ); + setPreferenceProperty( segGroup, "columns", 2 ); + int segLen = addPreference( tr( "PREF_SEGMENT_LENGTH" ), segGroup, LightApp_Preferences::IntSpin, + "SMESH", "segmentation" ); + setPreferenceProperty( segLen, "min", 1 ); + setPreferenceProperty( segLen, "max", 10000000 ); + + // Mesh tab ------------------------------------------------------------------------ int meshTab = addPreference( tr( "PREF_TAB_MESH" ) ); int nodeGroup = addPreference( tr( "PREF_GROUP_NODES" ), meshTab ); setPreferenceProperty( nodeGroup, "columns", 2 ); @@ -3499,6 +3513,7 @@ void SMESHGUI::createPreferences() addPreference( tr( "PREF_ORIENTATION_3D_VECTORS" ), orientGroup, LightApp_Preferences::Bool, "SMESH", "orientation_3d_vectors" ); + // Selection tab ------------------------------------------------------------------------ int selTab = addPreference( tr( "PREF_TAB_SELECTION" ) ); int selGroup = addPreference( tr( "PREF_GROUP_SELECTION" ), selTab ); @@ -3527,6 +3542,7 @@ void SMESHGUI::createPreferences() addPreference( tr( "PREF_ELEMENTS" ), precSelGroup, LightApp_Preferences::Double, "SMESH", "selection_precision_element" ); addPreference( tr( "PREF_OBJECTS" ), precSelGroup, LightApp_Preferences::Double, "SMESH", "selection_precision_object" ); + // Scalar Bar tab ------------------------------------------------------------------------ int sbarTab = addPreference( tr( "SMESH_SCALARBAR" ) ); int fontGr = addPreference( tr( "SMESH_FONT_SCALARBAR" ), sbarTab ); setPreferenceProperty( fontGr, "columns", 2 ); @@ -3602,7 +3618,7 @@ void SMESHGUI::createPreferences() void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) { - if( sect=="SMESH" ){ + if( sect=="SMESH" ) { float sbX1,sbY1,sbW,sbH; float aTol = 1.00000009999999; std::string aWarning; @@ -3654,6 +3670,10 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH); } } + else if ( name == "segmentation" ) { + int nbSeg = aResourceMgr->integerValue( "SMESH", "segmentation" ); + myComponentSMESH->SetBoundaryBoxSegmentation( nbSeg ); + } if(aWarning.size() != 0){ aWarning += "The default values are applied instead."; diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index a7a4f781f..ded11d61b 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -2888,6 +2888,14 @@ Please, create VTK viewer and try again PREF_AUTO_GROUPS Automatically create groups for MED export + + PREF_GROUP_SEGMENT_LENGTH + Segment length + + + PREF_SEGMENT_LENGTH + Segmentation of diagonal of boundary box of geometry + PREF_AUTO_UPDATE Automatic update