+Handle(HYDROData_IAltitudeObject) HYDROData_Object::getChildAltitudeObject() const
+{
+ 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();
+ 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";
+ QString anAltitudeName = HYDROData_Tool::GenerateObjectName( aDocument, anAltitudePref );
+ anAltitudeObject->SetName( anAltitudeName );
+
+ SetAltitudeObject( anAltitudeObject );
+}
+
+Handle(HYDROData_ShapesGroup) HYDROData_Object::createGroupObject()
+{
+ TDF_Label aNewLab = myLab.FindChild( DataTag_EdgesGroup ).NewChild();
+
+ Handle(HYDROData_ShapesGroup) aNewGroup =
+ Handle(HYDROData_ShapesGroup)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_SHAPES_GROUP ) );
+ AddReferenceObject( aNewGroup, DataTag_EdgesGroup );
+
+ return aNewGroup;
+}
+
+void HYDROData_Object::removeGroupObjects()
+{
+ TDF_Label aLabel = myLab.FindChild( DataTag_EdgesGroup, false );
+ if ( !aLabel.IsNull() )
+ aLabel.ForgetAllAttributes();
+}
+
+TopoDS_Shape HYDROData_Object::getTopShape() const
+{
+ TDF_Label aLabel = myLab.FindChild( DataTag_TopShape, false );
+ if ( !aLabel.IsNull() )
+ {
+ Handle(TNaming_NamedShape) aNamedShape;
+ if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
+ return aNamedShape->Get();
+ }
+
+ return TopoDS_Shape();
+}
+
+void HYDROData_Object::removeTopShape()
+{
+ TDF_Label aLabel = myLab.FindChild( DataTag_TopShape, false );
+ if ( !aLabel.IsNull() )
+ aLabel.ForgetAllAttributes();
+}
+
+TopoDS_Shape HYDROData_Object::getShape3D() const