43 DCOUT_V(
'P',
"DDLBooleanSolid::processElement started" );
57 double x=0.0,
y=0.0,
z=0.0;
62 if( myrSolid->
size() == 0 )
65 if ( atts.find(
"firstSolid") != atts.end() && atts.find(
"secondSolid") != atts.end() ) {
69 std::string
s (
"DDLBooleanSolid did not find any solids with which to form a boolean solid.");
74 else if (myrSolid->
size() == 2)
76 ddn1 = myrSolid->
getDDName(nmspace,
"name", 0);
77 ddn2 = myrSolid->
getDDName(nmspace,
"name", 1);
79 std::string
s(
"DDLBooleanSolid did not find any solids with which to form a boolean solid.");
84 if (myTranslation->
size() > 0)
88 x = ev.
eval(nmspace, atts.find(
"x")->second);
89 y = ev.
eval(nmspace, atts.find(
"y")->second);
90 z = ev.
eval(nmspace, atts.find(
"z")->second);
93 if (myrRotation->
size() > 0)
100 if (name ==
"UnionSolid") {
108 else if (name ==
"SubtractionSolid") {
116 else if (name ==
"IntersectionSolid") {
125 throw cms::Exception(
"DDException") <<
"DDLBooleanSolid was asked to do something other than Union-, Subtraction- or IntersectionSolid?";
133 myTranslation->
clear();
134 myrRotation->
clear();
137 DCOUT_V(
'P',
"DDLBooleanSolid::processElement completed");
148 s = std::string (
"\n<") + name +
" name=\"" + atts.find(
"name")->second +
"\"";
150 if (atts.find(
"firstSolid") != atts.end()) s+=
" firstSolid=\"" + atts.find(
"firstSolid")->second +
"\"";
151 if (atts.find(
"secondSolid") != atts.end()) s+=
" secondSolid=\"" + atts.find(
"secondSolid")->second +
"\"";
157 if (myrSolid->
size() > 0)
159 for (
size_t i = 0;
i < myrSolid->
size(); ++
i)
162 s+=
"<rSolid name=\"" + atts.find(
"name")->second +
"\"/>\n";
168 if (atts.find(
"x") != atts.end())
169 s+=
" x=\"" + atts.find(
"x")->second +
"\"";
170 if (atts.find(
"y") != atts.end())
171 s+=
" y=\"" + atts.find(
"y")->second +
"\"";
172 if (atts.find(
"z") != atts.end())
173 s+=
" z=\"" + atts.find(
"z")->second +
"\"";
177 if (atts.find(
"name") != atts.end())
179 s+=
"<rRotation name=\"" + atts.find(
"name")->second +
"\"/>\n";
181 s+=
"</" + name +
">\n\n";
DDLElementRegistry * myRegistry_
~DDLBooleanSolid()
Destructor.
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.
DDXMLElement * getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
static value_type & instance()
static DDSolid intersection(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
virtual size_t size(void) const
Number of elements accumulated.
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv)
Processing the element.
Interface of an Expression Evaluator.
DDLBooleanSolid(DDLElementRegistry *myreg)
Constructor.
#define DCOUT_V(M_v_Y, M_v_S)
std::string dumpBooleanSolid(const std::string &name, const std::string &nmspace)
DDLSolid processes Box elements.
virtual double eval(const std::string &ns, const std::string &expr)=0
evaluate an expression expr inside the local namespace
static DDSolid subtraction(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
This is a base class for processing XML elements in the DDD.
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv)
Called by loadAttributes AFTER attributes are loaded.
The main class for processing parsed elements.
virtual void clear(void)
clear this element's contents.
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
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)