From: vsv Date: Fri, 26 Dec 2014 14:18:07 +0000 (+0300) Subject: Provide names of sub-objects from Naming for Groups X-Git-Tag: V_0.7.0_rc1~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8513abc01bef2fd9d98ba7e663e529ef66813bbb;p=modules%2Fshaper.git Provide names of sub-objects from Naming for Groups --- diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 5c50ce38e..211380338 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -15,7 +15,6 @@ #include #include -#include #include @@ -93,6 +92,7 @@ bool ModuleBase_WidgetMultiSelector::storeValue() const foreach (GeomSelection aSelec, mySelection) { aSelectionListAttr->append(aSelec.first, aSelec.second); } + //updateSelectionList(aSelectionListAttr); updateObject(myFeature); return true; } @@ -119,7 +119,7 @@ bool ModuleBase_WidgetMultiSelector::restoreValue() AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i); mySelection.append(GeomSelection(aSelectAttr->context(), aSelectAttr->value())); } - updateSelectionList(); + updateSelectionList(aSelectionListAttr); return true; } return false; @@ -204,7 +204,7 @@ void ModuleBase_WidgetMultiSelector::onSelectionChanged() aShape->setImpl(new TopoDS_Shape(aShpIt.Value())); mySelection.append(GeomSelection(aResult, aShape)); } - updateSelectionList(); + //updateSelectionList(); emit valuesChanged(); } @@ -253,25 +253,30 @@ void ModuleBase_WidgetMultiSelector::activateShapeSelection() } //******************************************************************** -void ModuleBase_WidgetMultiSelector::updateSelectionList() +void ModuleBase_WidgetMultiSelector::updateSelectionList(AttributeSelectionListPtr theList) { - QString aType; - if (myTypeCombo->currentText().toLower() == "vertices") - aType = "vertex"; - else if (myTypeCombo->currentText().toLower() == "edges") - aType = "edge"; - else if (myTypeCombo->currentText().toLower() == "faces") - aType = "face"; - else if (myTypeCombo->currentText().toLower() == "solids") - aType = "solid"; - myListControl->clear(); - int i = 1; - foreach (GeomSelection aSel, mySelection) { - QString aName(aSel.first->data()->name().c_str()); - aName += ":" + aType + QString("_%1").arg(i); - myListControl->addItem(aName); - i++; + for (int i = 0; i < theList->size(); i++) { + AttributeSelectionPtr aAttr = theList->value(i); + myListControl->addItem(aAttr->namingName().c_str()); } - myListControl->repaint(); + //QString aType; + //if (myTypeCombo->currentText().toLower() == "vertices") + // aType = "vertex"; + //else if (myTypeCombo->currentText().toLower() == "edges") + // aType = "edge"; + //else if (myTypeCombo->currentText().toLower() == "faces") + // aType = "face"; + //else if (myTypeCombo->currentText().toLower() == "solids") + // aType = "solid"; + + //myListControl->clear(); + //int i = 1; + //foreach (GeomSelection aSel, mySelection) { + // QString aName(aSel.first->data()->name().c_str()); + // aName += ":" + aType + QString("_%1").arg(i); + // myListControl->addItem(aName); + // i++; + //} + //myListControl->repaint(); } diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h index c38f72d07..47f08a5e6 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -67,7 +68,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_Model void activateShapeSelection(); private: - void updateSelectionList(); + void updateSelectionList(AttributeSelectionListPtr); QListWidget* myListControl; QComboBox* myTypeCombo;