CMS 3D CMS Logo

List of all members | Public Member Functions
DDHtmlMaDetails Class Reference

#include <DDHtmlFormatter.h>

Inheritance diagram for DDHtmlMaDetails:
DDHtmlDetails

Public Member Functions

 DDHtmlMaDetails (const std::string &cat, const std::string &txt)
 
bool details (std::ostream &os, const DDName &)
 
ns_typenames ()
 
- Public Member Functions inherited from DDHtmlDetails
const std::string & category ()
 
 DDHtmlDetails (const std::string &cat, const std::string &txt)
 
const std::string & text ()
 
virtual ~DDHtmlDetails ()
 

Additional Inherited Members

- Protected Attributes inherited from DDHtmlDetails
std::string cat_
 
DDHtmlFormatter f_
 
ns_type names_
 
std::string txt_
 

Detailed Description

Definition at line 137 of file DDHtmlFormatter.h.

Constructor & Destructor Documentation

DDHtmlMaDetails::DDHtmlMaDetails ( const std::string &  cat,
const std::string &  txt 
)
inline

Definition at line 140 of file DDHtmlFormatter.h.

References cscdqm::h::names.

140 : DDHtmlDetails(cat,txt) {}
def cat(path)
Definition: eostools.py:400
DDHtmlDetails(const std::string &cat, const std::string &txt)

Member Function Documentation

bool DDHtmlMaDetails::details ( std::ostream &  os,
const DDName  
)
virtual

Implements DDHtmlDetails.

Definition at line 174 of file DDHtmlFormatter.cc.

References DDMaterial::a(), DDHtmlFormatter::br(), DDMaterial::constituent(), DDBase< N, C >::ddname(), DDMaterial::density(), HTMLExport::elem(), DDHtmlDetails::f_, funct::false, cropTnPTrees::frac, DDName::fullname(), g, DDHtmlFormatter::h2(), DDHtmlFormatter::h3(), DDHtmlFormatter::header(), mps_fire::i, instance, DDBase< N, C >::isDefined(), DDHtmlFormatter::link(), DDHtmlFormatter::lnk(), funct::m, gen::n, DDName::name(), DDMaterial::noOfConstituents(), DDName::ns(), DDHtmlFormatter::p(), alignCSCRings::s, DDHtmlFormatter::table(), DDHtmlFormatter::tableEnd(), DDHtmlFormatter::td(), DDHtmlFormatter::tr(), DDHtmlFormatter::trEnd(), and DDMaterial::z().

175 {
177  static bool once = false;
178  if (!once) {
179  once=true;
180  DDLogicalPart::iterator<DDLogicalPart> it, ed;
181  ed.end();
182 
183  for (; it != ed; ++it) {
184  if (it->isDefined().second)
185  parts_t::instance()[it->material()].insert(*it);
186  }
187  }
188 
189  string s = nm.ns() + " : " + nm.name();
190  DDMaterial ma(nm);
191  os << f_.header(s);
192  os << f_.h2("Material <b>" + s + "</b>");
193  os << f_.br();
194  if ( ma.isDefined().second == false ) {
195  os << "<b>ERROR!<b><br><p>The Material is not defined in namespace " << nm.ns() << "! </p>" << endl;
196  return false;
197  }
198 
199  os << "<p>density = " << ma.density()/g*cm3 << " g/cm3 </p>" << endl;
200  int co = ma.noOfConstituents();
201  if ( co ) {
202  os << f_.p("Composites by fraction-mass:");
203  os << f_.table()
204  << f_.tr() << f_.td("<b>fm</b>") << f_.td("<b>Material</b>") << f_.td("<b>elementary?</b>") << f_.trEnd();
205  for(int i=0; i<co; ++i) {
206  pair<DDMaterial,double> fm = ma.constituent(i);
207  string elem = "ERROR";
208  DDMaterial m = fm.first;
209  double frac = fm.second;
210 
211  if (m.isDefined().second) {
212  if (m.noOfConstituents())
213  elem = "no";
214  else
215  elem = "yes";
216  }
217  os << f_.tr() << "<td>" << frac << "</td>"
218  << f_.td(f_.lnk("../" + m.ddname().ns() + "/" + m.ddname().name() + ".html", m.ddname().fullname(), "_popup"))
219  << f_.td(elem) << f_.trEnd();
220  }
221  os << f_.tableEnd();
222  }
223  else { // if ( co ) ...
224  os << f_.p("ElementaryMaterial:");
225  os << "<p>z = " << ma.z() << "</p>" << endl;
226  os << "<p>a = " << ma.a()/g*mole << "g/mole</p>" << endl;
227  }
228 
229 
230  const set<DDLogicalPart> & lps = parts_t::instance()[ma];
231  set<DDLogicalPart>::const_iterator it(lps.begin()), ed(lps.end());
232  if ( it != ed ) {
233  os << f_.h3("Material used in following LogicalParts:") << endl;
234  os << "<p>" << endl;
235  }
236  for (; it != ed; ++it ) {
237  const DDName & n = it->ddname();
238  os << f_.link("../../lp/" + n.ns() + "/" + n.name() + ".html", n.fullname(), "_popup" );
239  }
240  os << "</p>" << endl;
241  return true;
242 }
def_type isDefined() const
Definition: DDBase.h:110
static PFTauRenderPlugin instance
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
DDHtmlFormatter br()
DDHtmlFormatter h3(const std::string &content)
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
DDHtmlFormatter td(const std::string &content)
DDHtmlFormatter f_
DDHtmlFormatter p(const std::string &content)
DDHtmlFormatter h2(const std::string &content)
const std::string fullname() const
Definition: DDName.h:53
DDHtmlFormatter table(int border=0)
def elem(elemtype, innerHTML='', html_class='', kwargs)
Definition: HTMLExport.py:18
DDHtmlFormatter tableEnd()
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
Definition: DDMaterial.cc:85
DDHtmlFormatter tr()
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 trEnd()
DDHtmlFormatter link(const std::string &url, const std::string &text, const std::string &target="_self")
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
const N & ddname() const
Definition: DDBase.h:80
ns_type & DDHtmlMaDetails::names ( void  )
virtual

Implements DDHtmlDetails.

Definition at line 105 of file DDHtmlFormatter.cc.

References findNameSpaces(), and DDHtmlDetails::names_.

106 {
107  DDMaterial lp;
108  findNameSpaces(lp, names_);
109  return names_;
110 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
bool findNameSpaces(T dummy, ns_type &m)