From ad51185280ce03f56e6cf8b85501da327dbc679f Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 13 Feb 2019 17:54:54 +0100 Subject: [PATCH] print additional information to std::cout about ocaf structure --- src/Mod/Import/Gui/AppImportGuiPy.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 353c67f007..60af16d8af 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -27,6 +27,7 @@ #endif #ifndef _PreComp_ # include +# include # include # include # include @@ -94,6 +95,7 @@ #include #include #include +#include #include #include #include @@ -175,13 +177,25 @@ void OCAFBrowser::load(QTreeWidget* theTree) void OCAFBrowser::load(const TDF_Label& label, QTreeWidgetItem* item, const QString& s) { + label.Dump(std::cout); + Handle(TDataStd_Name) name; if (label.FindAttribute(TDataStd_Name::GetID(),name)) { QString text = QString::fromLatin1("%1 %2").arg(s).arg(QString::fromUtf8(toString(name->Get()).c_str())); item->setText(0, text); } - for (TDF_ListIteratorOfIDList it(myList); it.More(); it.Next()) { +#if 0 + TDF_IDList localList = myList; +#else + TDF_IDList localList; + TDF_AttributeIterator itr (label); + for ( ; itr.More(); itr.Next()) { + localList.Append(itr.Value()->ID()); + } +#endif + + for (TDF_ListIteratorOfIDList it(localList); it.More(); it.Next()) { Handle(TDF_Attribute) attr; if (label.FindAttribute(it.Value(), attr)) { QTreeWidgetItem* child = new QTreeWidgetItem();