CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.

140 : DDHtmlDetails(cat,txt) {}
DDHtmlDetails(const std::string &cat, const std::string &txt)

Member Function Documentation

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

Implements DDHtmlDetails.

Definition at line 160 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(), i, instance, DDBase< N, C >::isDefined(), DDHtmlFormatter::link(), DDHtmlFormatter::lnk(), m, n, DDName::name(), DDMaterial::noOfConstituents(), DDName::ns(), DDHtmlFormatter::p(), alignCSCRings::s, DDHtmlFormatter::table(), DDHtmlFormatter::tableEnd(), DDHtmlFormatter::td(), DDHtmlFormatter::tr(), DDHtmlFormatter::trEnd(), and DDMaterial::z().

161 {
163  static bool once = false;
164  if (!once) {
165  once=true;
166  DDLogicalPart::iterator<DDLogicalPart> it, ed;
167  ed.end();
168 
169  for (; it != ed; ++it) {
170  if (it->isDefined().second)
171  parts_t::instance()[it->material()].insert(*it);
172  }
173  }
174 
175  string s = nm.ns() + " : " + nm.name();
176  DDMaterial ma(nm);
177  os << f_.header(s);
178  os << f_.h2("Material <b>" + s + "</b>");
179  os << f_.br();
180  if ( ma.isDefined().second == false ) {
181  os << "<b>ERROR!<b><br><p>The Material is not defined in namespace " << nm.ns() << "! </p>" << endl;
182  return false;
183  }
184 
185  os << "<p>density = " << ma.density()/g*cm3 << " g/cm3 </p>" << endl;
186  int co = ma.noOfConstituents();
187  if ( co ) {
188  os << f_.p("Composites by fraction-mass:");
189  os << f_.table()
190  << f_.tr() << f_.td("<b>fm</b>") << f_.td("<b>Material</b>") << f_.td("<b>elementary?</b>") << f_.trEnd();
191  for(int i=0; i<co; ++i) {
192  pair<DDMaterial,double> fm = ma.constituent(i);
193  string elem = "ERROR";
194  DDMaterial m = fm.first;
195  double frac = fm.second;
196 
197  if (m.isDefined().second) {
198  if (m.noOfConstituents())
199  elem = "no";
200  else
201  elem = "yes";
202  }
203  os << f_.tr() << "<td>" << frac << "</td>"
204  << f_.td(f_.lnk("../" + m.ddname().ns() + "/" + m.ddname().name() + ".html", m.ddname().fullname(), "_popup"))
205  << f_.td(elem) << f_.trEnd();
206  }
207  os << f_.tableEnd();
208  }
209  else { // if ( co ) ...
210  os << f_.p("ElementaryMaterial:");
211  os << "<p>z = " << ma.z() << "</p>" << endl;
212  os << "<p>a = " << ma.a()/g*mole << "g/mole</p>" << endl;
213  }
214 
215 
216  const set<DDLogicalPart> & lps = parts_t::instance()[ma];
217  set<DDLogicalPart>::const_iterator it(lps.begin()), ed(lps.end());
218  if ( it != ed ) {
219  os << f_.h3("Material used in following LogicalParts:") << endl;
220  os << "<p>" << endl;
221  }
222  for (; it != ed; ++it ) {
223  const DDName & n = it->ddname();
224  os << f_.link("../../lp/" + n.ns() + "/" + n.name() + ".html", n.fullname(), "_popup" );
225  }
226  os << "</p>" << endl;
227  return true;
228 }
int i
Definition: DBlmapReader.cc:9
def_type isDefined() const
Definition: DDBase.h:115
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:101
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
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:56
DDHtmlFormatter table(int border=0)
DDHtmlFormatter tableEnd()
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
Definition: DDMaterial.cc:83
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:87
const N & ddname() const
Definition: DDBase.h:84
ns_type & DDHtmlMaDetails::names ( void  )
virtual

Implements DDHtmlDetails.

Definition at line 91 of file DDHtmlFormatter.cc.

References findNameSpaces(), and DDHtmlDetails::names_.

92 {
93  DDMaterial lp;
95  return names_;
96 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
bool findNameSpaces(T dummy, ns_type &m)