From 8296d514e310201807c7b6537369660e05fe3513 Mon Sep 17 00:00:00 2001 From: jriegel Date: Mon, 14 Apr 2014 18:11:27 +0200 Subject: [PATCH] Implement some diagnostics --- src/Mod/Import/App/ImportOCAFAssembly.cpp | 19 +++++++------------ src/Mod/Import/App/ImportOCAFAssembly.h | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Mod/Import/App/ImportOCAFAssembly.cpp b/src/Mod/Import/App/ImportOCAFAssembly.cpp index e97388d27c..760e014e64 100644 --- a/src/Mod/Import/App/ImportOCAFAssembly.cpp +++ b/src/Mod/Import/App/ImportOCAFAssembly.cpp @@ -92,10 +92,10 @@ ImportOCAFAssembly::~ImportOCAFAssembly() void ImportOCAFAssembly::loadShapes() { myRefShapes.clear(); - loadShapes(pDoc->Main(), TopLoc_Location(), default_name, "", false); + loadShapes(pDoc->Main(), TopLoc_Location(), default_name, "", false,0); } -void ImportOCAFAssembly::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, const std::string& defaultname, const std::string& assembly, bool isRef) +void ImportOCAFAssembly::loadShapes(const TDF_Label& label, const TopLoc_Location& loc, const std::string& defaultname, const std::string& assembly, bool isRef, int dep) { int hash = 0; TopoDS_Shape aShape; @@ -137,7 +137,7 @@ void ImportOCAFAssembly::loadShapes(const TDF_Label& label, const TopLoc_Locatio } #ifdef FC_DEBUG - Base::Console().Message("H:%d, N:%s, T:%d, A:%d, S:%d, C:%d, SS:%d, F:%d, R:%d, C:%d, SS:%d\n", + Base::Console().Message("H:%-9d \tN:%-30s \tT:%d \tA:%d \tS:%d \tC:%d \tSS:%d \tF:%d \tR:%d \tC:%d \tSS:%d\t-- %d \n", hash, part_name.c_str(), aShapeTool->IsTopLevel(label), @@ -148,7 +148,8 @@ void ImportOCAFAssembly::loadShapes(const TDF_Label& label, const TopLoc_Locatio aShapeTool->IsFree(label), aShapeTool->IsReference(label), aShapeTool->IsComponent(label), - aShapeTool->IsSubShape(label) + aShapeTool->IsSubShape(label), + dep ); #endif @@ -159,7 +160,7 @@ void ImportOCAFAssembly::loadShapes(const TDF_Label& label, const TopLoc_Locatio TDF_Label ref; if (aShapeTool->IsReference(label) && aShapeTool->GetReferredShape(label, ref)) { - loadShapes(ref, part_loc, part_name, asm_name, true); + loadShapes(ref, part_loc, part_name, asm_name, true,dep + 1); } if (isRef || myRefShapes.find(hash) == myRefShapes.end()) { @@ -177,7 +178,7 @@ void ImportOCAFAssembly::loadShapes(const TDF_Label& label, const TopLoc_Locatio } else { for (TDF_ChildIterator it(label); it.More(); it.Next()) { - loadShapes(it.Value(), part_loc, part_name, asm_name, isRef); + loadShapes(it.Value(), part_loc, part_name, asm_name, isRef, dep+1); } } } @@ -257,12 +258,6 @@ void ImportOCAFAssembly::createShape(const TopoDS_Shape& aShape, const TopLoc_Lo if (found_face_color) { applyColors(part, faceColors); -#if 0//TODO - Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part); - if (vp && vp->isDerivedFrom(PartGui::ViewProviderPartExt::getClassTypeId())) { - static_cast(vp)->DiffuseColor.setValues(faceColors); - } -#endif } } diff --git a/src/Mod/Import/App/ImportOCAFAssembly.h b/src/Mod/Import/App/ImportOCAFAssembly.h index eb5893589e..4abd33c33e 100644 --- a/src/Mod/Import/App/ImportOCAFAssembly.h +++ b/src/Mod/Import/App/ImportOCAFAssembly.h @@ -57,7 +57,7 @@ public: void loadShapes(); private: - void loadShapes(const TDF_Label& label, const TopLoc_Location&, const std::string& partname, const std::string& assembly, bool isRef); + void loadShapes(const TDF_Label& label, const TopLoc_Location&, const std::string& partname, const std::string& assembly, bool isRef, int dep); void createShape(const TDF_Label& label, const TopLoc_Location&, const std::string&); void createShape(const TopoDS_Shape& label, const TopLoc_Location&, const std::string&); virtual void applyColors(Part::Feature*, const std::vector&){}