]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1412:Selection mode preferences modified
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 4 May 2016 11:57:30 +0000 (14:57 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 4 May 2016 11:57:43 +0000 (14:57 +0300)
src/ModuleBase/ModuleBase_Preferences.cpp
src/XGUI/SHAPER.xml
src/XGUI/XGUI_Workshop.cpp

index bef2ab96f7df7b062fce99f8c2810c8c584471af..7558aeecf34bd50ae3fdc352bdd798e23c282793 100644 (file)
@@ -291,24 +291,30 @@ void ModuleBase_PreferencesDlg::createViewerPage(int thePageId)
   myPreferences->setItemProperty("image_formats", aImgFiles, bgId);
 
   // Create other parameters group in viewer tab
-  int otherGroup = myPreferences->addItem(tr("Other parameters"), viewTab);
-  int selId = myPreferences->addItem(tr("Default selection type"), otherGroup, 
-                                     SUIT_PreferenceMgr::Selector,
-                                     ModuleBase_Preferences::VIEWER_SECTION, "selection");
-  QStringList aSelectionList;
-  aSelectionList.append( tr("Vertices") );
-  aSelectionList.append( tr("Edges") );
-  aSelectionList.append( tr("Faces") );
-  aSelectionList.append( tr("Results") );
-
-  QList<QVariant> anIndexesList;
-  anIndexesList.append(TopAbs_VERTEX);
-  anIndexesList.append(TopAbs_EDGE);
-  anIndexesList.append(TopAbs_FACE);
-  anIndexesList.append(-1);
-
-  myPreferences->setItemProperty( "strings", aSelectionList, selId );
-  myPreferences->setItemProperty( "indexes", anIndexesList, selId );
+  int otherGroup = myPreferences->addItem(tr("Default selection"), viewTab);
+  myPreferences->addItem(tr("Faces"), otherGroup, 
+                         SUIT_PreferenceMgr::Bool,
+                         ModuleBase_Preferences::VIEWER_SECTION, "face-selection");
+  myPreferences->addItem(tr("Edges"), otherGroup, 
+                         SUIT_PreferenceMgr::Bool,
+                         ModuleBase_Preferences::VIEWER_SECTION, "edge-selection");
+  myPreferences->addItem(tr("Vertices"), otherGroup, 
+                         SUIT_PreferenceMgr::Bool,
+                         ModuleBase_Preferences::VIEWER_SECTION, "vertex-selection");
+  //QStringList aSelectionList;
+  //aSelectionList.append( tr("Vertices") );
+  //aSelectionList.append( tr("Edges") );
+  //aSelectionList.append( tr("Faces") );
+  //aSelectionList.append( tr("Results") );
+
+  //QList<QVariant> anIndexesList;
+  //anIndexesList.append(TopAbs_VERTEX);
+  //anIndexesList.append(TopAbs_EDGE);
+  //anIndexesList.append(TopAbs_FACE);
+  //anIndexesList.append(-1);
+
+  //myPreferences->setItemProperty( "strings", aSelectionList, selId );
+  //myPreferences->setItemProperty( "indexes", anIndexesList, selId );
 }
 
 void ModuleBase_PreferencesDlg::createMenuPage(int thePageId)
index 02ac10bb2e0cf169c78b11370958c6789d62dd5c..f43451026fd882f04df0337b83cd24453bd125a3 100644 (file)
@@ -11,7 +11,9 @@
   <section name="Viewer" >
     <!-- Viewer preferences -->
     <parameter name="background" value="bt=2;fn=;tm=0;ts=false;c1=#cddbff;c2=#698fff;gt=1;gr=" />
-    <parameter name="selection" value="4" />
+    <parameter name="face-selection" value="true" />
+    <parameter name="edge-selection" value="true" />
+    <parameter name="vertex-selection" value="true" />
   </section>
   <section name="Menu" >
     <!-- Menu bar preferences -->
index 9da518760816e3a10c6610188e63963b066a69a8..4bd56e25840fb36fa0c78da0972102091f072e5b 100755 (executable)
@@ -136,8 +136,6 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
     QLocale::setDefault( QLocale::system() );
 #endif
 
-  myViewerSelMode << TopAbs_FACE << TopAbs_EDGE << TopAbs_VERTEX;
-
   myDataModelXMLReader = new Config_DataModelReader();
   myDataModelXMLReader->readAll();
 
@@ -198,8 +196,12 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
   Config_PropManager::registerProp("Visualization", "result_part_color", "Part color",
                                    Config_Prop::Color, ModelAPI_ResultPart::DEFAULT_COLOR());
   
-  //myViewerSelMode = 
-  //  ModuleBase_Preferences::resourceMgr()->integerValue("Viewer", "selection", TopAbs_FACE);
+  if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "face-selection", true))
+    myViewerSelMode.append(TopAbs_FACE);
+  if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "edge-selection", true))
+    myViewerSelMode.append(TopAbs_EDGE);
+  if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "vertex-selection", true))
+    myViewerSelMode.append(TopAbs_VERTEX);
 }
 
 //******************************************************