#ifndef AGDDCOMPOSHH #define AGDDCOMPOSHH namespace agdd { class Compos; } #include #include "agddSection.hh" #include "agddVolume.hh" #include "agddPos.hh" #include "agddHasTag.hh" #include "agddPosContainer.hh" #include "ExpatInterface/Element.h" namespace agdd { class Compos : public Volume, public HasTag , public PosContainer { private: vector _posVec; // Pointed to for reference. // May or may not be our responsibility. public: Compos() : Volume(), HasTag("composition"), PosContainer(), _posVec() { }; ~Compos() { }; xml::Element * posElementsGoHere() { assert(thisVolumeIsInSomeSection()); return theElement(); }; Section * defaultSection() { assert(thisVolumeIsInSomeSection()); return getSection(); }; 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); doVolumeThingsToThisElement(theElement()); // Now we need to put in the poses. { for (unsigned int i=0; i<_posVec.size(); i++) { _posVec[i]->putMeInThisPosContainer(this); } } cout << "done." << endl; } }; public: void addPos(Pos * pos) { _posVec.push_back(pos); }; }; } // end of namespace #endif