- append( aToolCurves, GetWires( aToolPolyline ) );
- }
-
- bool isOK = true;
-
- int n = aCurves.size();
- std::vector<TopoDS_Shape> aResults( n );
- for( int i=0; i<n; i++ )
- aResults[i] = aCurves[i];
-
- for( int j=0, m=aToolCurves.size(); j<m; j++ )
- {
- std::vector<TopoDS_Shape> aNewResults;
- for( int k=0, q=aResults.size(); k<q; k++ )
- {
- std::vector<TopoDS_Shape> aCurvesList = Split( TopoDS::Wire( aResults[k] ), aToolCurves[j], theTolerance );
- append( aNewResults, aCurvesList );
- }
- aResults = aNewResults;
- }
-
- CreatePolylines( theDoc, thePolyline->GetName(), aResults, true );
-
- return isOK;
-}
-
-std::vector<TopoDS_Wire> HYDROData_PolylineOperator::GetWires( const Handle( HYDROData_PolylineXY )& thePolyline )
-{
- std::vector<TopoDS_Wire> aResult;
-
- TopoDS_Shape aShape = thePolyline->GetShape();
-
- if( aShape.ShapeType()==TopAbs_WIRE )
- {
- aResult.push_back( TopoDS::Wire( aShape ) );
- }
- else
- {
- TopExp_Explorer anExp( aShape, TopAbs_WIRE );
- for( ; anExp.More(); anExp.Next() )
- {
- aResult.push_back( TopoDS::Wire( anExp.Current() ) );
- }
- }
- return aResult;
-}
-
-static Standard_Boolean OrderCurveEdges(
- const TopoDS_Wire& theWire,
- NCollection_Vector<TopoDS_Edge>& theEdges,
- Standard_Boolean& theIsClosed)
-{
- TopTools_IndexedDataMapOfShapeListOfShape aVertexToEdges;
- TopExp::MapShapesAndAncestors(theWire,
- TopAbs_VERTEX, TopAbs_EDGE, aVertexToEdges);
- const Standard_Integer aVCount = aVertexToEdges.Extent();
- if (aVCount == 0)
- {
- return Standard_False;
- }
-
- {
- Standard_Integer aEndCount = 0;
- for (Standard_Integer aVN = 1; aVN <= aVCount; ++aVN)
- {
- const Standard_Integer aEdgeCount =
- aVertexToEdges.FindFromIndex(aVN).Extent();
- if (aEdgeCount == 1)