41 std::vector<DDSolid> solids;
42 std::vector<DDTranslation> translations;
43 std::vector<DDRotation> rotations;
44 for(
unsigned int i = 0;
i < myrSolids->size(); ++
i )
46 DDName ddname = myrSolids->getDDName( nmspace,
"name",
i );
47 solids.emplace_back(
DDSolid( ddname ));
49 for(
unsigned int i = 0;
i < myTranslations->size(); ++
i )
51 double x = 0.0,
y = 0.0,
z = 0.0;
52 atts = myTranslations->getAttributeSet(
i);
53 x = ev.
eval(nmspace, atts.find(
"x")->second);
54 y = ev.
eval(nmspace, atts.find(
"y")->second);
55 z = ev.
eval(nmspace, atts.find(
"z")->second);
58 for(
unsigned int i = 0;
i < myrRotations->size(); ++
i )
60 DDRotation ddrot = myrRotations->getDDName( nmspace,
"name",
i );
61 rotations.emplace_back( ddrot );
66 if( myrSolids->size() == 0 )
68 std::string s(
"DDLMultiUnionSolid did not find any solids with which to form a multi union solid." );
75 if (name ==
"MultiUnionSolid") {
82 throw cms::Exception(
"DDException") <<
"DDLMultiUnionSolid was asked to do something other than MultiUnion-?";
88 myTranslations->clear();
89 myrRotations->clear();
100 s =
std::string (
"\n<") + name +
" name=\"" + atts.find(
"name")->second +
"\"";
106 if( myrSolids->size() > 0 )
108 for(
size_t i = 0;
i < myrSolids->size(); ++
i )
110 atts = myrSolids->getAttributeSet(
i);
111 s+=
"<rSolid name=\"" + atts.find(
"name")->second +
"\"/>\n";
115 for(
size_t i = 0;
i < myTranslations->size(); ++
i )
117 atts = myTranslations->getAttributeSet(
i);
119 if (atts.find(
"x") != atts.end())
120 s+=
" x=\"" + atts.find(
"x")->second +
"\"";
121 if (atts.find(
"y") != atts.end())
122 s+=
" y=\"" + atts.find(
"y")->second +
"\"";
123 if (atts.find(
"z") != atts.end())
124 s+=
" z=\"" + atts.find(
"z")->second +
"\"";
128 for(
size_t i = 0;
i < myrRotations->size(); ++
i )
130 atts = myrRotations->getAttributeSet(
i);
131 if (atts.find(
"name") != atts.end())
133 s+=
"<rRotation name=\"" + atts.find(
"name")->second +
"\"/>\n";
135 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)