CMS 3D CMS Logo

Public Member Functions

DDLMaterial Class Reference

DDLMaterial processes Box elements. More...

#include <DDLMaterial.h>

Inheritance diagram for DDLMaterial:
DDXMLElement DDLCompositeMaterial DDLElementaryMaterial

List of all members.

Public Member Functions

 DDLMaterial (DDLElementRegistry *myreg)
 Constructor.
virtual void setReference (const std::string &nmspace, DDCompactView &cpv)
virtual ~DDLMaterial (void)
 Destructor.

Detailed Description

DDLMaterial processes Box elements.

Author:
Michael Case

DDLMaterial.h - description ------------------- begin: Fri Oct 04 2002 email: case@ucdhep.ucdavis.edu

This class currently serves one purpose only. That is to create a reference to the most recently created Material, no matter whether it is an ElementaryMaterial or CompositeMaterial.

Definition at line 26 of file DDLMaterial.h.


Constructor & Destructor Documentation

DDLMaterial::DDLMaterial ( DDLElementRegistry myreg)

Constructor.

Definition at line 18 of file DDLMaterial.cc.

  : DDXMLElement( myreg )
{}
DDLMaterial::~DDLMaterial ( void  ) [virtual]

Destructor.

Definition at line 22 of file DDLMaterial.cc.

{}

Member Function Documentation

void DDLMaterial::setReference ( const std::string &  nmspace,
DDCompactView cpv 
) [virtual]

Definition at line 26 of file DDLMaterial.cc.

References DDXMLElement::clear(), DCOUT_V, DDXMLElement::getAttributeSet(), DDLElementRegistry::getElement(), DDXMLElement::loadAttributes(), DDXMLElement::myRegistry_, cscdqm::h::names, DDXMLElement::size(), and makeHLTPrescaleTable::values.

Referenced by DDLCompositeMaterial::processElement(), and DDLElementaryMaterial::processElement().

{
  // in case it there were any rMaterials
  myRegistry_->getElement("rMaterial")->clear();

  // Attempt to make sure Material elements can be in LogicalPart elements.
  if (myRegistry_->getElement("LogicalPart")->size() > 0)
    {
      DDXMLElement* refmat = myRegistry_->getElement("rMaterial");
      std::vector<std::string> names;
      std::vector<std::string> values;
      names.push_back("name");
      DDXMLAttribute atts = getAttributeSet();
      values.push_back(atts.find("name")->second);
      refmat->loadAttributes("rMaterial", names, values, nmspace, cpv);
    }
  // clear THIS material's values.
  clear();

  DCOUT_V('P', "DDLMaterial::setReference completed");
}