]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #478 Problem of performance with selection
authornds <natalia.donis@opencascade.com>
Wed, 19 Aug 2015 09:11:11 +0000 (12:11 +0300)
committernds <natalia.donis@opencascade.com>
Wed, 19 Aug 2015 09:16:13 +0000 (12:16 +0300)
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/ModuleBase/ModuleBase_WidgetMultiSelector.h

index 3425faca913f54964e9e14af3f8b2d36a3f33bef..98f45e37081cd3d54bb193b39feb7f3a44b59c44 100644 (file)
@@ -65,7 +65,8 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen
                                                                ModuleBase_IWorkshop* theWorkshop,
                                                                const Config_WidgetAPI* theData,
                                                                const std::string& theParentId)
- : ModuleBase_WidgetSelector(theParent, theWorkshop, theData, theParentId)
+ : ModuleBase_WidgetSelector(theParent, theWorkshop, theData, theParentId),
+   mySelectionType(""), mySelectionCount(0)
 {
   QGridLayout* aMainLay = new QGridLayout(this);
   ModuleBase_Tools::adjustMargins(aMainLay);
@@ -176,12 +177,14 @@ void ModuleBase_WidgetMultiSelector::storeAttributeValue()
     return;
 
   mySelectionType = aSelectionListAttr->selectionType();
-  mySelection.clear();
+  mySelectionCount = aSelectionListAttr->size();
+
+  /*mySelection.clear();
   int aSize = aSelectionListAttr->size();
   for (int i = 0; i < aSelectionListAttr->size(); i++) {
     AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i);
     mySelection.append(GeomSelection(aSelectAttr->context(), aSelectAttr->value()));
-  }
+  }*/
 }
 
 //********************************************************************
@@ -208,7 +211,7 @@ void ModuleBase_WidgetMultiSelector::setObject(ObjectPtr theSelectedObject,
 //********************************************************************
 void ModuleBase_WidgetMultiSelector::restoreAttributeValue(bool/* theValid*/)
 {
-  clearAttribute();
+  //clearAttribute();
 
   // Store shape type
   DataPtr aData = myFeature->data();
@@ -217,10 +220,14 @@ void ModuleBase_WidgetMultiSelector::restoreAttributeValue(bool/* theValid*/)
   aSelectionListAttr->setSelectionType(mySelectionType);
 
   // Store selection in the attribute
-  int aSize = mySelection.size();
-  foreach (GeomSelection aSelec, mySelection) {
-    setObject(aSelec.first, aSelec.second);
-  }
+  //int aSize = mySelection.size();
+  //foreach (GeomSelection aSelec, mySelection) {
+  //  setObject(aSelec.first, aSelec.second);
+  //}
+
+  //int aCountAppened = aSelectionListAttr->size() - mySelectionCount;
+  //for ( int i = 0; i < aCountAppened; i++)
+  //  aSelectionListAttr->removeLast();
 }
 
 //********************************************************************
index 693572f4e087f6a90ba039bb5d05ab99693e82fa..d44edff7d13712196dd8a87d0760da975a869b69 100644 (file)
@@ -162,7 +162,8 @@ protected:
   std::string mySelectionType;
 
   /// Variable of GeomSelection
-  QList<GeomSelection> mySelection;
+  //QList<GeomSelection> mySelection;
+  int mySelectionCount; // number of elements in the attribute selection list when store
 
   bool myIsUseChoice;
 };