#ifndef AGDDUNIONHH #define AGDDUNIONHH #include #include "agddPos.hh" #include "agddBooleanSolid.hh" #include "agddSection.hh" namespace agdd { class Union : public BooleanSolid { private: vector _posVec; public: explicit Union() : BooleanSolid("union"), _posVec() { }; ~Union() { }; 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); doBooleanSolidThingsToThisElement(theElement()); setSolidPosContainerMaterialName(getMaterialName()); // Now we need to put in the poses. { for (unsigned int i=0; i<_posVec.size(); i++) { _posVec[i]->putMeInThisSolidPosContainer(this); } } cout << "done." << endl; } }; public: void addSolidPos(Pos * pos) { _posVec.push_back(pos); }; }; } // end of namespace #endif