Salome HOME
PAL12781: EDF: different result between Working Plane and LCS. Implement and use...
authorjfa <jfa@opencascade.com>
Fri, 28 Jul 2006 12:53:23 +0000 (12:53 +0000)
committerjfa <jfa@opencascade.com>
Fri, 28 Jul 2006 12:53:23 +0000 (12:53 +0000)
doc/salome/version.texi
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx

index b787234408bf0c8c13dbf1f4f09495ebbc1255c1..7735c3f9f2ed02257b44cd3de591a676bfa1ea49 100644 (file)
@@ -1,4 +1,4 @@
 @set UPDATED 2 June 2006
 @set UPDATED-MONTH June 2006
-@set EDITION 3.2.0
-@set VERSION 3.2.0
+@set EDITION 3.2.1
+@set VERSION 3.2.1
index ed054fb2ecb984c83154d96070ea83f389044640..bed8d654220dee90bf03d8039ac95a0ff9acdbd2 100644 (file)
@@ -1527,16 +1527,27 @@ void SALOMEDSImpl_Study::Modify()
 //============================================================================
 Handle(SALOMEDSImpl_AttributeParameter) SALOMEDSImpl_Study::GetCommonParameters(const char* theID, int theSavePoint)
 {
-  if(theSavePoint < 0) return NULL;
+  if (theSavePoint < 0) return NULL;
   Handle(SALOMEDSImpl_StudyBuilder) builder = NewBuilder();
   Handle(SALOMEDSImpl_SObject) so = FindComponent((char*)theID);
-  if(so.IsNull()) so = builder->NewComponent((char*)theID); 
-  Handle(SALOMEDSImpl_SObject) newSO;
-  if(theSavePoint == 0) //Get an attribute that is placed on the component itself.
-    newSO = so;
-  else
-    newSO = builder->NewObjectToTag(so, theSavePoint);
-  return Handle(SALOMEDSImpl_AttributeParameter)::DownCast(builder->FindOrCreateAttribute(newSO, "AttributeParameter"));
+  if (so.IsNull()) so = builder->NewComponent((char*)theID); 
+
+  Handle(SALOMEDSImpl_AttributeParameter) attParam;
+  if (theSavePoint == 0) //Get an attribute that is placed on the component itself.
+    builder->FindAttribute(so, attParam, "AttributeParameter");
+  else { // Try to find SObject that contains attribute parameter ...
+    TDF_Label savePointLabel = so->GetLabel().FindChild( theSavePoint, /*create=*/0 );
+    if ( !savePointLabel.IsNull() ) {
+      so = GetSObject( savePointLabel );
+      builder->FindAttribute(so, attParam, "AttributeParameter");
+    } // ... if it does not exist - create a new one
+    else {
+      so = builder->NewObjectToTag( so, theSavePoint );
+      Handle(TDF_Attribute) att = builder->FindOrCreateAttribute(so, "AttributeParameter");
+      attParam = Handle(SALOMEDSImpl_AttributeParameter)::DownCast( att );
+    }
+  }
+  return attParam;
 }
 
 //============================================================================
index d47beb3dd8cd2e645a37834860f7c476337aa4b6..bf8215338077e14061dd44a317f7121db87883c4 100644 (file)
@@ -524,7 +524,8 @@ bool SALOMEDSImpl_StudyBuilder::FindAttribute(const Handle(SALOMEDSImpl_SObject)
   }
   TDF_Label Lab = anObject->GetLabel();
   if (Lab.FindAttribute(SALOMEDSImpl_SObject::GetGUID(aTypeOfAttribute), anAttribute)) {
-    _doc->Modify();  
+    // commented out because NO MODIFICATION is done to attributes when calling FindAttribute()
+    // _doc->Modify();  
     return Standard_True;
   }
   return Standard_False;