- QString aSectName = HYDROGUI_Tool::ToQString( aSectNames.Value( i ) );
- HYDROData_PolylineXY::SectionType aSectType = aSectTypes.Value( i );
- bool aSectClosure = aSectClosures.Value( i );
-
- CurveCreator::SectionType aCurveType = CurveCreator::Polyline;
- if( aSectType == HYDROData_PolylineXY::SECTION_SPLINE )
- aCurveType = CurveCreator::Spline;
-
- CurveCreator::Coordinates aCurveCoords;
-
- HYDROData_PolylineXY::PointsList aSectPointsList = myEditedObject->GetPoints( i - 1 );
- for ( int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k )
+ for ( int i = 1, n = aSectNames.Size(); i <= n; ++i )
+ {
+ QString aSectName = HYDROGUI_Tool::ToQString( aSectNames.Value( i ) );
+ HYDROData_PolylineXY::SectionType aSectType = aSectTypes.Value( i );
+ bool aSectClosure = aSectClosures.Value( i );
+
+ CurveCreator::SectionType aCurveType = CurveCreator::Polyline;
+ if( aSectType == HYDROData_PolylineXY::SECTION_SPLINE )
+ aCurveType = CurveCreator::Spline;
+
+ CurveCreator::Coordinates aCurveCoords;
+
+ HYDROData_PolylineXY::PointsList aSectPointsList =
+ myEditedObject->GetPoints( i - 1 );
+ for (int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k)
+ {
+ const HYDROData_PolylineXY::Point& aSectPoint =
+ aSectPointsList.Value( k );
+ aCurveCoords.push_back( aSectPoint.X() );
+ aCurveCoords.push_back( aSectPoint.Y() );
+ }
+
+ myCurve->addSectionInternal( aSectName.toStdString(),
+ aCurveType, aSectClosure, aCurveCoords );
+ }
+ }
+ else
+ {
+ std::deque<CurveCreator::Coordinates> aPs;
+ std::deque<bool> isCloseds;
+ std::vector<TopoDS_Wire> aWires;
+ HYDROData_PolylineOperator::GetWires(myEditedObject, aWires);
+ const int aSCount = aWires.size();
+ bool isError = false;
+ for (int aSI = 0; aSI < aSCount; ++aSI)