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.
2 
3 #include <map>
4 #include <utility>
5 #include <vector>
6 
9 
10 class DDCompactView;
11 
13  : DDXMLElement( myreg )
14 {}
15 
16 void
18 {
19  // in case it there were any rMaterials
20  myRegistry_->getElement("rMaterial")->clear();
21 
22  // Attempt to make sure Material elements can be in LogicalPart elements.
23  if (myRegistry_->getElement("LogicalPart")->size() > 0)
24  {
25  DDXMLElement* refmat = myRegistry_->getElement("rMaterial");
26  std::vector<std::string> names;
27  std::vector<std::string> values;
28  names.push_back("name");
30  values.push_back(atts.find("name")->second);
31  refmat->loadAttributes("rMaterial", names, values, nmspace, cpv);
32  }
33  // clear THIS material's values.
34  clear();
35 }
DDLElementRegistry * myRegistry_
Definition: DDXMLElement.h:172
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:73
type of data representation of DDCompactView
Definition: DDCompactView.h:90
std::map< std::string, std::string > DDXMLAttribute
Definition: DDXMLElement.h:45
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:36
virtual size_t size(void) const
Number of elements accumulated.
virtual void setReference(const std::string &nmspace, DDCompactView &cpv)
Definition: DDLMaterial.cc:17
This is a base class for processing XML elements in the DDD.
Definition: DDXMLElement.h:48
DDLMaterial(DDLElementRegistry *myreg)
Definition: DDLMaterial.cc:12
The main class for processing parsed elements.
virtual void clear(void)
clear this element&#39;s contents.
Definition: DDXMLElement.cc:55