myColorsShape[ theName ] = color;
}
-std::wstring Model_ResultBody::addShapeName(std::shared_ptr<GeomAPI_Shape> theshape,
+std::wstring Model_ResultBody::addShapeName(std::shared_ptr<GeomAPI_Shape> theShape,
const std::wstring& theName ){
int indice = 1;
std::wstringstream aName;
aName << theName;
- while(myNamesShape.find(aName.str()) != myNamesShape.end() ){
+ while(aName.str().empty() || myNamesShape.find(aName.str()) != myNamesShape.end() ){
aName.str(L"");
aName << theName << L"__" << indice;
indice++;
}
- myNamesShape[ aName.str() ] = theshape;
+ myNamesShape[ aName.str() ] = theShape;
return aName.str();
}