From 07b16659000c1b02fba7369c5269f2acd2fe55e2 Mon Sep 17 00:00:00 2001 From: adv Date: Mon, 13 Jan 2014 07:17:03 +0000 Subject: [PATCH] Minor changes. --- src/HYDROData/HYDROData_Zone.cxx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/HYDROData/HYDROData_Zone.cxx b/src/HYDROData/HYDROData_Zone.cxx index 70272326..4d0675a2 100644 --- a/src/HYDROData/HYDROData_Zone.cxx +++ b/src/HYDROData/HYDROData_Zone.cxx @@ -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; } -- 2.39.2