]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Minor changes.
authoradv <adv@opencascade.com>
Mon, 13 Jan 2014 07:17:03 +0000 (07:17 +0000)
committeradv <adv@opencascade.com>
Mon, 13 Jan 2014 07:17:03 +0000 (07:17 +0000)
src/HYDROData/HYDROData_Zone.cxx

index 70272326726f6cf06226ebd22cae9ae70884d477..4d0675a2eed68d5f7b7ebbdba436c5e0b1c69918 100644 (file)
@@ -91,9 +91,14 @@ void HYDROData_Zone::SetShape( const TopoDS_Shape& theShape )
 
 TopoDS_Shape HYDROData_Zone::GetShape() const
 {
-  Handle(TNaming_NamedShape) aNamedShape;
-  if( myLab.FindChild( DataTag_Shape ).FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
-    return aNamedShape->Get();
+  TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false );
+  if ( !aLabel.IsNull() )
+  {
+    Handle(TNaming_NamedShape) aNamedShape;
+    if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
+      return aNamedShape->Get();
+  }
+
   return TopoDS_Shape();
 }
 
@@ -144,9 +149,13 @@ HYDROData_Zone::MergeAltitudesType HYDROData_Zone::GetMergeType() const
 {
   MergeAltitudesType aMergeType = Merge_UNKNOWN;
   
-  Handle(TDataStd_Integer) anInt;
-  if ( myLab.FindChild( DataTag_MergeType ).FindAttribute( TDataStd_Integer::GetID(), anInt ) )
-    aMergeType = (MergeAltitudesType)anInt->Get();
+  TDF_Label aLabel = myLab.FindChild( DataTag_MergeType, false );
+  if ( !aLabel.IsNull() )
+  {
+    Handle(TDataStd_Integer) anInt;
+    if ( aLabel.FindAttribute( TDataStd_Integer::GetID(), anInt ) )
+      aMergeType = (MergeAltitudesType)anInt->Get();
+  }
 
   return aMergeType;
 }
@@ -180,6 +189,7 @@ bool HYDROData_Zone::AddGeometryObject( const Handle(HYDROData_Object)& theObjec
     return false; // Object is already in reference list
 
   AddReferenceObject( theObject, DataTag_GeometryObject );
+
   return true;
 }