CMS 3D CMS Logo

Public Member Functions

DDLElementaryMaterial Class Reference

DDLElementaryMaterial processes ElementaryMaterial elements. More...

#include <DDLElementaryMaterial.h>

Inheritance diagram for DDLElementaryMaterial:
DDLMaterial DDXMLElement

List of all members.

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.

Detailed Description

DDLElementaryMaterial processes ElementaryMaterial elements.

Author:
Michael Case

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.


Constructor & Destructor Documentation

DDLElementaryMaterial::DDLElementaryMaterial ( DDLElementRegistry myreg)

Constructor.

Definition at line 24 of file DDLElementaryMaterial.cc.

  : DDLMaterial( myreg )
{}
DDLElementaryMaterial::~DDLElementaryMaterial ( void  )

Destructor.

Definition at line 28 of file DDLElementaryMaterial.cc.

{}

Member Function Documentation

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(), DDI::Singleton< I >::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." );
}