From: ctorres Date: Wed, 18 Jun 2014 13:32:01 +0000 (+0200) Subject: 2397 BBTK Feature New Normal Feature GetBoxesInside for showing the tree of a blackbo... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e123c635cfb290e1936b9765d97d097500170f26;p=bbtk.git 2397 BBTK Feature New Normal Feature GetBoxesInside for showing the tree of a blackbox 2014-06-18 15:31 --- diff --git a/kernel/src/bbtkAtomicBlackBoxDescriptor.cxx b/kernel/src/bbtkAtomicBlackBoxDescriptor.cxx index b60f6bb..aafb10d 100644 --- a/kernel/src/bbtkAtomicBlackBoxDescriptor.cxx +++ b/kernel/src/bbtkAtomicBlackBoxDescriptor.cxx @@ -86,4 +86,6 @@ namespace bbtk { bbtkDDebugMessage("object",3,"==> ~AtomicBlackBoxDescriptor()"<& temp, int cont){ + void BlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, int cont){ } //========================================================================= diff --git a/kernel/src/bbtkBlackBoxDescriptor.h b/kernel/src/bbtkBlackBoxDescriptor.h index 25f4544..8124b35 100644 --- a/kernel/src/bbtkBlackBoxDescriptor.h +++ b/kernel/src/bbtkBlackBoxDescriptor.h @@ -170,7 +170,7 @@ namespace bbtk /// virtual void Check(bool recursive=true) const; - virtual void GetBoxesInside (NodeTreeC& tree, std::vector& temp, int cont); + virtual void GetBoxesInside (NodeTreeC& tree, int cont); /// Sets the name of the script file from which it is defined void SetScriptFileName(const std::string& n) { mScriptFileName = n; } diff --git a/kernel/src/bbtkComplexBlackBoxDescriptor.cxx b/kernel/src/bbtkComplexBlackBoxDescriptor.cxx index c25819f..b79fed3 100644 --- a/kernel/src/bbtkComplexBlackBoxDescriptor.cxx +++ b/kernel/src/bbtkComplexBlackBoxDescriptor.cxx @@ -666,47 +666,57 @@ size_t ComplexBlackBoxDescriptor::GetObjectInternalSize() const return s; } //========================================================================== -void ComplexBlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, std::vector& list, int cont) +void ComplexBlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, int cont) { - + std::cout<<"getBoxesInside recursivo "<bbGetBlackBoxMap(); - + + std::cout<<"----B size "<< B.size() << std::endl; + std::cout<<"----antes if "< pdeps; ComplexBlackBox::BlackBoxMapType::const_iterator b; + std::cout<<"----antes for "<second->bbGetDescriptor(); - + BlackBoxDescriptor::Pointer d = b->second->bbGetDescriptor(); + //std::cout<<"nombre objeto d "<< d->GetObjectName() <GetPackage(); std::string nameBox = b->second->bbGetTypeName(); std::string packageBox = p->GetName(); - tree.insertChild(nameBox); - - list.push_back(nameBox); - list.push_back(packageBox); - - d->GetBoxesInside (tree.childs[k],list, cont+1); + std::cout<<"----2~ "<GetBoxesInside (tree.childs[k], cont); + std::cout<<"----3~ "<& list, int cont); + void GetBoxesInside (NodeTreeC& tree, int cont); /// virtual void Check(bool recursive=true) const; diff --git a/kernel/src/bbtkPackage.cxx b/kernel/src/bbtkPackage.cxx index 1b0abc0..16f4ffb 100644 --- a/kernel/src/bbtkPackage.cxx +++ b/kernel/src/bbtkPackage.cxx @@ -1404,15 +1404,14 @@ namespace bbtk return s; } //========================================================================== - void Package::GetBoxesInside(NodeTreeC& tree, std::vector& list, int cont) + void Package::GetBoxesInside(NodeTreeC& tree, int cont) { DescriptorMapType::const_iterator i; - - std::vector temp; + std::cout<<"*********a********"<second->GetBoxesInside(tree, list, cont); - list.insert( list.end(), temp.begin(), temp.end() ); + i->second->GetBoxesInside(tree, cont); + std::cout<<"*****************"<& list, int cont); + void GetBoxesInside(NodeTreeC& tree, int cont); /// NOTE : All the static methods below for package destruction /// are not member because they can cause the package death /// and thus close the dynamic library from which it has been loaded. diff --git a/kernel/src/bbtkUtilities.cxx b/kernel/src/bbtkUtilities.cxx index 0a6fd9f..747f772 100644 --- a/kernel/src/bbtkUtilities.cxx +++ b/kernel/src/bbtkUtilities.cxx @@ -786,68 +786,39 @@ NodeTreeC::~NodeTreeC() { } +void NodeTreeC::deleteTree() +{ + data = ""; + std::cout<<"NodeTreeC::deleteTree 1"<