QString HYDROData_Entity::GetObjPyName() const
{
- return GetName().replace(" ", "_");
+ QString aName = GetName();
+ aName.replace(QRegExp("[\\W]"), "_");
+
+ return aName;
}
void HYDROData_Entity::SetName(const QString& theName)
.arg( theColor.blue() ).arg( theColor.alpha() );
}
-
+void HYDROData_Entity::findPythonReferenceObject( MapOfTreatedObjects& theTreatedObjects,
+ QStringList& theScript ) const
+{
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
+ if ( aDocument.IsNull() )
+ return;
+
+ theScript << QString( "%1 = %2.FindObjectByName( \"%3\" );" ).arg( GetObjPyName() )
+ .arg( aDocument->GetDocPyName() )
+ .arg( GetName() );
+}