]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
Salome HOME
Union of validator and filter functionalities.
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetShapeSelector.cpp
index 7fc40261487056aa53dd9085efdb0b54e9cc8d69..b981a9064f1c92dd6544abec6ab6582be780e4e0 100644 (file)
@@ -370,37 +370,33 @@ void ModuleBase_WidgetShapeSelector::activateCustom()
 }
 
 //********************************************************************
-void ModuleBase_WidgetShapeSelector::backupAttributeValue(const bool isBackup)
+void ModuleBase_WidgetShapeSelector::storeAttributeValue()
 {
   DataPtr aData = myFeature->data();
   AttributePtr anAttribute = myFeature->attribute(attributeID());
 
-  if (isBackup) {
-    myObject = GeomValidators_Tools::getObject(anAttribute);
-    myShape = getShape();
-    myRefAttribute = NULL;
-    myIsObject = false;
-    AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
-    if (aRefAttr) {
-      myIsObject = aRefAttr->isObject();
-      myRefAttribute = aRefAttr->attr();
-    }
-    myExternalObject = NULL;
+  myObject = GeomValidators_Tools::getObject(anAttribute);
+  myShape = getShape();
+  myRefAttribute = NULL;
+  myIsObject = false;
+  AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
+  if (aRefAttr) {
+    myIsObject = aRefAttr->isObject();
+    myRefAttribute = aRefAttr->attr();
   }
-  else {
-    storeAttributeValues(myObject, myShape);
-    AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
-    if (aRefAttr) {
-      if (!myIsObject)
-        aRefAttr->setAttr(myRefAttribute);
-    }
-    if (myExternalObject.get()) {
-      DocumentPtr aDoc = myExternalObject->document();
-      FeaturePtr aFeature = ModelAPI_Feature::feature(myExternalObject);
-      if (aFeature.get() != NULL) {
-        aDoc->removeFeature(aFeature);
-      }
-    }
+}
+
+//********************************************************************
+void ModuleBase_WidgetShapeSelector::restoreAttributeValue(bool theValid)
+{
+  DataPtr aData = myFeature->data();
+  AttributePtr anAttribute = myFeature->attribute(attributeID());
+
+  storeAttributeValues(myObject, myShape);
+  AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
+  if (aRefAttr) {
+    if (!myIsObject)
+      aRefAttr->setAttr(myRefAttribute);
   }
 }