diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index 40025357b..77929a281 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -169,6 +169,20 @@ const char* SoFCUnifiedSelection::getFileFormatName(void) const return "Separator"; } +void SoFCUnifiedSelection::write(SoWriteAction * action) +{ + SoOutput * out = action->getOutput(); + if (out->getStage() == SoOutput::WRITE) { + // Do not write out the fields of this class + if (this->writeHeader(out, TRUE, FALSE)) return; + SoGroup::doAction((SoAction *)action); + this->writeFooter(out); + } + else { + inherited::write(action); + } +} + int SoFCUnifiedSelection::getPriority(const SoPickedPoint* p) { const SoDetail* detail = p->getDetail(); diff --git a/src/Gui/SoFCUnifiedSelection.h b/src/Gui/SoFCUnifiedSelection.h index 30216d668..491c2d2c1 100644 --- a/src/Gui/SoFCUnifiedSelection.h +++ b/src/Gui/SoFCUnifiedSelection.h @@ -72,6 +72,7 @@ public: }; const char* getFileFormatName(void) const; + void write(SoWriteAction * action); SoSFColor colorHighlight; SoSFColor colorSelection; diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index fdcfefc89..6bcce90fa 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include "../App/PartFeature.h" #include "DlgPartImportStepImp.h" @@ -452,6 +453,7 @@ void CmdPartImport::activated(int iMsg) QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;"))); if (!fn.isEmpty()) { + Gui::WaitCursor wc; App::Document* pDoc = getDocument(); if (!pDoc) return; // no document openCommand("Import Part"); diff --git a/src/Mod/Part/Gui/SoBrepShape.cpp b/src/Mod/Part/Gui/SoBrepShape.cpp index 2b9fe5b2b..0f8dacbab 100644 --- a/src/Mod/Part/Gui/SoBrepShape.cpp +++ b/src/Mod/Part/Gui/SoBrepShape.cpp @@ -391,6 +391,14 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist, int matnr = 0; int trinr = 0; pi = piptr < piendptr ? *piptr++ : -1; + while (pi == 0) { + // It may happen that a part has no triangles + pi = piptr < piendptr ? *piptr++ : -1; + if (mbind == PER_PART) + matnr++; + else if (mbind == PER_PART_INDEXED) + matindices++; + } glBegin(GL_TRIANGLES); while (viptr + 2 < viendptr) { @@ -503,6 +511,14 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist, trinr++; if (pi == trinr) { pi = piptr < piendptr ? *piptr++ : -1; + while (pi == 0) { + // It may happen that a part has no triangles + pi = piptr < piendptr ? *piptr++ : -1; + if (mbind == PER_PART) + matnr++; + else if (mbind == PER_PART_INDEXED) + matindices++; + } trinr = 0; } }