]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
sinusX p.9 // Export of profile
authorisn <isn@opencascade.com>
Thu, 18 Jun 2015 15:32:14 +0000 (18:32 +0300)
committerisn <isn@opencascade.com>
Thu, 18 Jun 2015 15:32:14 +0000 (18:32 +0300)
src/HYDROData/HYDROData_SinusX.cxx

index 3c8ff3cf35249618a34643c207effe7ecf2aeace..c24905b1bd55500d8d2dc41e522d1e349d52f1a5 100644 (file)
@@ -378,5 +378,33 @@ void HYDROData_SinusX::HydroToSX(QFile& theFile, NCollection_Sequence<Handle_HYD
                      << " 0.000\n"; 
       }
     }
+    else if (anEnt->IsKind( STANDARD_TYPE(HYDROData_Profile) ))
+    {
+      //Collect data
+      Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( anEnt );
+      HYDROData_ProfileUZ::PointsList aPointList = aProfile->GetParametricPoints();
+      bool IsClosed = aProfile->GetProfileUZ(false)->IsClosedSection(0);;
+      bool IsSpline = false;
+      if (aProfile->GetProfileUZ(false)->GetSectionType(0) == HYDROData_PolylineXY::SECTION_SPLINE)
+        IsSpline = true;
+      //Write to stream
+      aTextStream << "B P\n";
+      aTextStream << "CN " << aProfile->GetName() << "\n";
+      aTextStream << "CP " << IsClosed << " " << IsSpline << "\n";
+      gp_XY aLeftPoint(0.0, 0.0);
+      gp_XY aRightPoint(0.0, 0.0);
+      if (aProfile->GetLeftPoint(aLeftPoint, true) && aProfile->GetRightPoint(aRightPoint, true))
+        aTextStream << "CP " << QString::number(aLeftPoint.X(), 'f', 3) << " " <<
+                                QString::number(aLeftPoint.Y(), 'f', 3) << " " <<
+                                QString::number(aRightPoint.X(), 'f', 3) << " " <<
+                                QString::number(aRightPoint.Y(), 'f', 3) << "\n";
+      else
+        aTextStream << "CP 0.0 0.0 0.0 0.0\n";
+      aTextStream << "CP 2\n";
+      for (int k = aPointList.Lower(); k <= aPointList.Upper(); k++)
+         aTextStream << " " << QString::number(aPointList(k).X(), 'f', 3)  
+                     << " 0.000 "
+                     << QString::number(aPointList(k).Y(), 'f', 3) << "\n";  
+    }
   }
 }
\ No newline at end of file