]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkComplexBlackBoxDescriptor.cxx
Obtaining the tree boxes related to a sigle box. The classes changed were Utilities...
[bbtk.git] / kernel / src / bbtkComplexBlackBoxDescriptor.cxx
index 20d2ca9a2db3572ab4cf3a9306ba77a55e31fa31..c25819f5003eb9bb497c8f4aa6e7530defb99cbb 100644 (file)
@@ -416,7 +416,7 @@ namespace bbtk
              Package::Pointer p = d->GetPackage();
            
              std::string name = b->second->bbGetTypeName();
-
+                               
              std::string url;
              if (relative_link) 
                 url = p->GetDocRelativeURL();
@@ -666,6 +666,50 @@ size_t  ComplexBlackBoxDescriptor::GetObjectInternalSize() const
     return s;
   }
   //==========================================================================
+void ComplexBlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, std::vector<std::string>& list, int cont) 
+       {
 
+               std::string name = GetTypeName();
+    std::string descr = GetDescription();
+    std::string author = GetAuthor();
+       list.push_back(name);
+               tree.setData(name);
+   //  list.push_back(descr);
+   //  list.push_back(author);
+               int k = 0;
+    const ComplexBlackBox::BlackBoxMapType& B = mPrototype->bbGetBlackBoxMap();
        
+    if (B.size()) 
+    {
+          std::set<BlackBoxDescriptor::Pointer> pdeps;
+          ComplexBlackBox::BlackBoxMapType::const_iterator b;
+          for ( b = B.begin(); b != B.end(); ++b ) 
+          {
+               BlackBoxDescriptor::Pointer d = b->second->bbGetDescriptor();
+                               
+                               
+             //if (pdeps.find(d) != pdeps.end()) 
+        //    continue;
+             //pdeps.insert(d);
+
+             Package::Pointer p = d->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);
+                               k++;
+           }   // for
+
+     } // If B.size
+
+       }
+
+//===================================================
+
+        //==========================================================================
 }