// Copyright (C) 2001 Jean-Marc Valin #include "UIDocument.h" #include #include "ParameterSet.h" #include "ObjectRef.h" #include using namespace std; namespace FD { void node2html(string nodeName, NodeInfo *info, ostream &out) { int nb; out << "

\n" << "

\n" << nodeName << " (" << info->category << ")

\n"; if (info->requireList.size()) out << "(require: " << info->requireList << ")
"; out << info->description; if(nodeName == "Constant") out << "

For further explainations see Users Manual at section 6.3 \"Data Types\": " << "Users Manual"; out << "
 \n" << "\n" << "\n" << "\n" << "\n" << "\n" << "\n" << "\n"; for (int field = 0;field<3;field++) { string fieldName; vector *fieldInfoPtr; switch (field) { case 0: fieldName="Inputs"; fieldInfoPtr = &info->inputs; break; case 1: fieldName="Outputs"; fieldInfoPtr = &info->outputs; break; case 2: fieldName="Parameters"; fieldInfoPtr = &info->params; break; } vector &fieldInfo= *fieldInfoPtr; nb = fieldInfo.size(); if (nb == 1) { out << "\n" << "\n"; out << ""; out << ""; out << ""; } else if ( nb > 1 ) { for (int i=0;i\n" << "\n"; } out << ""; out << ""; out << ""; } } else { out << "\n" << "\n"; out << ""; out << ""; out << ""; } out << "\n"; } out << "
NAMETYPEMEANING
" << fieldName << ""; out << fieldInfo[0]->name; out << ""; out << fieldInfo[0]->type; out << ""; out << fieldInfo[0]->description; out << "" << fieldName << ""; out << fieldInfo[i]->name; out << ""; out << fieldInfo[i]->type; out << ""; out << fieldInfo[i]->description; out << "
" << fieldName << "nonenonenone
\n"; } void categContent( string categName, string nextcateg, ostream &out) { // Initialisation des variables vector listnodes(200); int j = 0; int nbnodes = 0; // On cree une liste des noeuds de la categorie UINodeRepository::iterator i = UINodeRepository::Begin(); while (i != UINodeRepository::End()) { if(i->second->category == categName) { listnodes[j] = i->first; nbnodes++; j++; } i++; } out << "

" << "

" << "







* " << categName << " (" << nbnodes << ")" <<"

" << "

List of available FlowDesigner nodes "<< "

\n\n"; // Affichage du tableau : noeuds de la categorie out << "\n\n"; int nbcol = 3; switch (nbnodes % nbcol) { case 0: for(int k=0; k < (nbnodes / nbcol); k++) { out << "\n"; if(listnodes[(nbnodes / nbcol ) + k ] != "") { out << "\n"; } else out << "\n"; if(listnodes[(2 * nbnodes / nbcol ) + k] != "") { out << "\n"; } else out << "\n"; } break; case 1: for(int k=0; k <= (nbnodes / nbcol); k++) { out << "\n"; if(listnodes[(nbnodes / nbcol) + k + 1] != "") { out << "\n"; } else out<< "\n"; if(listnodes[(2 * nbnodes / nbcol) + k + 2] != "") { out << "\n"; } else out << "\n"; } break; case 2: for(int k=0; k <= (nbnodes / nbcol); k++) { out << "\n"; if(listnodes[(nbnodes / nbcol) + k + 1] != "") { out << "\n"; } else out << "\n"; if( listnodes[(2 * nbnodes / nbcol) + k + 1] != "") { out << "\n"; } else out << "\n"; } break; default: out << "\nProblems occured while getting the data\n"; } out << "
" <<"* " <<"" << listnodes[k] <<"" <<"* " <<"" << listnodes[(nbnodes / nbcol ) + k ] <<"
" <<"* " <<"" << listnodes[(2 * nbnodes / nbcol ) + k] <<"
" <<"* " <<"" << listnodes[k] <<"" <<"* " <<"" << listnodes[(nbnodes / nbcol) + k + 1] <<"
" <<"* " <<"" << listnodes[(2 * nbnodes / nbcol) + k + 2] <<"
" <<"* " <<"" << listnodes[k] <<"" <<"* " <<"" << listnodes[(nbnodes / nbcol) + k + 1] <<"
" <<"* " <<"" << listnodes[(2 * nbnodes / nbcol) + k + 1] <<"
\n "; if(nextcateg != "") { out << "
See next category: " << "" << nextcateg << "
"; } out << "
Return to: " << "" << "Categories of available FlowDesigner nodes




"; // Affichage des informations sur les noeuds for(int l=0; l < nbnodes; l++) { i = UINodeRepository::Begin(); while (i != UINodeRepository::End()) { if(i->first == listnodes[l]) { out <<"
"; node2html(listnodes[l], i->second, out); out << "
Return to: " << "" << categName <<"
"; if(nextcateg != "") { out << "
See next category: " << "" << nextcateg << "
"; } out << "
Return to: " << "" << "Categories of available FlowDesigner nodes
"; } i++; } } } }//namespace FD using namespace FD; int main(int argc, char **argv) { //Scan toolboxes UINodeRepository::Scan(); vector listcateg; ostream &out = cout; out << "\n" << "\n" << "\n" << "\n" << "\n" << "\n" << "FlowDesigner node documentation\n" << "\n" << "\n" << ""; //Getting available categories for (UINodeRepository::iterator iter= UINodeRepository::Begin();iter != UINodeRepository::End(); iter++) { bool newcateg = true; //testing if we already inserted this category for(int j = 0; j < listcateg.size() ; j++) { if( listcateg[j] == iter->second->category ) { newcateg = false; } } if(newcateg == true) { if (argc > 1) { for (int cat = 1; cat < argc; cat++) { //found substring in the category (specified by the user) if (iter->second->category.find(string(argv[cat])) != string::npos) { listcateg.push_back(iter->second->category); } } } else { listcateg.push_back(iter->second->category); } } } // Sorting category names sort(listcateg.begin(), listcateg.end(), greater()); // Print categories table header out << ""; out << "


" << "* NODE" <<"  " <<" DOCUMENTATION *

"; out << "Categories of available FlowDesigner Nodes"<< "

\n
"; out << "\n\n"; int nbcol = 2; //adding empty category for last element if required if ((listcateg.size() % nbcol) == 1) { listcateg.push_back(string("-")); } //printing table for(int j = 0; j < listcateg.size() / nbcol; j++) { out << "\n" << "\n"; } out << "
" <<"* " <<"" << listcateg[j] <<"" <<"* " <<"" << listcateg[(listcateg.size() / nbcol) + j] <<"
\n"; out << "













" << "














" << "

" << "

Categories:

"; //creating list of nodes for each category for(int a=0; a < listcateg.size(); a++) { if (a < listcateg.size() - 1) { categContent( listcateg[a], listcateg[a + 1], out); } else { categContent( listcateg[a],string("-"), out); } } out << "\n\n" << "" << "\n"; }