]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_AttributeRefAttr.cpp
Salome HOME
Sources formated according to the codeing standards
[modules/shaper.git] / src / Model / Model_AttributeRefAttr.cpp
index 09ea70ef775211f01bb9791b1839982e12bc9248..560a3fd062f3202dd1ee99a1973b12d8bf68711f 100644 (file)
@@ -16,11 +16,11 @@ bool Model_AttributeRefAttr::isObject()
 
 void Model_AttributeRefAttr::setAttr(boost::shared_ptr<ModelAPI_Attribute> theAttr)
 {
-  boost::shared_ptr<Model_Data> aData = 
-    boost::dynamic_pointer_cast<Model_Data>(theAttr->owner()->data());
+  boost::shared_ptr<Model_Data> aData = boost::dynamic_pointer_cast<Model_Data>(
+      theAttr->owner()->data());
   string anID = aData->id(theAttr);
   if (myIsInitialized && object() == theAttr->owner() && myID->Get().IsEqual(anID.c_str()))
-    return; // nothing is changed
+    return;  // nothing is changed
 
   myRef->Set(aData->label().Father());
   myID->Set(aData->id(theAttr).c_str());
@@ -31,8 +31,7 @@ boost::shared_ptr<ModelAPI_Attribute> Model_AttributeRefAttr::attr()
 {
   ObjectPtr anObj = object();
   if (anObj) {
-    boost::shared_ptr<Model_Data> aData = 
-      boost::dynamic_pointer_cast<Model_Data>(anObj->data());
+    boost::shared_ptr<Model_Data> aData = boost::dynamic_pointer_cast<Model_Data>(anObj->data());
     return aData->attribute(TCollection_AsciiString(myID->Get()).ToCString());
   }
   // not initialized
@@ -42,19 +41,19 @@ boost::shared_ptr<ModelAPI_Attribute> Model_AttributeRefAttr::attr()
 void Model_AttributeRefAttr::setObject(ObjectPtr theObject)
 {
   if (!myIsInitialized || myID->Get().Length() != 0 || object() != theObject) {
-    boost::shared_ptr<Model_Data> aData = 
-      boost::dynamic_pointer_cast<Model_Data>(theObject->data());
+    boost::shared_ptr<Model_Data> aData = boost::dynamic_pointer_cast<Model_Data>(
+        theObject->data());
     myRef->Set(aData->label().Father());
-    myID->Set(""); // feature is identified by the empty ID
+    myID->Set("");  // feature is identified by the empty ID
     owner()->data()->sendAttributeUpdated(this);
   }
 }
 
 ObjectPtr Model_AttributeRefAttr::object()
 {
-  if (myRef->Get() != myRef->Label()) { // initialized
-    boost::shared_ptr<Model_Document> aDoc = 
-      boost::dynamic_pointer_cast<Model_Document>(owner()->document());
+  if (myRef->Get() != myRef->Label()) {  // initialized
+    boost::shared_ptr<Model_Document> aDoc = boost::dynamic_pointer_cast<Model_Document>(
+        owner()->document());
     if (aDoc) {
       TDF_Label aRefLab = myRef->Get();
       return aDoc->object(aRefLab);
@@ -70,7 +69,7 @@ Model_AttributeRefAttr::Model_AttributeRefAttr(TDF_Label& theLabel)
   if (!myIsInitialized) {
     // create attribute: not initialized by value yet
     myID = TDataStd_Comment::Set(theLabel, "");
-    myRef = TDF_Reference::Set(theLabel, theLabel); // not initialized: reference to itself
+    myRef = TDF_Reference::Set(theLabel, theLabel);  // not initialized: reference to itself
   } else {
     theLabel.FindAttribute(TDF_Reference::GetID(), myRef);
   }