Salome HOME
projects
/
modules
/
smesh.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c85f79d
)
In dump script avoid removing missing geom objects
author
eap
<eap@opencascade.com>
Mon, 10 Aug 2020 14:43:45 +0000
(17:43 +0300)
committer
eap
<eap@opencascade.com>
Mon, 10 Aug 2020 14:43:45 +0000
(17:43 +0300)
src/SMESH_I/SMESH_PythonDump.cxx
patch
|
blob
|
history
diff --git
a/src/SMESH_I/SMESH_PythonDump.cxx
b/src/SMESH_I/SMESH_PythonDump.cxx
index e1c3002c0a583800cfd546adf15618eb0b3c12ba..a0976694911ad6e9e32af116d6c95d5835ef00f5 100644
(file)
--- a/
src/SMESH_I/SMESH_PythonDump.cxx
+++ b/
src/SMESH_I/SMESH_PythonDump.cxx
@@
-1080,10
+1080,15
@@
TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
TCollection_AsciiString anUpdatedScript;
Resource_DataMapOfAsciiStringAsciiString mapRemoved;
TCollection_AsciiString anUpdatedScript;
Resource_DataMapOfAsciiStringAsciiString mapRemoved;
- Resource_DataMapOfAsciiStringAsciiString mapEntries; //
names and entries
present in anUpdatedScript
+ Resource_DataMapOfAsciiStringAsciiString mapEntries; //
{ entry: name }
present in anUpdatedScript
Standard_Integer objectCounter = 0;
TCollection_AsciiString anEntry, aName, aGUIName, aBaseName("smeshObj_");
Standard_Integer objectCounter = 0;
TCollection_AsciiString anEntry, aName, aGUIName, aBaseName("smeshObj_");
+ std::string compDataType = ComponentDataType(); // SMESH module's data type
+ SALOMEDS::SComponent_var smeshSO = getStudyServant()->FindComponent( compDataType.c_str() );
+ CORBA::String_var smeshID = smeshSO->GetID();
+ TCollection_AsciiString smeshEntry = smeshID.in();
+
// Treat every script line and add it to anUpdatedScript
for ( linesIt = lines.begin(); linesIt != lines.end(); ++linesIt )
{
// Treat every script line and add it to anUpdatedScript
for ( linesIt = lines.begin(); linesIt != lines.end(); ++linesIt )
{
@@
-1135,15
+1140,22
@@
TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
}
else
{
}
else
{
- // Removed Object
- do {
- aName = aBaseName + (++objectCounter);
- } while (theObjectNames.IsBound(aName));
+ if ( !anEntry.StartsWith( smeshEntry )) // not SMESH object
+ {
+ aName = SMESH::TPythonDump::NotPublishedObjectName();
+ }
+ else
+ {
+ // Removed Object
+ do {
+ aName = aBaseName + (++objectCounter);
+ } while (theObjectNames.IsBound(aName));
- if ( !aRemovedObjIDs.count( anEntry ) && aLine.Value(1) != '#')
- mapRemoved.Bind(anEntry, aName);
+
if ( !aRemovedObjIDs.count( anEntry ) && aLine.Value(1) != '#')
+
mapRemoved.Bind(anEntry, aName);
- theObjectNames.Bind(anEntry, aName);
+ theObjectNames.Bind(anEntry, aName);
+ }
}
theObjectNames.Bind(aName, anEntry); // to detect same name of diff objects
}
}
theObjectNames.Bind(aName, anEntry); // to detect same name of diff objects
}