Salome HOME
Make data located on the same level for features and results
[modules/shaper.git] / src / Model / Model_AttributeReference.cpp
index e2ff01ce7798975aa6e11d829c86281f6bfc99f5..a5540e7415845b1791a2860e8b40cfe6a8d30527 100644 (file)
 
 using namespace std;
 
-void Model_AttributeReference::setValue(FeaturePtr theFeature)
+void Model_AttributeReference::setValue(ObjectPtr theObject)
 {
-  if (!myIsInitialized || value() != theFeature) {
+  if (!myIsInitialized || value() != theObject) {
     boost::shared_ptr<Model_Data> aData = 
-      boost::dynamic_pointer_cast<Model_Data>(theFeature->data());
+      boost::dynamic_pointer_cast<Model_Data>(theObject->data());
     if (myRef.IsNull()) {
       boost::shared_ptr<Model_Data> aMyData = 
         boost::dynamic_pointer_cast<Model_Data>(owner()->data());
-      myRef = TDF_Reference::Set(aMyData->label(), aData->label());
+      myRef = TDF_Reference::Set(aMyData->label(), aData->label().Father());
     } else {
       myRef->Set(aData->label());
     }
@@ -26,14 +26,14 @@ void Model_AttributeReference::setValue(FeaturePtr theFeature)
   }
 }
 
-FeaturePtr Model_AttributeReference::value()
+ObjectPtr Model_AttributeReference::value()
 {
   if (!myRef.IsNull()) {
     boost::shared_ptr<Model_Document> aDoc = 
       boost::dynamic_pointer_cast<Model_Document>(owner()->document());
     if (aDoc) {
       TDF_Label aRefLab = myRef->Get();
-      return aDoc->feature(aRefLab);
+      return aDoc->object(aRefLab);
     }
   }
   // not initialized