}
return aResColor;
-}
\ No newline at end of file
+}
+
+void HYDROData_Object::setPythonReferenceObject( MapOfTreatedObjects& theTreatedObjects,
+ QStringList& theScript,
+ const Handle(HYDROData_Object)& theRefObject,
+ const QString& theMethod ) const
+{
+ if ( theRefObject.IsNull() )
+ return;
+
+ QString aRefObjName = theRefObject->GetName();
+ if ( aRefObjName.isEmpty() )
+ return;
+
+ bool anIsToSetObject = true;
+
+ // The definition of reference polyline must be dumped before this
+ if ( !theTreatedObjects.contains( aRefObjName ) )
+ {
+ // Write definition of reference polyline
+ QStringList aRefObjDump = theRefObject->DumpToPython( theTreatedObjects );
+ if ( ( anIsToSetObject = !aRefObjDump.isEmpty() ) )
+ {
+ QStringList aTmpList = theScript;
+ theScript = aRefObjDump;
+
+ theScript << QString( "" );
+ theScript << aTmpList;
+
+ theTreatedObjects.insert( aRefObjName, theRefObject );
+ }
+ }
+
+ if ( anIsToSetObject )
+ {
+ theScript << QString( "%1.%2( %3 );" )
+ .arg( GetName() ).arg( theMethod ).arg( aRefObjName );
+ }
+}
+
+