mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-03-16 22:27:55 +05:00
Dump Python. Solve pb of dif objects having same name. Correct entry detection
This commit is contained in:
parent
705488d6da
commit
fd4f2854ec
@ -396,11 +396,24 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
|
||||
anEntry = aScript.SubString(aSeq->Value(i), aSeq->Value(i+1));
|
||||
if(theObjectNames.IsBound(anEntry)) {
|
||||
aName = theObjectNames.Find(anEntry);
|
||||
if ( theObjectNames.IsBound( aName ) && anEntry != theObjectNames( aName ))
|
||||
{ // diff objects have same name - make a new name
|
||||
TCollection_AsciiString aName2;
|
||||
Standard_Integer i = 0;
|
||||
do {
|
||||
aName2 = aName + "_" + ++i;
|
||||
} while ( theObjectNames.IsBound( aName2 ) && anEntry != theObjectNames( aName2 ));
|
||||
aName = aName2;
|
||||
theObjectNames( anEntry ) = aName;
|
||||
}
|
||||
}
|
||||
else {
|
||||
do {
|
||||
aName = aBaseName + TCollection_AsciiString(++objectCounter);
|
||||
while(theObjectNames.IsBound(aName)) aName = aBaseName + TCollection_AsciiString(++objectCounter);
|
||||
} while(theObjectNames.IsBound(aName));
|
||||
theObjectNames.Bind(anEntry, aName);
|
||||
}
|
||||
theObjectNames.Bind(aName, anEntry); // to detect same name of diff objects
|
||||
|
||||
anUpdatedScript += aName;
|
||||
aNames.Bind(aName, "1");
|
||||
@ -474,7 +487,7 @@ Handle(TColStd_HSequenceOfInteger) FindEntries(TCollection_AsciiString& theStrin
|
||||
if(c == 58) isFound = Standard_True;
|
||||
}
|
||||
|
||||
if(isFound) {
|
||||
if(isFound && arr[j-2] != 58) { // last char should be a diggit
|
||||
aSeq->Append(i+1); // +1 because AsciiString starts from 1
|
||||
aSeq->Append(j-1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user