CMS 3D CMS Logo

DDHtmlFormatter.cc File Reference

#include <sys/stat.h>
#include <sys/types.h>
#include <fstream>
#include "CLHEP/Units/SystemOfUnits.h"
#include "DetectorDescription/RegressionTest/interface/DDHtmlFormatter.h"
#include "DetectorDescription/Core/interface/DDLogicalPart.h"
#include "DetectorDescription/Core/interface/DDSpecifics.h"
#include "DetectorDescription/Core/interface/DDPartSelection.h"

Go to the source code of this file.

Namespaces

namespace  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 353 of file DDHtmlFormatter.cc.

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

00354 {
00355   DDHtmlFormatter f;
00356   os << f.header("DDD Reports");
00357   os << "<frameset rows=\"50%,50%\"> " << endl
00358      << "  <frameset cols=\"50%,50%\">" << endl
00359      << "    <frame name=\"_ns\" src=\"ns.html\">" << endl
00360      << "    <frame name=\"_list\">" << endl
00361      << "  </frameset>" << endl
00362      << "  <frameset cols=\"50%,50%\">" << endl
00363      << "    <frame name=\"_details\">" << endl
00364      << "    <frame name=\"_popup\">" << endl
00365      << "  </frameset>" << endl
00366      << "</frameset>" << endl
00367      << endl;
00368   os << f.footer();
00369 
00370 }

void dd_html_menu ( ostream &  os  ) 

Definition at line 385 of file DDHtmlFormatter.cc.

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

00386 {
00387   DDHtmlFormatter f;
00388   os << f.header("DDD Web Main Menu","style.css");
00389   os << f.h1("Select a Category:") 
00390      << f.p(f.lnk("lp/index.html", "LogicalParts", "_selection")) 
00391      << f.p(f.lnk("ma/index.html", "Materials", "_selection"))
00392      << f.p(f.lnk("so/index.html", "Solids", "_selection"))
00393      << f.p(f.lnk("ro/index.html", "Rotations", "_selection"))
00394      << f.p(f.lnk("sp/index.html", "SpecPars", "_selection"))
00395      ;
00396      
00397   os << f.footer();
00398 }

void dd_html_menu_frameset ( ostream &  os  ) 

Definition at line 372 of file DDHtmlFormatter.cc.

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

00373 {
00374   DDHtmlFormatter f;
00375   os << f.header("DDD Web Representation");
00376   os << "<frameset cols=\"20%,80%\">" << endl
00377      << "  <frame name=\"_menu\" src=\"menu.html\">" << endl
00378      << "  <frame name=\"_selection\" >" << endl
00379      << "</frameset>" << endl;
00380      
00381   os << f.footer();    
00382 }

void dd_to_html ( DDHtmlDetails dtls  ) 

Definition at line 281 of file DDHtmlFormatter.cc.

References DDHtmlDetails::category(), GenMuonPlsPt100GeV_cfg::cout, DDHtmlDetails::details(), dir, lat::endl(), f, mergeAndRegister_online::fname, it, DDHtmlDetails::names(), DDHtmlLpDetails::names(), HLT_VtxMuL3::result, and DDHtmlDetails::text().

00282 {
00283   cout << "---> dd_to_html() called with category=" << dtls.category() << endl;
00284   const string & category = dtls.category();
00285   const string & text     = dtls.text();
00286   ns_type & names         = dtls.names();
00287   
00288   mkdir( category.c_str(), 0755 );
00289   
00290   // first the namespaces
00291   string ns_fname = category + "/ns.html";
00292   ofstream ns_file(ns_fname.c_str());
00293   DDNsGenerator ns_gen(ns_file, text, "_list", names, "");  
00294   ns_gen.doit();
00295   ns_file.close();
00296   
00297   // list all logical parts per namespace
00298   ns_type::const_iterator it(names.begin()), ed(names.end());
00299   for( ; it != ed; ++it ) {
00300     
00301     const string & ns = it->first;
00302     
00303     // create directories named like the namespaces
00304     string dir = category + "/" + ns;
00305     mkdir( dir.c_str(), 0755 );
00306 
00307     // create a html file listing all instances of a namespace
00308     string fname = category + "/" + ns + "/list.html";
00309     ofstream list_file(fname.c_str());
00310     DDHtmlFormatter f;
00311     list_file << f.header(text)
00312               << f.p("Instances in Namespace <b>" + ns + "</b><br>");
00313     list_file << f.ul();
00314     // loop over all instances of a single namespace
00315     set<string>::const_iterator nit(it->second.begin()), ned(it->second.end());
00316     for(; nit != ned; ++nit) {
00317 
00318       const string & nm = *nit;
00319       string result_s = nm;
00320 
00321       // details for each instance 
00322       string d_fname = category + "/" + ns + "/" + nm + ".html";
00323       ofstream detail_file(d_fname.c_str());
00324       DDName an(nm,ns);
00325       bool result = dtls.details(detail_file, an);
00326 
00327       if (!result) result_s = ">> ERROR: " + nm + " <<";
00328       list_file << f.li(f.lnk(nm+".html", result_s, "_details"));          
00329       
00330     }
00331     list_file << f.ulEnd() << f.footer();
00332   }
00333 }

ostream& operator<< ( ostream &  o,
const DDHtmlFormatter f 
)

Definition at line 12 of file DDHtmlFormatter.cc.

References DDHtmlFormatter::os_.

00013 {
00014   o << f.os_.str(); f.os_.str("");
00015   return o;
00016 }


Generated on Tue Jun 9 17:52:37 2009 for CMSSW by  doxygen 1.5.4