CMS 3D CMS Logo

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  auto 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 "row" 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
std::shared_ptr< DDXMLElement > getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
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