CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
DDHtmlFormatter.h File Reference
#include <iostream>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include "DetectorDescription/RegressionTest/interface/DDErrorDetection.h"

Go to the source code of this file.

Classes

class  DDFrameGenerator
 
class  DDHtmlDetails
 
class  DDHtmlFormatter
 
class  DDHtmlLpDetails
 
class  DDHtmlMaDetails
 
class  DDHtmlRoDetails
 
class  DDHtmlSoDetails
 
class  DDHtmlSpDetails
 
class  DDNsGenerator
 

Functions

void dd_html_frameset (std::ostream &os)
 
void dd_html_menu (std::ostream &os)
 
void dd_html_menu_frameset (std::ostream &os)
 
void dd_html_ro ()
 
void dd_to_html (DDHtmlDetails &det)
 
std::ostream & operator<< (std::ostream &o, const DDHtmlFormatter &f)
 

Function Documentation

void dd_html_frameset ( std::ostream &  os)

Definition at line 362 of file DDHtmlFormatter.cc.

References f, DDHtmlFormatter::footer(), and DDHtmlFormatter::header().

363 {
365  os << f.header("DDD Reports");
366  os << "<frameset rows=\"50%,50%\"> " << endl
367  << " <frameset cols=\"50%,50%\">" << endl
368  << " <frame name=\"_ns\" src=\"ns.html\">" << endl
369  << " <frame name=\"_list\">" << endl
370  << " </frameset>" << endl
371  << " <frameset cols=\"50%,50%\">" << endl
372  << " <frame name=\"_details\">" << endl
373  << " <frame name=\"_popup\">" << endl
374  << " </frameset>" << endl
375  << "</frameset>" << endl
376  << endl;
377  os << f.footer();
378 
379 }
double f[11][100]
DDHtmlFormatter header(const std::string &text, const std::string &style="../../style.css")
DDHtmlFormatter footer()
void dd_html_menu ( std::ostream &  os)

Definition at line 394 of file DDHtmlFormatter.cc.

References f, DDHtmlFormatter::footer(), DDHtmlFormatter::h1(), DDHtmlFormatter::header(), DDHtmlFormatter::lnk(), and DDHtmlFormatter::p().

395 {
397  os << f.header("DDD Web Main Menu","style.css");
398  os << f.h1("Select a Category:")
399  << f.p(f.lnk("lp/index.html", "LogicalParts", "_selection"))
400  << f.p(f.lnk("ma/index.html", "Materials", "_selection"))
401  << f.p(f.lnk("so/index.html", "Solids", "_selection"))
402  << f.p(f.lnk("ro/index.html", "Rotations", "_selection"))
403  << f.p(f.lnk("sp/index.html", "SpecPars", "_selection"))
404  ;
405 
406  os << f.footer();
407 }
DDHtmlFormatter h1(const std::string &content)
DDHtmlFormatter p(const std::string &content)
double f[11][100]
DDHtmlFormatter header(const std::string &text, const std::string &style="../../style.css")
std::string lnk(const std::string &url, const std::string &text, const std::string &target="_self")
DDHtmlFormatter footer()
void dd_html_menu_frameset ( std::ostream &  os)

Definition at line 381 of file DDHtmlFormatter.cc.

References f, DDHtmlFormatter::footer(), and DDHtmlFormatter::header().

382 {
384  os << f.header("DDD Web Representation");
385  os << "<frameset cols=\"20%,80%\">" << endl
386  << " <frame name=\"_menu\" src=\"menu.html\">" << endl
387  << " <frame name=\"_selection\" >" << endl
388  << "</frameset>" << endl;
389 
390  os << f.footer();
391 }
double f[11][100]
DDHtmlFormatter header(const std::string &text, const std::string &style="../../style.css")
DDHtmlFormatter footer()
void dd_html_ro ( )
void dd_to_html ( DDHtmlDetails det)

Definition at line 290 of file DDHtmlFormatter.cc.

References DDHtmlDetails::category(), python.rootplot.argparse::category, gather_cfg::cout, DDHtmlDetails::details(), dir, f, alignmentValidation::fname, DDHtmlDetails::names(), cscdqm::h::names, query::result, runonSM::text, and DDHtmlDetails::text().

291 {
292  cout << "---> dd_to_html() called with category=" << dtls.category() << endl;
293  const string & category = dtls.category();
294  const string & text = dtls.text();
295  ns_type & names = dtls.names();
296 
297  mkdir( category.c_str(), 0755 );
298 
299  // first the namespaces
300  string ns_fname = category + "/ns.html";
301  ofstream ns_file(ns_fname.c_str());
302  DDNsGenerator ns_gen(ns_file, text, "_list", names, "");
303  ns_gen.doit();
304  ns_file.close();
305 
306  // list all logical parts per namespace
307  ns_type::const_iterator it(names.begin()), ed(names.end());
308  for( ; it != ed; ++it ) {
309 
310  const string & ns = it->first;
311 
312  // create directories named like the namespaces
313  string dir = category + "/" + ns;
314  mkdir( dir.c_str(), 0755 );
315 
316  // create a html file listing all instances of a namespace
317  string fname = category + "/" + ns + "/list.html";
318  ofstream list_file(fname.c_str());
320  list_file << f.header(text)
321  << f.p("Instances in Namespace <b>" + ns + "</b><br>");
322  list_file << f.ul();
323  // loop over all instances of a single namespace
324  set<string>::const_iterator nit(it->second.begin()), ned(it->second.end());
325  for(; nit != ned; ++nit) {
326 
327  const string & nm = *nit;
328  string result_s = nm;
329 
330  // details for each instance
331  string d_fname = category + "/" + ns + "/" + nm + ".html";
332  ofstream detail_file(d_fname.c_str());
333  DDName an(nm,ns);
334  bool result = dtls.details(detail_file, an);
335 
336  if (!result) result_s = ">> ERROR: " + nm + " <<";
337  list_file << f.li(f.lnk(nm+".html", result_s, "_details"));
338 
339  }
340  list_file << f.ulEnd() << f.footer();
341  }
342 }
static const HistoName names[]
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
tuple result
Definition: query.py:137
double f[11][100]
tuple text
Definition: runonSM.py:42
string fname
main script
tuple cout
Definition: gather_cfg.py:121
dbl *** dir
Definition: mlp_gen.cc:35
std::map< std::string, std::set< std::string > > ns_type
std::ostream& operator<< ( std::ostream &  o,
const DDHtmlFormatter f 
)

Definition at line 22 of file DDHtmlFormatter.cc.

References python.connectstrParser::o, and DDHtmlFormatter::os_.

23 {
24  o << f.os_.str(); f.os_.str("");
25  return o;
26 }
std::stringstream os_