Salome HOME
Lot 2: change bathy associated to natural object propagated to all cases without...
[modules/hydro.git] / src / HYDROData / HYDROData_Stream.cxx
index 8b458e2a608d075efa342e498e8dc916408e5b10..431e22ae26511b81ca9f270acd67f6317ca80d72 100644 (file)
@@ -119,6 +119,10 @@ QStringList HYDROData_Stream::DumpToPython( const QString&       thePyScriptPath
   QStringList aResList = dumpObjectCreation( theTreatedObjects );
   QString aName = GetObjPyName();
 
+  int interpMethod = GetInterpolationMethod();
+  QString anInterpMethod = QString::number( interpMethod );
+  aResList << QString( "%1.SetInterpolationMethod( %2 )" ).arg( aName ).arg( anInterpMethod );
+
   Handle(HYDROData_PolylineXY) aHydAxis = GetHydraulicAxis();
   setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aHydAxis, "SetHydraulicAxis" );
 
@@ -135,10 +139,25 @@ QStringList HYDROData_Stream::DumpToPython( const QString&       thePyScriptPath
     setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aBottomPolyline, "SetBottomPolyline" );
   }
 
-  QString aDDZs = QString::number( GetDDZ(), 'f', 3 );
-  QString aSSteps = QString::number( GetSpatialStep(), 'f', 3 );
-  aResList << QString( "%1.SetDDZ( %2 )" ).arg( aName ).arg( aDDZs );
-  aResList << QString( "%1.SetSpatialStep( %2 )" ).arg( aName ).arg( aSSteps );
+  if (interpMethod==0)
+  {
+    QString aDDZs = QString::number( GetDDZ(), 'f', 3 );
+    QString aSSteps = QString::number( GetSpatialStep(), 'f', 3 );
+    aResList << QString( "%1.SetDDZ( %2 )" ).arg( aName ).arg( aDDZs );
+    aResList << QString( "%1.SetSpatialStep( %2 )" ).arg( aName ).arg( aSSteps );
+  }
+  else if (interpMethod==1)
+  {
+    Handle(HYDROData_PolylineXY) aLeftBank = GetLeftBank();
+    setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aLeftBank, "SetLeftBank" );
+    Handle(HYDROData_PolylineXY) aRightBank = GetRightBank();
+    setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRightBank, "SetRightBank" );
+
+    QString aHaxStep = QString::number( GetHaxStep(), 'f', 3 );
+    QString aNbProfilePoints = QString::number( GetNbProfilePoints() );
+    aResList << QString( "%1.SetHaxStep( %2 )" ).arg( aName ).arg( aHaxStep );
+    aResList << QString( "%1.SetNbProfilePoints( %2 )" ).arg( aName ).arg( aNbProfilePoints );
+  }
 
   aResList << QString( "" );
   aResList << QString( "%1.Update()" ).arg( aName );
@@ -1034,7 +1053,7 @@ void HYDROData_Stream::removeParameter( const int& theIndex )
 bool HYDROData_Stream::GenerateBottomPolyline()
 {
   // Get the document
-  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document();
   if ( aDocument.IsNull() ) {
     return false;
   }
@@ -1122,7 +1141,7 @@ bool HYDROData_Stream::SetBottomPolyline( const Handle(HYDROData_Polyline3D)& th
 bool HYDROData_Stream::Interpolate( HYDROData_IProfilesInterpolator* theInterpolator )
 {
   // Get the document
-  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document();
   if ( aDocument.IsNull() ) {
     return false;
   }
@@ -1174,7 +1193,7 @@ void HYDROData_Stream::CopyTo( const Handle(HYDROData_Entity)& theDestination,
                                bool isGenerateNewName ) const
 {
   // Get the document
-  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document();
   if ( aDocument.IsNull() ) {
     return;
   }