+void HYDROData_Entity::SetNameInDumpPython(QStringList& theScript,
+ QString theName) const
+{
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
+ if ( aDocument.IsNull() )
+ return;
+
+ if (theName.isEmpty())
+ theScript << QString( "%1.SetName( \"%2\" )" ).arg( GetObjPyName() )
+ .arg( GetName() );
+ else
+ theScript << QString( "%1.SetName( \"%2\" )" ).arg( GetObjPyName() )
+ .arg( theName );
+}
+
+void HYDROData_Entity::SetShape( int theTag, const TopoDS_Shape& theShape )
+{
+ TNaming_Builder aBuilder( myLab.FindChild( theTag ) );
+ aBuilder.Generated( theShape );
+}
+
+TopoDS_Shape HYDROData_Entity::GetShape( int theTag ) const
+{
+ TDF_Label aShapeLabel = myLab.FindChild( theTag, false );
+ if ( !aShapeLabel.IsNull() )
+ {
+ Handle(TNaming_NamedShape) aNamedShape;
+ if ( aShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
+ return aNamedShape->Get();
+ }
+ return TopoDS_Shape();
+}
+
+void HYDROData_Entity::SetDouble( int theTag, double theValue )
+{
+ Handle(TDataStd_Real) anAttr;
+ TDF_Label aLabel = myLab.FindChild( theTag );
+ if( !aLabel.FindAttribute( TDataStd_Real::GetID(), anAttr ) )
+ aLabel.AddAttribute( anAttr = new TDataStd_Real() );
+ anAttr->Set( theValue );
+}
+
+double HYDROData_Entity::GetDouble( int theTag, double theDefValue ) const
+{
+ Handle(TDataStd_Real) anAttr;
+ TDF_Label aLabel = myLab.FindChild( theTag );
+ if( !aLabel.FindAttribute( TDataStd_Real::GetID(), anAttr ) )
+ return theDefValue;
+
+ return anAttr->Get();
+}
+
+void HYDROData_Entity::SetInteger( int theTag, int theValue )
+{
+ Handle(TDataStd_Integer) anAttr;
+ TDF_Label aLabel = myLab.FindChild( theTag );
+ if( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) )
+ aLabel.AddAttribute( anAttr = new TDataStd_Integer() );
+ anAttr->Set( theValue );
+}
+
+int HYDROData_Entity::GetInteger( int theTag, int theDefValue ) const
+{
+ Handle(TDataStd_Integer) anAttr;
+ TDF_Label aLabel = myLab.FindChild( theTag );
+ if( !aLabel.FindAttribute( TDataStd_Integer::GetID(), anAttr ) )
+ return 0;
+
+ return anAttr->Get();
+}