#ifndef AGDDTRDHH #define AGDDTRDHH #include "agddSection.hh" #include "agddPrimarySolid.hh" #include "agddAttribute.hh" #include "DWUnits.hh" #include "agddNumberString.hh" namespace agdd { class Trd : public PrimarySolid { private: Attribute _params; public: explicit Trd() : PrimarySolid("trd"), _params ("Xmp_Ymp_Z" , Attribute::required) { }; void putMyselfIn(Section * sec) { assert(sec); // If this composition is already in a section, we need not go further. if (thisVolumeIsNotInSomeSection()) { cout << "Creating a " << flush << getTag() << " named " << flush << getName() << " ... " << endl; makeTheElement(); putThisVolumeElementIntoThisSection(theElement(), sec); doPrimarySolidThingsToThisElement(theElement()); // Now we need to put in the poses. _params.addAttributeTo(theElement()); cout << "done." << endl; } }; void setTrd(double xMinus, double xPlus, // These arguments should be double yMinus, // represented in the internal double yPlus, double zLength) { // unit system. _params.setValue(makeNumberString(xMinus /DWmm, // AGDD dtd requires mm xPlus /DWmm, yMinus /DWmm, yPlus /DWmm, zLength/DWmm) ); }; }; } #endif