if( aResult.IsNull() )
return false;
- aResult->SetName( GetName() + "_boundary" );
+ //search free name
+ QString aName = GetName() + "_boundary", anIndexedName;
+ Handle_HYDROData_Entity aFound = HYDROData_Tool::FindObjectByName( aDocument, aName );
+ if( aFound.IsNull() )
+ aResult->SetName( aName );
+ else
+ {
+ //use index
+ aName += "_%0";
+ int i = 1;
+ while( !aFound.IsNull() )
+ {
+ anIndexedName = aName.arg( i );
+ aFound = HYDROData_Tool::FindObjectByName( aDocument, anIndexedName );
+ i++;
+ }
+ aResult->SetName( anIndexedName );
+ }
double Xmin = 0.0, Xmax = 0.0, Ymin = 0.0, Ymax = 0.0;
bool isFirst = true;