DDLElementaryMaterial processes ElementaryMaterial elements. More...
#include <DDLElementaryMaterial.h>
Public Member Functions | |
DDLElementaryMaterial (DDLElementRegistry *myreg) | |
Constructor. | |
void | processElement (const std::string &name, const std::string &nmspace, DDCompactView &cpv) |
Processing the element. | |
~DDLElementaryMaterial (void) | |
Destructor. |
DDLElementaryMaterial processes ElementaryMaterial elements.
DDLElementaryMaterial.h - description ------------------- begin : Wed Oct 31 2001 email : case@ucdhep.ucdavis.edu
A simple or elementary material. Some systems distinguish between ions and elements (in the chemical sense). The DDL and this Parser deal with them all as ElementaryMaterial elements (in the XML sense).
Definition at line 25 of file DDLElementaryMaterial.h.
DDLElementaryMaterial::DDLElementaryMaterial | ( | DDLElementRegistry * | myreg | ) |
DDLElementaryMaterial::~DDLElementaryMaterial | ( | void | ) |
void DDLElementaryMaterial::processElement | ( | const std::string & | name, |
const std::string & | nmspace, | ||
DDCompactView & | cpv | ||
) | [virtual] |
Processing the element.
The processElement method completes any necessary work to process the XML element.
For example, this can be used to call the DDCore to make the geometry in memory. There is a default for this so that if not declared in the inheriting class, no processing is done.
Reimplemented from DDXMLElement.
Definition at line 33 of file DDLElementaryMaterial.cc.
References DDXMLElement::clear(), DCOUT_V, ExprEvalInterface::eval(), DDXMLElement::getAttributeSet(), DDXMLElement::getDDName(), instance, and DDLMaterial::setReference().
{ DCOUT_V( 'P', "DDLElementaryMaterial::processElement started" ); ExprEvalInterface & ev = ExprEvalSingleton::instance(); DDXMLAttribute atts = getAttributeSet(); DDMaterial mat = DDMaterial( getDDName( nmspace ), ev.eval( nmspace, atts.find( "atomicNumber" )->second ), ev.eval( nmspace, atts.find( "atomicWeight" )->second ), ev.eval( nmspace, atts.find( "density" )->second )); DDLMaterial::setReference( nmspace, cpv ); clear(); DCOUT_V( 'P', "DDLElementaryMaterial::processElement completed." ); }