Salome HOME
Merge branch 'master' of newgeom:newgeom.git
authorsbh <sergey.belash@opencascade.com>
Tue, 13 May 2014 11:40:42 +0000 (15:40 +0400)
committersbh <sergey.belash@opencascade.com>
Tue, 13 May 2014 11:40:42 +0000 (15:40 +0400)
src/GeomData/GeomData_Dir.cpp
src/GeomData/GeomData_Point.cpp
src/GeomData/GeomData_Point2D.cpp
src/Model/Model_AttributeDocRef.cpp
src/Model/Model_AttributeDouble.cpp
src/Model/Model_AttributeRefAttr.cpp
src/Model/Model_AttributeRefList.cpp
src/Model/Model_AttributeReference.cpp
src/ModelAPI/ModelAPI_Attribute.h

index 5090a06267f562b7ccc9bb141e6c9b829bf7f05e..070e94562ff56705f0276b3baf85fec704454e78 100644 (file)
@@ -17,7 +17,7 @@ void GeomData_Dir::setValue(const double theX, const double theY, const double t
     myCoords->SetValue(1, theY);
     myCoords->SetValue(2, theZ);
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
-    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
     Events_Loop::loop()->send(aMsg);
   }
 }
index faf24fe99faf49a69c14d9afd7ce7526013d60af..6ad2ac56479b99942b5c4c2ac55be0947aedb3a9 100644 (file)
@@ -16,7 +16,7 @@ void GeomData_Point::setValue(const double theX, const double theY, const double
     myCoords->SetValue(1, theY);
     myCoords->SetValue(2, theZ);
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
-    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
     Events_Loop::loop()->send(aMsg);
   }
 }
index bbf3e55fb578d27d567beb57409ce69f80ff9457..8af702953a020f407e2360e2b054f1ec87f60820 100644 (file)
@@ -14,7 +14,7 @@ void GeomData_Point2D::setValue(const double theX, const double theY)
     myCoords->SetValue(0, theX);
     myCoords->SetValue(1, theY);
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
-    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
     Events_Loop::loop()->send(aMsg);
   }
 }
index 82492e2d6dcac4b2850f46a12f67012823677d4e..93c8af71346ce82569f5cea6cf867f8b0d8ac55b 100644 (file)
@@ -16,7 +16,7 @@ void Model_AttributeDocRef::setValue(boost::shared_ptr<ModelAPI_Document> theDoc
     myComment->Set(TCollection_ExtendedString(theDoc->id().c_str()));
 
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
-    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
     Events_Loop::loop()->send(aMsg);
   }
 }
index 13b4c97c650b8984971a2e0fdb7689432304a463..88b4352a56d288dd8b3b0c81a7acfdc28e5ce82f 100644 (file)
@@ -13,7 +13,7 @@ void Model_AttributeDouble::setValue(const double theValue)
   if (myReal->Get() != theValue) {
     myReal->Set(theValue);
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
-    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
     Events_Loop::loop()->send(aMsg);
   }
 }
index a74bb11ba2e24a22b0b0044357ee0fe3b7c307cd..2d7a1bd5e4fa9d1754c9183fb13595f232940cc2 100644 (file)
@@ -19,9 +19,9 @@ bool Model_AttributeRefAttr::isFeature()
 void Model_AttributeRefAttr::setAttr(boost::shared_ptr<ModelAPI_Attribute> theAttr)
 {
   boost::shared_ptr<Model_Data> aData = 
-    boost::dynamic_pointer_cast<Model_Data>(theAttr->feature()->data());
+    boost::dynamic_pointer_cast<Model_Data>(theAttr->owner()->data());
   string anID = aData->id(theAttr);
-  if (feature() == theAttr->feature() && myID->Get().IsEqual(anID.c_str()))
+  if (feature() == theAttr->owner() && myID->Get().IsEqual(anID.c_str()))
     return; // nothing is changed
 
   myRef->Set(aData->label());
@@ -53,7 +53,7 @@ void Model_AttributeRefAttr::setFeature(boost::shared_ptr<ModelAPI_Feature> theF
     myID->Set(""); // feature is identified by the empty ID
 
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
-    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
     Events_Loop::loop()->send(aMsg);
   }
 }
@@ -62,7 +62,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_AttributeRefAttr::feature()
 {
   if (myRef->Get() != myRef->Label()) { // initialized
     boost::shared_ptr<Model_Document> aDoc = 
-      boost::dynamic_pointer_cast<Model_Document>(feature()->document());
+      boost::dynamic_pointer_cast<Model_Document>(owner()->document());
     if (aDoc) {
       TDF_Label aRefLab = myRef->Get();
       TDF_Label aFeatureLab = aRefLab.Father();
index 0366e0a77dc9ab372d87a7f9a4541ee24ef7472f..f6520fce869300ecaacfa0ee092dd0fece340583 100644 (file)
@@ -19,7 +19,7 @@ void Model_AttributeRefList::append(boost::shared_ptr<ModelAPI_Feature> theFeatu
   myRef->Append(aData->label());
 
   static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
-  Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+  Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
   Events_Loop::loop()->send(aMsg);
 }
 
@@ -40,7 +40,7 @@ list<boost::shared_ptr<ModelAPI_Feature> > Model_AttributeRefList::list()
 {
   std::list< boost::shared_ptr<ModelAPI_Feature> > aResult;
   boost::shared_ptr<Model_Document> aDoc = 
-    boost::dynamic_pointer_cast<Model_Document>(feature()->document());
+    boost::dynamic_pointer_cast<Model_Document>(owner()->document());
   if (aDoc) {
     const TDF_LabelList& aList = myRef->List();
     for(TDF_ListIteratorOfLabelList aLIter(aList); aLIter.More(); aLIter.Next()) {
index ab247fdc9d72db1835ca3635e3731cbcfeb15e5d..105639b742fdda4b3b8b17887361e436875b2ff3 100644 (file)
@@ -18,14 +18,14 @@ void Model_AttributeReference::setValue(boost::shared_ptr<ModelAPI_Feature> theF
       boost::dynamic_pointer_cast<Model_Data>(theFeature->data());
     if (myRef.IsNull()) {
       boost::shared_ptr<Model_Data> aMyData = 
-        boost::dynamic_pointer_cast<Model_Data>(feature()->data());
+        boost::dynamic_pointer_cast<Model_Data>(owner()->data());
       TDF_Reference::Set(aMyData->label(), aData->label());
     } else {
       myRef->Set(aData->label());
     }
 
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
-    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
     Events_Loop::loop()->send(aMsg);
   }
 }
@@ -34,7 +34,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_AttributeReference::value()
 {
   if (!myRef.IsNull()) {
     boost::shared_ptr<Model_Document> aDoc = 
-      boost::dynamic_pointer_cast<Model_Document>(feature()->document());
+      boost::dynamic_pointer_cast<Model_Document>(owner()->document());
     if (aDoc) {
       TDF_Label aRefLab = myRef->Get();
       return aDoc->feature(aRefLab);
index d00bbc76a4d8132db951fd9f71a2440384d82e12..acea353df4d61d3be87566b1ea1da3232a3fe844 100644 (file)
@@ -32,7 +32,7 @@ public:
     {myFeature = theFeature;}
 
   /// Returns the owner of this attribute
-  MODELAPI_EXPORT const boost::shared_ptr<ModelAPI_Feature>& feature()
+  MODELAPI_EXPORT const boost::shared_ptr<ModelAPI_Feature>& owner()
   {return myFeature;}
 protected:
   /// Objects are created for features automatically