]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1306: Provide selection preferences in SHAPER module
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 6 Apr 2016 14:10:43 +0000 (17:10 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 6 Apr 2016 14:11:05 +0000 (17:11 +0300)
src/SHAPERGUI/SHAPERGUI.cpp
src/SHAPERGUI/resources/LightApp.xml.in
src/SHAPERGUI/resources/SalomeApp.xml.in

index 7bf260cdb5aa0e64f8fe5ea0021483615f46e05d..587069d6c8c34d1457058940faa1ad2350dfe7c5 100644 (file)
@@ -608,6 +608,28 @@ void SHAPERGUI::createPreferences()
     return;
   SHAPERGUI_PrefMgr aMgr(pref, aModName);
   ModuleBase_Preferences::createEditContent(&aMgr, catId);
+
+  int viewTab = pref->addItem(tr("Viewer"), catId);
+  // Create other parameters group in viewer tab
+  int otherGroup = pref->addItem(tr("Other parameters"), viewTab);
+  int selId = pref->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);
+
+  pref->setItemProperty( "strings", aSelectionList, selId );
+  pref->setItemProperty( "indexes", anIndexesList, selId );
+  
   pref->retrieve();
 }
 
index 2869cf359a6463c5a4ea315ce9d374177169daa5..e3ae4cd5641d58ba7bc0d0e4d1b7e7f32e3b9b28 100644 (file)
@@ -35,4 +35,8 @@
     <!-- Module resources -->
     <parameter name="SHAPER" value="${SHAPER_ROOT_DIR}/share/salome/resources/shaper"/>
   </section>
+  <section name="Viewer" >
+    <!-- Viewer preferences -->
+    <parameter name="selection" value="4" />
+  </section>
 </document>
index ef7b146bd101a36e33ea564fcbad20c5ed57d57c..4b0a0012112791c3301583c59645f4d78b2c5bc9 100644 (file)
@@ -40,4 +40,8 @@
     <!-- Module resources -->
     <parameter name="SHAPER" value="%SHAPER_ROOT_DIR%/share/salome/resources/shaper"/>
   </section>
+  <section name="Viewer" >
+    <!-- Viewer preferences -->
+    <parameter name="selection" value="4" />
+  </section>
 </document>