Salome HOME
Result attributes validators created
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetFeatureOrAttribute.cpp
index a26a70d0ac81c569af8b5c72af442f1b1fe28e47..633adbc439e22e36df7a632acd878b5fd734b47d 100644 (file)
@@ -11,7 +11,7 @@
 #include <Config_WidgetAPI.h>
 
 #include <Events_Loop.h>
-#include <Model_Events.h>
+#include <ModelAPI_Events.h>
 
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Data.h>
@@ -29,8 +29,9 @@
 #include <QLabel>
 
 ModuleBase_WidgetFeatureOrAttribute::ModuleBase_WidgetFeatureOrAttribute(QWidget* theParent,
-                                                   const Config_WidgetAPI* theData)
-: ModuleBase_WidgetFeature(theParent, theData)
+                                                   const Config_WidgetAPI* theData, 
+                                                   const std::string& theParentId)
+: ModuleBase_WidgetFeature(theParent, theData, theParentId)
 {
 }
 
@@ -47,10 +48,9 @@ bool ModuleBase_WidgetFeatureOrAttribute::setValue(ModuleBase_WidgetValue* theVa
                          dynamic_cast<ModuleBase_WidgetValueFeature*>(theValue);
     if (aFeatureValue) {
       boost::shared_ptr<GeomAPI_Pnt2d> aValuePoint = aFeatureValue->point();
-      //TODO
-/*      FeaturePtr aValueFeature = aFeatureValue->feature();
+      ObjectPtr aValueFeature = aFeatureValue->object();
       if (aValueFeature) {
-        isDone = setFeature(aValueFeature);
+        isDone = setObject(aValueFeature);
       }
       if (!isDone && aValuePoint) {
         // find the given point in the feature attributes
@@ -67,7 +67,7 @@ bool ModuleBase_WidgetFeatureOrAttribute::setValue(ModuleBase_WidgetValue* theVa
         }
         if (aFPoint)
           isDone = setAttribute(aFPoint);
-      }*/
+      }
     }
   }
   return isDone;
@@ -80,8 +80,8 @@ bool ModuleBase_WidgetFeatureOrAttribute::storeValue(FeaturePtr theFeature) cons
           boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(attributeID()));
 
   ModuleBase_WidgetFeatureOrAttribute* that = (ModuleBase_WidgetFeatureOrAttribute*) this;
-  if (feature())
-    aRef->setObject(feature());
+  if (object())
+    aRef->setObject(object());
   else if (myAttribute)
     aRef->setAttr(myAttribute);
 
@@ -99,7 +99,7 @@ bool ModuleBase_WidgetFeatureOrAttribute::restoreValue(FeaturePtr theFeature)
 
   FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(aRef->object());
   if (aFeature) {
-    setFeature(aFeature);
+    setObject(aFeature);
     myAttribute = aRef->attr();
 
     std::string aText = "";