+ Handle(HYDROData_IAltitudeObject) anObject;
+
+ TDF_Label aLabel = myLab.FindChild( DataTag_ChildAltitudeObject, false );
+ if ( !aLabel.IsNull() )
+ {
+ TDF_Label aChildLabel = aLabel.FindChild( 0, false );
+ if ( !aChildLabel.IsNull() )
+ {
+ anObject = Handle(HYDROData_IAltitudeObject)::DownCast(
+ HYDROData_Iterator::Object( aChildLabel ) );
+ }
+ }
+
+ return anObject;
+}
+
+void HYDROData_Object::checkAndSetAltitudeObject()
+{
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
+
+ ObjectKind anAltitudeObjectType = getAltitudeObjectType();
+ //DEBTRACE("HYDROData_Object::checkAndSetAltitudeObject anAltitudeObjectType="<< anAltitudeObjectType);
+ if ( anAltitudeObjectType == KIND_UNKNOWN )
+ return; // No need to create altitude object
+
+ TDF_Label aLabel = myLab.FindChild( DataTag_ChildAltitudeObject, false );
+ if ( !aLabel.IsNull() )
+ return;
+
+ TDF_Label aChildLabel = myLab.FindChild( DataTag_ChildAltitudeObject ).FindChild( 0 );
+
+ Handle(HYDROData_IAltitudeObject) anAltitudeObject =
+ Handle(HYDROData_IAltitudeObject)::DownCast(
+ HYDROData_Iterator::CreateObject( aChildLabel, anAltitudeObjectType ) );
+
+ QString anAltitudePref = GetName() + "_Altitude";
+ //DEBTRACE("anAltitudePref " << anAltitudePref.toStdString());
+ QString anAltitudeName = HYDROData_Tool::GenerateObjectName( aDocument, anAltitudePref );
+ anAltitudeObject->SetName( anAltitudeName );
+
+ SetAltitudeObject( anAltitudeObject );