}
QString aName = theName;
if( aName.isEmpty() )
- aName = "merged";
+ {
+ aName = "merged";
+ int anIndex = 1;
+ QString aNewName = aName + "_" + QString::number(anIndex);
+ while (!theDoc->FindObjectByName(aNewName).IsNull()) // the object with such a name is not found
+ {
+ anIndex++;
+ aNewName = aName + "_" + QString::number(anIndex);
+ }
+ aName = aNewName;
+ }
+
aNewPolyline->SetName(aName);
+ aNewPolyline->Update();
return true;
}
for (int aPSI = 0; aPSI < aPSCount; ++aPSI)
{
HYDROData_TopoCurve aCurve;
- DEBTRACE("Initialize curve " << aPSI);
+ //DEBTRACE("Initialize curve " << aPSI);
if (!aCurve.Initialize(aCurves[aPSI]))
{
continue;
aSplitCurves.end();
for (int iw=0; aCIt != aLastCIt; ++aCIt, iw++)
{
- std::stringstream brepName;
+ /*std::stringstream brepName;
brepName << "theSplitWire_";
brepName << iw;
brepName << ".brep";
- BRepTools::Write(aCIt->Wire() , brepName.str().c_str() );
+ BRepTools::Write(aCIt->Wire() , brepName.str().c_str() );*/
aResult.push_back(aCIt->Wire());
}
}
CreatePolylines( theDoc, thePolyline, aResult, true );
- //CreatePolylinesSplit( theDoc, thePolyline, aResult, true );
return true;
}
const QColor& theColor = theOldPolyline->GetWireColor();
int n = theShapes.size();
- DEBTRACE("theShapes.size() "<< n);
+ //DEBTRACE("theShapes.size() "<< n);
int anIndex = 1;
for( int i=0; i<n; i++ )
{
return false;
aPolyline->ImportShape(theShapes[i], false, theOldPolyline, false);
- //aPolyline->SetShape( theShapes[i] );
-
if( isUseIndices )
{