CMS 3D CMS Logo

Namespaces | Functions

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DetectorDescription/RegressionTest/src/DDHtmlFormatter.cc File Reference

#include <sys/stat.h>
#include <sys/types.h>
#include <fstream>
#include "CLHEP/Units/GlobalSystemOfUnits.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"
#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/Base/interface/Singleton.icc"

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

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

{
  DDHtmlFormatter f;
  os << f.header("DDD Reports");
  os << "<frameset rows=\"50%,50%\"> " << endl
     << "  <frameset cols=\"50%,50%\">" << endl
     << "    <frame name=\"_ns\" src=\"ns.html\">" << endl
     << "    <frame name=\"_list\">" << endl
     << "  </frameset>" << endl
     << "  <frameset cols=\"50%,50%\">" << endl
     << "    <frame name=\"_details\">" << endl
     << "    <frame name=\"_popup\">" << endl
     << "  </frameset>" << endl
     << "</frameset>" << endl
     << endl;
  os << f.footer();

}
void dd_html_menu ( ostream &  os)

Definition at line 394 of file DDHtmlFormatter.cc.

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

{
  DDHtmlFormatter f;
  os << f.header("DDD Web Main Menu","style.css");
  os << f.h1("Select a Category:") 
     << f.p(f.lnk("lp/index.html", "LogicalParts", "_selection")) 
     << f.p(f.lnk("ma/index.html", "Materials", "_selection"))
     << f.p(f.lnk("so/index.html", "Solids", "_selection"))
     << f.p(f.lnk("ro/index.html", "Rotations", "_selection"))
     << f.p(f.lnk("sp/index.html", "SpecPars", "_selection"))
     ;
     
  os << f.footer();
}
void dd_html_menu_frameset ( ostream &  os)

Definition at line 381 of file DDHtmlFormatter.cc.

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

{
  DDHtmlFormatter f;
  os << f.header("DDD Web Representation");
  os << "<frameset cols=\"20%,80%\">" << endl
     << "  <frame name=\"_menu\" src=\"menu.html\">" << endl
     << "  <frame name=\"_selection\" >" << endl
     << "</frameset>" << endl;
     
  os << f.footer();    
}
void dd_to_html ( DDHtmlDetails dtls)

Definition at line 290 of file DDHtmlFormatter.cc.

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

{
  cout << "---> dd_to_html() called with category=" << dtls.category() << endl;
  const string & category = dtls.category();
  const string & text     = dtls.text();
  ns_type & names         = dtls.names();
  
  mkdir( category.c_str(), 0755 );
  
  // first the namespaces
  string ns_fname = category + "/ns.html";
  ofstream ns_file(ns_fname.c_str());
  DDNsGenerator ns_gen(ns_file, text, "_list", names, "");  
  ns_gen.doit();
  ns_file.close();
  
  // list all logical parts per namespace
  ns_type::const_iterator it(names.begin()), ed(names.end());
  for( ; it != ed; ++it ) {
    
    const string & ns = it->first;
    
    // create directories named like the namespaces
    string dir = category + "/" + ns;
    mkdir( dir.c_str(), 0755 );

    // create a html file listing all instances of a namespace
    string fname = category + "/" + ns + "/list.html";
    ofstream list_file(fname.c_str());
    DDHtmlFormatter f;
    list_file << f.header(text)
              << f.p("Instances in Namespace <b>" + ns + "</b><br>");
    list_file << f.ul();
    // loop over all instances of a single namespace
    set<string>::const_iterator nit(it->second.begin()), ned(it->second.end());
    for(; nit != ned; ++nit) {

      const string & nm = *nit;
      string result_s = nm;

      // details for each instance 
      string d_fname = category + "/" + ns + "/" + nm + ".html";
      ofstream detail_file(d_fname.c_str());
      DDName an(nm,ns);
      bool result = dtls.details(detail_file, an);

      if (!result) result_s = ">> ERROR: " + nm + " <<";
      list_file << f.li(f.lnk(nm+".html", result_s, "_details"));          
      
    }
    list_file << f.ulEnd() << f.footer();
  }
}
ostream& operator<< ( ostream &  o,
const DDHtmlFormatter f 
)

Definition at line 22 of file DDHtmlFormatter.cc.

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

{
  o << f.os_.str(); f.os_.str("");
  return o;
}