From: isn Date: Thu, 18 Jun 2015 15:32:14 +0000 (+0300) Subject: sinusX p.9 // Export of profile X-Git-Tag: v1.4.2~54^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=229b20adf65815807511c388f2f0ddf96cd6c9bd;p=modules%2Fhydro.git sinusX p.9 // Export of profile --- diff --git a/src/HYDROData/HYDROData_SinusX.cxx b/src/HYDROData/HYDROData_SinusX.cxx index 3c8ff3cf..c24905b1 100644 --- a/src/HYDROData/HYDROData_SinusX.cxx +++ b/src/HYDROData/HYDROData_SinusX.cxx @@ -378,5 +378,33 @@ void HYDROData_SinusX::HydroToSX(QFile& theFile, NCollection_SequenceIsKind( 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