#ifndef AGDDBOXHH #define AGDDBOXHH #include "agddSection.hh" #include "agddPrimarySolid.hh" #include "agddAttribute.hh" #include "DWUnits.hh" #include "agddNumberString.hh" namespace agdd { class Box : public PrimarySolid { private: Attribute _params; public: explicit Box() : PrimarySolid("box"), _params ("X_Y_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 setBox(double xLength, // These arguments should be double yLength, // represented in the internal double zLength) { // unit system. _params.setValue(makeNumberString(xLength/DWmm, // AGDD dtd requires mm yLength/DWmm, zLength/DWmm) ); }; }; } #endif