Salome HOME
Dump to python corrected.
[modules/hydro.git] / src / HYDROData / HYDROData_ProfileUZ.cxx
index 649c8096a824f2998204787f15d24015218032c8..8247cba5c64255dacdfc4933be416e3362ca48df 100755 (executable)
@@ -28,6 +28,35 @@ HYDROData_ProfileUZ::~HYDROData_ProfileUZ()
 {
 }
 
+QStringList HYDROData_ProfileUZ::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
+{
+  QStringList aResList = dumpObjectCreation( theTreatedObjects );
+  QString aName = GetObjPyName();
+
+  // Set polilyne data
+  const TCollection_AsciiString& aSectName = GetSectionName( 0 );
+  const SectionType& aSectType = GetSectionType( 0 );
+  bool aSectClosure = IsClosedSection( 0 );
+
+  aResList << QString( "%1.AddSection( \"%2\", %3, %4 );" ).arg( aName )
+              .arg( aSectName.ToCString() ).arg( aSectType ).arg( aSectClosure );
+
+  HYDROData_IPolyline::PointsList aSectPointsList = GetPoints( 0 );
+  for ( int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k )
+  {
+    const Point& aSectPoint = aSectPointsList.Value( k );
+
+    aResList << QString( "%1.AddPoint( 0, gp_XY( %2, %3 ) );" ).arg( aName )
+      .arg( aSectPoint.X() ).arg( aSectPoint.Y() );
+  }
+
+  aResList << QString( "" );
+  aResList << QString( "%1.Update();" ).arg( aName );
+  aResList << QString( "" );
+
+  return aResList;
+}
+
 TopoDS_Shape HYDROData_ProfileUZ::GetShape() const
 {
   // TODO