Activate only UI tree leaf as to display properly colors when browsing a STEP (there is currently a limitation within the reader which creates compound which are totally grey) and accelerate browsing by de-activating Compound rendering

This commit is contained in:
Jean-Marie Verdun
2017-01-29 17:20:51 +01:00
committed by wmayer
parent bcea759287
commit fc4a1c6081
3 changed files with 30 additions and 0 deletions

View File

@@ -112,6 +112,10 @@
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/ViewProvider.h>
class OCAFBrowser
{
public:
@@ -403,6 +407,16 @@ private:
ImportOCAFExt ocaf(hDoc, pcDoc, file.fileNamePure());
ocaf.loadShapes();
// Shape are loaded we must now sort the one we want to display and the one we do want to hide
Gui::Document *guiDoc = Gui::Application::Instance->activeDocument();
std::vector<const char *>keep_leaf= ocaf.return_leaf();
for (std::vector<const char *>::iterator it = keep_leaf.begin() ; it != keep_leaf.end(); ++it)
guiDoc->setShow((*it));
std::vector<const char *>hide_node= ocaf.return_node();
for (std::vector<const char *>::iterator it = hide_node.begin() ; it != hide_node.end(); ++it)
guiDoc->setHide((*it));
pcDoc->recompute();
}
catch (Standard_Failure) {