CMS 3D CMS Logo

Namespaces | Functions
DDHtmlFormatter.cc File Reference
#include <sys/stat.h>
#include <fstream>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/SystemOfUnits.h"
#include "DetectorDescription/Base/interface/DDRotationMatrix.h"
#include "DetectorDescription/Base/interface/DDTranslation.h"
#include "DetectorDescription/Base/interface/Singleton.h"
#include "DetectorDescription/Base/interface/Singleton.icc"
#include "DetectorDescription/Core/interface/DDBase.h"
#include "DetectorDescription/Core/interface/DDEnums.h"
#include "DetectorDescription/Core/interface/DDLogicalPart.h"
#include "DetectorDescription/Core/interface/DDMaterial.h"
#include "DetectorDescription/Core/interface/DDName.h"
#include "DetectorDescription/Core/interface/DDPartSelection.h"
#include "DetectorDescription/Core/interface/DDSolid.h"
#include "DetectorDescription/Core/interface/DDSpecifics.h"
#include "DetectorDescription/Core/interface/DDTransform.h"
#include "DetectorDescription/Core/src/LogicalPart.h"
#include "DetectorDescription/Core/src/Material.h"
#include "DetectorDescription/Core/src/Specific.h"
#include "DetectorDescription/Core/src/Solid.h"
#include "DetectorDescription/RegressionTest/interface/DDErrorDetection.h"
#include "DetectorDescription/RegressionTest/interface/DDHtmlFormatter.h"

Go to the source code of this file.

Namespaces

 std
 

Functions

void dd_html_frameset (ostream &os)
 
void dd_html_menu (ostream &os)
 
void dd_html_menu_frameset (ostream &os)
 
void dd_to_html (DDHtmlDetails &dtls)
 
ostream & operator<< (ostream &o, const DDHtmlFormatter &f)
 

Function Documentation

void dd_html_frameset ( ostream &  os)

Definition at line 376 of file DDHtmlFormatter.cc.

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

377 {
379  os << f.header("DDD Reports");
380  os << "<frameset rows=\"50%,50%\"> " << endl
381  << " <frameset cols=\"50%,50%\">" << endl
382  << " <frame name=\"_ns\" src=\"ns.html\">" << endl
383  << " <frame name=\"_list\">" << endl
384  << " </frameset>" << endl
385  << " <frameset cols=\"50%,50%\">" << endl
386  << " <frame name=\"_details\">" << endl
387  << " <frame name=\"_popup\">" << endl
388  << " </frameset>" << endl
389  << "</frameset>" << endl
390  << endl;
391  os << f.footer();
392 
393 }
double f[11][100]
DDHtmlFormatter header(const std::string &text, const std::string &style="../../style.css")
DDHtmlFormatter footer()
void dd_html_menu ( ostream &  os)

Definition at line 408 of file DDHtmlFormatter.cc.

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

409 {
411  os << f.header("DDD Web Main Menu","style.css");
412  os << f.h1("Select a Category:")
413  << f.p(f.lnk("lp/index.html", "LogicalParts", "_selection"))
414  << f.p(f.lnk("ma/index.html", "Materials", "_selection"))
415  << f.p(f.lnk("so/index.html", "Solids", "_selection"))
416  << f.p(f.lnk("ro/index.html", "Rotations", "_selection"))
417  << f.p(f.lnk("sp/index.html", "SpecPars", "_selection"))
418  ;
419 
420  os << f.footer();
421 }
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 ( ostream &  os)

Definition at line 395 of file DDHtmlFormatter.cc.

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

396 {
398  os << f.header("DDD Web Representation");
399  os << "<frameset cols=\"20%,80%\">" << endl
400  << " <frame name=\"_menu\" src=\"menu.html\">" << endl
401  << " <frame name=\"_selection\" >" << endl
402  << "</frameset>" << endl;
403 
404  os << f.footer();
405 }
double f[11][100]
DDHtmlFormatter header(const std::string &text, const std::string &style="../../style.css")
DDHtmlFormatter footer()
void dd_to_html ( DDHtmlDetails dtls)

Definition at line 304 of file DDHtmlFormatter.cc.

References DDHtmlDetails::category(), gather_cfg::cout, DDHtmlDetails::details(), dir, f, alignmentValidation::fname, eostools::mkdir(), DDHtmlDetails::names(), mps_fire::result, and DDHtmlDetails::text().

Referenced by DDHtmlSpDetails::DDHtmlSpDetails().

305 {
306  cout << "---> dd_to_html() called with category=" << dtls.category() << endl;
307  const string & category = dtls.category();
308  const string & text = dtls.text();
309  ns_type & names = dtls.names();
310 
311  mkdir( category.c_str(), 0755 );
312 
313  // first the namespaces
314  string ns_fname = category + "/ns.html";
315  ofstream ns_file(ns_fname.c_str());
316  DDNsGenerator ns_gen(ns_file, text, "_list", names, "");
317  ns_gen.doit();
318  ns_file.close();
319 
320  // list all logical parts per namespace
321  ns_type::const_iterator it(names.begin()), ed(names.end());
322  for( ; it != ed; ++it ) {
323 
324  const string & ns = it->first;
325 
326  // create directories named like the namespaces
327  string dir = category + "/" + ns;
328  mkdir( dir.c_str(), 0755 );
329 
330  // create a html file listing all instances of a namespace
331  string fname = category + "/" + ns + "/list.html";
332  ofstream list_file(fname.c_str());
334  list_file << f.header(text)
335  << f.p("Instances in Namespace <b>" + ns + "</b><br>");
336  list_file << f.ul();
337  // loop over all instances of a single namespace
338  set<string>::const_iterator nit(it->second.begin()), ned(it->second.end());
339  for(; nit != ned; ++nit) {
340 
341  const string & nm = *nit;
342  string result_s = nm;
343 
344  // details for each instance
345  string d_fname = category + "/" + ns + "/" + nm + ".html";
346  ofstream detail_file(d_fname.c_str());
347  DDName an(nm,ns);
348  bool result = dtls.details(detail_file, an);
349 
350  if (!result) result_s = ">> ERROR: " + nm + " <<";
351  list_file << f.li(f.lnk(nm+".html", result_s, "_details"));
352 
353  }
354  list_file << f.ulEnd() << f.footer();
355  }
356 }
static const HistoName names[]
virtual bool details(std::ostream &os, const DDName &)=0
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
double f[11][100]
virtual ns_type & names()=0
const std::string & text()
string fname
main script
def mkdir(path)
Definition: eostools.py:250
const std::string & category()
dbl *** dir
Definition: mlp_gen.cc:35
std::map< std::string, std::set< std::string > > ns_type
ostream& operator<< ( ostream &  o,
const DDHtmlFormatter f 
)

Definition at line 36 of file DDHtmlFormatter.cc.

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

37 {
38  o << f.os_.str(); f.os_.str("");
39  return o;
40 }
std::stringstream os_