Salome HOME
Temporary workaround for python.
[modules/hydro.git] / src / HYDROData / HYDROData_PolylineXY.cxx
index f462bff3e378a59f308e24c76cecb83f5c9863b6..d418144a2e1865ef4b2fa25d71411bc399ed1274 100755 (executable)
@@ -107,7 +107,7 @@ HYDROData_PolylineXY::~HYDROData_PolylineXY()
 QStringList HYDROData_PolylineXY::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
 {
   QStringList aResList = dumpObjectCreation( theTreatedObjects );
-  QString aPolylineName = GetName();
+  QString aPolylineName = GetObjPyName();
 
   // Set polilyne data
   NCollection_Sequence<TCollection_AsciiString>           aSectNames;
@@ -124,16 +124,20 @@ QStringList HYDROData_PolylineXY::DumpToPython( MapOfTreatedObjects& theTreatedO
     aResList << QString( "%1.AddSection( \"%2\", %3, %4 );" ).arg( aPolylineName )
                 .arg( aSectName.ToCString() ).arg( aSectType ).arg( aSectClosure );
 
-    HYDROData_PolylineXY::PointsList aSectPointsList = GetPoints( i );
+    HYDROData_IPolyline::PointsList aSectPointsList = GetPoints( i - 1 );
     for ( int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k )
     {
       const Point& aSectPoint = aSectPointsList.Value( k );
 
-      aResList << QString( "%1.AddPoint( %2, QPointF( %3, %4 ) );" ).arg( aPolylineName )
+      aResList << QString( "%1.AddPoint( %2, gp_XY( %3, %4 ) );" ).arg( aPolylineName )
         .arg( i - 1 ).arg( aSectPoint.X() ).arg( aSectPoint.Y() );
     }
   }
 
+  aResList << QString( "" );
+  aResList << QString( "%1.Update();" ).arg( aPolylineName );
+  aResList << QString( "" );
+
   return aResList;
 }