Skip to content

Commit

Permalink
Import: [skip ci] fix bug when checking if std::map is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jan 17, 2020
1 parent fbd5191 commit d62eda5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Mod/Import/App/AppImportPy.cpp
Expand Up @@ -163,7 +163,6 @@ class Module : public Py::ExtensionModule<Module>
Handle(XCAFApp_Application) hApp = XCAFApp_Application::GetApplication();
Handle(TDocStd_Document) hDoc;
hApp->NewDocument(TCollection_ExtendedString("MDTV-CAF"), hDoc);
ImportOCAFExt ocaf(hDoc, pcDoc, file.fileNamePure());

if (file.hasExtension("stp") || file.hasExtension("step")) {
try {
Expand Down Expand Up @@ -230,23 +229,27 @@ class Module : public Py::ExtensionModule<Module>
}

#if 1
if(merge!=Py_None)
ImportOCAFExt ocaf(hDoc, pcDoc, file.fileNamePure());
if (merge != Py_None)
ocaf.setMerge(PyObject_IsTrue(merge));
if(importHidden!=Py_None)
if (importHidden != Py_None)
ocaf.setImportHiddenObject(PyObject_IsTrue(importHidden));
if(useLinkGroup!=Py_None)
if (useLinkGroup != Py_None)
ocaf.setUseLinkGroup(PyObject_IsTrue(useLinkGroup));
if(mode>=0)
if (mode >= 0)
ocaf.setMode(mode);
ocaf.loadShapes();
#elif 1
Import::ImportOCAFCmd ocaf(hDoc, pcDoc, file.fileNamePure());
ocaf.loadShapes();
#else
Import::ImportXCAF xcaf(hDoc, pcDoc, file.fileNamePure());
xcaf.loadShapes();
pcDoc->recompute();
#endif
hApp->Close(hDoc);

if (!ocaf.partColors.size()) {
if (!ocaf.partColors.empty()) {
Py::List list;
for (auto &it : ocaf.partColors) {
Py::Tuple tuple(2);
Expand Down

0 comments on commit d62eda5

Please sign in to comment.