#ifndef AGDBPOSXYZHH #define AGDBPOSXYZHH #include "ExpatInterface/Element.h" #include "agdbPos.hh" #include "agdbBase.hh" #include "agdbVolume.hh" #include "agdbAttribute.hh" namespace agdb { class PosXYZ : public Pos { private: Volume * _volume; // volume IDREF #REQUIRED Attribute _xYZ; Attribute _rot; public: PosXYZ() : Pos("posXYZ"), _volume(0), _xYZ("X_Y_Z", "0 0 0"), _rot("rot" , "0 0 0") { }; void putMeIn(xml::Element & parent) { //cout << "posXYZ put me in" << endl; xml::Element * child = new xml::Element(); assert(child); parent.addChild(child); // LESTER Must complete ... add checks child->setTagName(Base::getTagName()); // crude check assert(_volume); child->addAttribute("volume", _volume->getName()); _xYZ.addAttributeTo(child); _rot.addAttributeTo(child); // "volume", _volume->getName()); //child->addAttribute("X_Y_Z", makeNumberString(_y, _y, _z)); }; PosXYZ & setVolume(Volume * volume) { assert(volume); _volume = volume; return *this; }; PosXYZ & setVolume(Volume & volume) { _volume = &volume; return *this; }; PosXYZ & setXYZ(double x, double y, double z) { _xYZ.setValue(makeNumberString(x,y,z)); return *this; }; PosXYZ & setRot(double x, double y, double z) { _rot.setValue(makeNumberString(x,y,z)); return *this; }; }; } #endif