42 std::vector<double>
x,
y;
43 for(
size_t i = 0;
i < myXYPoints->size(); ++
i )
45 atts = myXYPoints->getAttributeSet(
i );
46 auto xit = atts.find(
"x" );
47 if( xit != atts.end())
48 x.push_back( ev.
eval( nmspace, xit->second ));
49 auto yit = atts.find(
"y" );
50 if( yit != atts.end())
51 y.push_back( ev.
eval( nmspace, yit->second ));
53 assert( x.size() == y.size());
56 std::vector<double>
z, zx, zy, zscale;
58 for(
size_t i = 0;
i < myZXYSection->size(); ++
i )
60 atts = myZXYSection->getAttributeSet(
i );
61 auto zit = atts.find(
"z" );
62 if( zit != atts.end())
63 z.push_back( ev.
eval( nmspace, zit->second ));
64 auto xit = atts.find(
"x" );
65 if( xit != atts.end())
66 zx.push_back( ev.
eval( nmspace, xit->second ));
67 auto yit = atts.find(
"y" );
68 if( yit != atts.end())
69 zy.push_back( ev.
eval( nmspace, yit->second ));
70 auto sit = atts.find(
"scale" );
71 if( sit != atts.end())
72 zscale.push_back( std::stod( sit->second ));
74 assert( z.size() == zx.size());
75 assert( z.size() == zy.size());
76 assert( z.size() == zscale.size());
79 if( name ==
"ExtrudedPolygon" )
87 std::string msg =
"\nDDLPgonGenerator::processElement was called with incorrect name of solid: " +
name;
94 myZXYSection->clear();
DDLElementRegistry * myRegistry_
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.
type of data representation of DDCompactView
std::map< std::string, std::string > DDXMLAttribute
A DDSolid represents the shape of a part.
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Called by loadAttributes AFTER attributes are loaded.
ClhepEvaluator & evaluator()
std::shared_ptr< DDXMLElement > getElement(const std::string &name)
THE most important part. Getting the pointer to a given element type.
DDLPgonGenerator(DDLElementRegistry *myreg)
DDLSolid processes Box elements.
static DDSolid extrudedpolygon(const DDName &name, const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &z, const std::vector< double > &zx, const std::vector< double > &zy, const std::vector< double > &zscale)
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Processing the element.
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.
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)