Salome HOME
Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into...
[modules/hydro.git] / src / HYDROData / HYDROData_Entity.cxx
index ceea46b60ff4305b7d9f45f61f3c90c129411b89..7857cbc7f10141e5be65fb8a30e687ea69d0444d 100644 (file)
@@ -87,7 +87,8 @@ void HYDROData_Entity::SetName(const QString& theName)
   TDataStd_Name::Set(myLab, TCollection_ExtendedString(theName.toLatin1().constData()));
 }
 
-QStringList HYDROData_Entity::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
+QStringList HYDROData_Entity::DumpToPython( const QString& thePyScriptPath,
+                                            MapOfTreatedObjects& theTreatedObjects ) const
 {
   QStringList anEmptyList;
   return anEmptyList;
@@ -165,6 +166,8 @@ void HYDROData_Entity::Changed( Geometry theChangedGeometry )
   for ( ; anIter.More(); anIter.Next() )
   {
     Handle(HYDROData_Entity) anObject = anIter.Current();
+    if( anObject.IsNull() )
+      continue;
     HYDROData_SequenceOfObjects aRefSeq = anObject->GetAllReferenceObjects();
     for ( int i = 1, n = aRefSeq.Length(); i <= n; ++i )
     {
@@ -646,18 +649,19 @@ QString HYDROData_Entity::getPyTypeID() const
     case KIND_STREAM_ALTITUDE:   return "KIND_STREAM_ALTITUDE";
     case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE";
     case KIND_STRICKLER_TABLE:   return "KIND_STRICKLER_TABLE";
-    case KIND_LAND_COVER:        return "KIND_LAND_COVER";
+    case KIND_LAND_COVER_OBSOLETE: return "";
     case KIND_LAND_COVER_MAP:    return "KIND_LAND_COVER_MAP";
     default:                     return "KIND_UNKNOWN"; ///! Unrecognized object
   }
 }
 
-void HYDROData_Entity::setPythonReferenceObject( MapOfTreatedObjects&            theTreatedObjects,
+void HYDROData_Entity::setPythonReferenceObject( const QString&                  thePyScriptPath,
+                                                 MapOfTreatedObjects&            theTreatedObjects,
                                                  QStringList&                    theScript,
                                                  const Handle(HYDROData_Entity)& theRefObject,
                                                  const QString&                  theMethod ) const
 {
-  if ( !checkObjectPythonDefinition( theTreatedObjects, theScript, theRefObject ) )
+  if ( !checkObjectPythonDefinition( thePyScriptPath, theTreatedObjects, theScript, theRefObject ) )
     return;
 
   QString aRefObjName = theRefObject->GetObjPyName();
@@ -667,7 +671,8 @@ void HYDROData_Entity::setPythonReferenceObject( MapOfTreatedObjects&
                .arg( anObjName ).arg( theMethod ).arg( aRefObjName );
 }
 
-bool HYDROData_Entity::checkObjectPythonDefinition( MapOfTreatedObjects&            theTreatedObjects,
+bool HYDROData_Entity::checkObjectPythonDefinition( const QString&                  thePyScriptPath,
+                                                    MapOfTreatedObjects&            theTreatedObjects,
                                                     QStringList&                    theScript,
                                                     const Handle(HYDROData_Entity)& theRefObject ) const
 {
@@ -682,7 +687,7 @@ bool HYDROData_Entity::checkObjectPythonDefinition( MapOfTreatedObjects&
     return true;
 
   // The definition of reference object must be dumped before this
-  QStringList aRefObjDump = theRefObject->DumpToPython( theTreatedObjects );
+  QStringList aRefObjDump = theRefObject->DumpToPython( thePyScriptPath, theTreatedObjects );
   if ( aRefObjDump.isEmpty() )
     return false;