-
- BlackBox* blackbox=NULL;
- if (nameblackbox==".")
- {
- blackbox=Current()->GetPrototype();
- }
- else
- {
- blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox);
- }
-
- std::string page;
-
- if (blackbox)
- {
- // Don't pollute the file store with "temp_dir" directories ...
- std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
- char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1];
-
- std::string directory = default_doc_dir;
- if (c != '/' && c !='\\') directory = directory + "/";
-
- directory = directory + "temp_dir";
-
- //std::string directory("temp_dir");
- std::string filename(directory + "/" + "bbtk_graph_pipeline");
- std::string filename_html(filename+".html");
- std::string command0("mkdir \""+directory + "\"");
-
-#if defined(_WIN32)
- std::string command2("start ");
-#else
- std::string command2("gnome-open ");
-#endif
-
- command2=command2+filename_html;
- page = filename_html;
- // 1. Generate Html Diagram
- std::ofstream s;
- s.open(filename_html.c_str());
- if (s.good())
- {
- s << "<html><head><title>BBtk graph diagram</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head>\n";
- s << "<body bgcolor=\"#FFFFFF\" text=\"#000000\"> \n\n";
- if ( blackbox->bbGetName()=="workspacePrototype" )
- {
- s << "<center>Current workspace</center>";
- } else {
- s << "<center>" << blackbox->bbGetName()<< "</center>";
- }
-
- blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false );
- s << "</body></html>\n";
- }
- s.close();
-
- // 2. Starting Browser
- if (system_display) system( command2.c_str() );
- }
- else
- {
- bbtkMessageInc("Help",1,"No black box: \""
- <<nameblackbox<<"\" " <<std::endl);
-
- }
- return page;