#ifndef AGDDCONSHH #define AGDDCONSHH #include "agddSection.hh" #include "agddPrimarySolid.hh" #include "agddAttribute.hh" #include "DWUnits.hh" #include "agddNumberString.hh" namespace agdd { class Cons : public PrimarySolid { private: Attribute _params; public: explicit Cons() : PrimarySolid("cons"), _params ("Rio1_Rio2_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 setCons(double r1Min, double r1Max, double r2Min, double r2Max, double zLength, double phi1 = 0.0*DWdegree, double phi2 = 360.0*DWdegree) { _params.setValue( makeNumberString(r1Min/DWmm,r1Max/DWmm)+" "+ makeNumberString(r2Min/DWmm,r2Max/DWmm)+" "+ makeNumberString(zLength/DWmm)+" "+ makeNumberString(phi1/DWdegree, phi2/DWdegree) ); }; }; } #endif