std::vector<TopoDS_Shape> aPolylines(1);
aPolylines[0] = aWireSet;
- CreatePolylines( theDoc, theName, aPolylines, false, QColor() );
+ QString aName = theName;
+ if( aName.isEmpty() )
+ aName = "merged";
+ CreatePolylines( theDoc, aName, aPolylines, true, QColor() );
return true;
}
aCurve.Intersect(aToolCurves[aTSI], aParams);
}
- std::deque<HYDROData_TopoCurve> aSplittedCurves;
- theIsIntersected |= aCurve.Cut(aParams, aSplittedCurves);
+ std::deque<HYDROData_TopoCurve> aSplitCurves;
+ theIsIntersected |= aCurve.Cut(aParams, aSplitCurves);
std::deque<HYDROData_TopoCurve>::const_iterator aCIt =
- aSplittedCurves.begin();
+ aSplitCurves.begin();
std::deque<HYDROData_TopoCurve>::const_iterator aLastCIt =
- aSplittedCurves.end();
+ aSplitCurves.end();
for (; aCIt != aLastCIt; ++aCIt)
{
aResult.push_back(aCIt->Wire());
if( isUseIndices )
{
QString aNewName = theNamePrefix + "_" + QString::number( anIndex );
- if( theDoc->FindObjectByName( aNewName ).IsNull() ) // the object with such a name is not found
- aPolyline->SetName( aNewName );
- anIndex++;
+ while( !theDoc->FindObjectByName( aNewName ).IsNull() ) // the object with such a name is not found
+ {
+ anIndex++;
+ aNewName = theNamePrefix + "_" + QString::number( anIndex );
+ }
+ aPolyline->SetName( aNewName );
}
else
{