BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnHtmlReportElement.cxx
Go to the documentation of this file.
1/**
2 * \file BmnHtmlReportElement.cxx
3 * \author Semen Lebedev <s.lebedev@gsi.de>
4 * \date 2011
5 */
7
8#include <sstream>
9
10using std::endl;
11using std::stringstream;
12
14
16
17string BmnHtmlReportElement::TableBegin(const string& caption, const vector<string>& colNames) const
18{
19 stringstream ss;
20 ss << "<h2>" << caption << "</h2>";
21 ss << "<table id=\"efficiency\" >" << endl;
22 ss << "<tr>";
23 for (size_t i = 0; i < colNames.size(); i++)
24 ss << "<th>" << colNames[i] << "</th>";
25 ss << "</tr>" << endl;
26 return ss.str();
27}
28
30{
31 return "</table>";
32}
33
34string BmnHtmlReportElement::TableEmptyRow(int nofCols, const string& name) const
35{
36 stringstream ss;
37 ss << "<td colspan=\"" << nofCols << "\"><center><b>" << name << "</b></center></td></tr>" << endl;
38 return ss.str();
39}
40
41string BmnHtmlReportElement::TableRow(const vector<string>& row) const
42{
43 string st = "<tr>";
44 for (size_t i = 0; i < row.size(); i++)
45 st += "<td>" + row[i] + "</td>";
46 st += "</tr> \n";
47 return st;
48}
49
50string BmnHtmlReportElement::Image(const string& title, const string& file) const
51{
52 stringstream ss;
53 ss << "<h3>" << title << "</h3>";
54 ss << "<img src=\"" << file << ".png\" alt=\"" << title << "\" />";
55
56 return ss.str();
57}
58
60{
61 string str = "<html><body><head><style type=\"text/css\">";
62 str += "#efficiency";
63 str += "{";
64 str += "font-family:Verdana, Arial, Helvetica, sans-serif;";
65 // str += "width:100%;";
66 str += "border-collapse:collapse;";
67 str += "}";
68 str += "#efficiency td, #efficiency th";
69 str += "{";
70 str += "font-size:1em;";
71 str += "border:1px solid #98bf21;";
72 str += "padding:3px 7px 2px 7px;";
73 str += "}";
74 str += "#efficiency th";
75 str += "{";
76 str += "font-size:1.1em;";
77 str += "text-align:left;";
78 str += "padding-top:5px;";
79 str += "padding-bottom:4px;";
80 str += "background-color:#A7C942;";
81 str += "color:#ffffff;";
82 str += "}";
83 str += "#efficiency tr.alt td";
84 str += "{";
85 str += "color:#000000;";
86 str += "background-color:#EAF2D3;";
87 str += "}";
88 str += "</style></head>";
89 return str;
90}
91
93{
94 return "</body></html>";
95}
96
97string BmnHtmlReportElement::Title(int size, const string& title) const
98{
99 stringstream ss;
100 ss << "<h" << size + 1 << ">" << title << "</h" << size + 1 << ">";
101 return ss.str();
102}
int i
Definition P4_F32vec4.h:22
Implementation of BmnReportElement for HTML output.
virtual string DocumentEnd() const
Inherited from BmnReportElement.
virtual string TableEmptyRow(int nofCols, const string &name) const
Inherited from BmnReportElement.
virtual ~BmnHtmlReportElement()
Destructor.
virtual string Image(const string &title, const string &file) const
Inherited from BmnReportElement.
virtual string TableBegin(const string &caption, const vector< string > &colNames) const
Inherited from BmnReportElement.
virtual string TableEnd() const
Inherited from BmnReportElement.
virtual string Title(int size, const string &title) const
Inherited from BmnReportElement.
virtual string DocumentBegin() const
Inherited from BmnReportElement.
virtual string TableRow(const vector< string > &row) const
Inherited from BmnReportElement.