]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Selection sensitivity for edges
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 16 Jun 2016 09:40:43 +0000 (12:40 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 16 Jun 2016 09:40:43 +0000 (12:40 +0300)
src/ModuleBase/ModuleBase_Preferences.cpp
src/XGUI/SHAPER.xml
src/XGUI/XGUI_Displayer.cpp

index 3a8d0badc1562fbe67f57f235c038ed68bafc6f5..641a1bc5952dcf716842fa34baa95ce154bffe79 100644 (file)
@@ -239,7 +239,7 @@ ModuleBase_PreferencesDlg::ModuleBase_PreferencesDlg(SUIT_ResourceMgr* theResurc
   createEditors();
 
   myPreferences->retrieve();
-  setMinimumSize(800, 220);
+  setMinimumSize(800, 240);
 }
 
 ModuleBase_PreferencesDlg::~ModuleBase_PreferencesDlg()
@@ -291,20 +291,24 @@ void ModuleBase_PreferencesDlg::createViewerPage(int thePageId)
   myPreferences->setItemProperty("image_formats", aImgFiles, bgId);
 
   // Create other parameters group in viewer tab
-  int otherGroup = myPreferences->addItem(tr("Default selection"), viewTab);
-  myPreferences->setItemProperty("columns", 3, otherGroup);
-  myPreferences->addItem(tr("Faces"), otherGroup, 
+  int selectionGroup = myPreferences->addItem(tr("Default selection"), viewTab);
+  myPreferences->setItemProperty("columns", 3, selectionGroup);
+  myPreferences->addItem(tr("Faces"), selectionGroup, 
                          SUIT_PreferenceMgr::Bool,
                          ModuleBase_Preferences::VIEWER_SECTION, "face-selection");
-  myPreferences->addItem(tr("Edges"), otherGroup, 
+  myPreferences->addItem(tr("Edges"), selectionGroup, 
                          SUIT_PreferenceMgr::Bool,
                          ModuleBase_Preferences::VIEWER_SECTION, "edge-selection");
-  myPreferences->addItem(tr("Vertices"), otherGroup, 
+  myPreferences->addItem(tr("Vertices"), selectionGroup, 
                          SUIT_PreferenceMgr::Bool,
                          ModuleBase_Preferences::VIEWER_SECTION, "vertex-selection");
 
-  myPreferences->addItem(tr("Vertex selection sensitivity"), otherGroup, SUIT_PreferenceMgr::Double,
+  int sensitivityGroup = myPreferences->addItem(tr("Selection sensitivity"), viewTab);
+  myPreferences->setItemProperty("columns", 2, sensitivityGroup);
+  myPreferences->addItem(tr("Vertex"), sensitivityGroup, SUIT_PreferenceMgr::Double,
                          ModuleBase_Preferences::VIEWER_SECTION, "point-selection-sensitivity");
+  myPreferences->addItem(tr("Edge"), sensitivityGroup, SUIT_PreferenceMgr::Double,
+                         ModuleBase_Preferences::VIEWER_SECTION, "edge-selection-sensitivity");
 }
 
 void ModuleBase_PreferencesDlg::createMenuPage(int thePageId)
index 39e2b85c5121fb38c04c0816667b886b7541cd50..92f21fb351e55705df95a9ba8e0d31c0e67133f0 100644 (file)
@@ -15,6 +15,7 @@
     <parameter name="edge-selection" value="true" />
     <parameter name="vertex-selection" value="true" />
     <parameter name="point-selection-sensitivity" value="20" />
+    <parameter name="edge-selection-sensitivity" value="2" />
   </section>
   <section name="Menu" >
     <!-- Menu bar preferences -->
index da86ce04feedb5226d81094617b6ef7c719d04fb..48559568c7bb14f265118780cf1ecc7ea514c399 100644 (file)
@@ -901,6 +901,9 @@ void XGUI_Displayer::activateAIS(const Handle(AIS_InteractiveObject)& theIO,
     double aPrecision = theIO->Width() + 2;
     if (theMode == getSelectionMode(TopAbs_VERTEX)) 
       aPrecision = ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "point-selection-sensitivity", 20);
+    else if ((theMode == getSelectionMode(TopAbs_EDGE)) || (theMode == getSelectionMode(TopAbs_WIRE)))
+      aPrecision = theIO->Width() + 
+                   ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "edge-selection-sensitivity", 2);
     aContext->SetSelectionSensitivity(theIO, theMode, aPrecision);
 
     ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::activateAIS -- Activate");