43 std::vector<DDSolid> solids;
44 std::vector<DDTranslation> translations;
45 std::vector<DDRotation> rotations;
46 for(
unsigned int i = 0;
i < myrSolids->size(); ++
i )
48 DDName ddname = myrSolids->getDDName( nmspace,
"name",
i );
49 solids.emplace_back(
DDSolid( ddname ));
51 for(
unsigned int i = 0;
i < myTranslations->size(); ++
i )
53 double x = 0.0,
y = 0.0,
z = 0.0;
54 atts = myTranslations->getAttributeSet(
i);
55 x = ev.
eval(nmspace, atts.find(
"x")->second);
56 y = ev.
eval(nmspace, atts.find(
"y")->second);
57 z = ev.
eval(nmspace, atts.find(
"z")->second);
60 for(
unsigned int i = 0;
i < myrRotations->size(); ++
i )
62 DDRotation ddrot = myrRotations->getDDName( nmspace,
"name",
i );
63 rotations.emplace_back( ddrot );
68 if( myrSolids->size() == 0 )
70 std::string s(
"DDLMultiUnionSolid did not find any solids with which to form a multi union solid." );
77 if (name ==
"MultiUnionSolid") {
84 throw cms::Exception(
"DDException") <<
"DDLMultiUnionSolid was asked to do something other than MultiUnion-?";
90 myTranslations->clear();
91 myrRotations->clear();
102 s =
std::string (
"\n<") + name +
" name=\"" + atts.find(
"name")->second +
"\"";
108 if( myrSolids->size() > 0 )
110 for(
size_t i = 0;
i < myrSolids->size(); ++
i )
112 atts = myrSolids->getAttributeSet(
i);
113 s+=
"<rSolid name=\"" + atts.find(
"name")->second +
"\"/>\n";
117 for(
size_t i = 0;
i < myTranslations->size(); ++
i )
119 atts = myTranslations->getAttributeSet(
i);
121 if (atts.find(
"x") != atts.end())
122 s+=
" x=\"" + atts.find(
"x")->second +
"\"";
123 if (atts.find(
"y") != atts.end())
124 s+=
" y=\"" + atts.find(
"y")->second +
"\"";
125 if (atts.find(
"z") != atts.end())
126 s+=
" z=\"" + atts.find(
"z")->second +
"\"";
130 for(
size_t i = 0;
i < myrRotations->size(); ++
i )
132 atts = myrRotations->getAttributeSet(
i);
133 if (atts.find(
"name") != atts.end())
135 s+=
"<rRotation name=\"" + atts.find(
"name")->second +
"\"/>\n";
137 s+=
"</" + name +
">\n\n";
DDLElementRegistry * myRegistry_
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Processing the element.
static DDSolid multiUnionSolid(const DDName &name, const std::vector< DDSolid > &a, const std::vector< DDTranslation > &t, const std::vector< DDRotation > &r)
DDLMultiUnionSolid(DDLElementRegistry *myreg)
virtual const DDXMLAttribute & getAttributeSet(size_t aIndex=0) const
Get a "row" of attributes, i.e. one attribute set.
void throwError(const std::string &keyMessage) const
format std::string for throw an error.
DDName is used to identify DDD entities uniquely.
type of data representation of DDCompactView
std::map< std::string, std::string > DDXMLAttribute
A DDSolid represents the shape of a part.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
ClhepEvaluator & evaluator()
std::shared_ptr< DDXMLElement > getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
DDLSolid processes Box elements.
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Called by loadAttributes AFTER attributes are loaded.
double eval(const std::string &ns, const std::string &expr)
The main class for processing parsed elements.
virtual void clear(void)
clear this element's contents.
std::string dumpMultiUnionSolid(const std::string &name, const std::string &nmspace)
virtual const DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
void setReference(const std::string &nmspace, DDCompactView &cpv)