]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #336 Create/Edit Line -filter for first and last point fields
authornds <natalia.donis@opencascade.com>
Tue, 20 Jan 2015 09:32:55 +0000 (12:32 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 20 Jan 2015 09:32:55 +0000 (12:32 +0300)
It corrects the displayed name for the selection attribute. The sketch feature vertices can be selected in the shape selector control.

src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp

index bea20b3fc8423f3a79361ae8453596bd343cb08b..e576407459fedd22def8f9d20f01b8eb83f5caab 100644 (file)
@@ -365,12 +365,19 @@ bool ModuleBase_WidgetShapeSelector::acceptObjectType(const ObjectPtr theObject)
 //********************************************************************
 void ModuleBase_WidgetShapeSelector::updateSelectionName()
 {
-  if (mySelectedObject) {
-    std::string aName = mySelectedObject->data()->name();
-    myTextLine->setText(QString::fromStdString(aName));
-  } else {
-    if (myIsActive) {
-      myTextLine->setText("");
+  DataPtr aData = myFeature->data();
+  AttributeSelectionPtr aSelect = aData->selection(attributeID());
+  if (aSelect) {
+    myTextLine->setText(QString::fromStdString(aSelect->namingName()));
+  }
+  else {
+    if (mySelectedObject) {
+      std::string aName = mySelectedObject->data()->name();
+      myTextLine->setText(QString::fromStdString(aName));
+    } else {
+      if (myIsActive) {
+        myTextLine->setText("");
+      }
     }
   }
 }