Salome HOME
Bug #490: batch mode error.
[modules/hydro.git] / src / HYDROData / HYDROData_Entity.cxx
index 4c1ed735f799d96d7bd44f9056b8f72733311ff0..ba2cb941f77c21b43c12ba93f98eb9ea7e5c00b9 100644 (file)
@@ -46,7 +46,10 @@ QString HYDROData_Entity::GetName() const
 
 QString HYDROData_Entity::GetObjPyName() const
 {
-  return GetName().replace(" ", "_");
+  QString aName = GetName();
+  aName.replace(QRegExp("[\\W]"), "_");
+
+  return aName;
 }
 
 void HYDROData_Entity::SetName(const QString& theName)
@@ -65,6 +68,11 @@ void HYDROData_Entity::Update()
   SetToUpdate( false );
 }
 
+void HYDROData_Entity::UpdateLocalCS( double theDx, double theDy )
+{
+  //On the base level no actions are necessary
+}
+
 bool HYDROData_Entity::IsHas2dPrs() const
 {
   return false;
@@ -615,4 +623,14 @@ void HYDROData_Entity::setPythonObjectColor( QStringList&         theScript,
               .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() );
+}