test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDLMaterial.cc
Go to the documentation of this file.
1 /***************************************************************************
2  DDLMaterial.cc - description
3  -------------------
4  begin : Wed Oct 3 2002
5  email : case@ucdhep.ucdavis.edu
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * DDDParser sub-component of DDD *
11  * *
12  ***************************************************************************/
13 
15 
17 
19  : DDXMLElement( myreg )
20 {}
21 
23 {}
24 
25 void
27 {
28  // in case it there were any rMaterials
29  myRegistry_->getElement("rMaterial")->clear();
30 
31  // Attempt to make sure Material elements can be in LogicalPart elements.
32  if (myRegistry_->getElement("LogicalPart")->size() > 0)
33  {
34  DDXMLElement* refmat = myRegistry_->getElement("rMaterial");
35  std::vector<std::string> names;
36  std::vector<std::string> values;
37  names.push_back("name");
39  values.push_back(atts.find("name")->second);
40  refmat->loadAttributes("rMaterial", names, values, nmspace, cpv);
41  }
42  // clear THIS material's values.
43  clear();
44 
45  DCOUT_V('P', "DDLMaterial::setReference completed");
46 }
DDLElementRegistry * myRegistry_
Definition: DDXMLElement.h:186
static const HistoName names[]
virtual const DDXMLAttribute & getAttributeSet(size_t aIndex=0) const
Get a &quot;row&quot; of attributes, i.e. one attribute set.
Definition: DDXMLElement.cc:79
type of data representation of DDCompactView
Definition: DDCompactView.h:77
std::map< std::string, std::string > DDXMLAttribute
Definition: DDXMLElement.h:55
DDXMLElement * getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
void loadAttributes(const std::string &elemName, const std::vector< std::string > &names, const std::vector< std::string > &values, const std::string &nmspace, DDCompactView &cpv)
Load the element attributes.
Definition: DDXMLElement.cc:41
virtual size_t size(void) const
Number of elements accumulated.
virtual void setReference(const std::string &nmspace, DDCompactView &cpv)
Definition: DDLMaterial.cc:26
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
virtual ~DDLMaterial(void)
Destructor.
Definition: DDLMaterial.cc:22
This is a base class for processing XML elements in the DDD.
Definition: DDXMLElement.h:58
DDLMaterial(DDLElementRegistry *myreg)
Constructor.
Definition: DDLMaterial.cc:18
The main class for processing parsed elements.
virtual void clear(void)
clear this element&#39;s contents.
Definition: DDXMLElement.cc:61