--- trunk/src/selection/SelectionManager.hpp 2005/02/03 23:14:05 283 +++ trunk/src/selection/SelectionManager.hpp 2005/02/16 19:36:30 353 @@ -43,16 +43,17 @@ #define SELECTION_SELECTIONMANAGER_HPP #include "utils/BitSet.hpp" - +#include "primitives/StuntDouble.hpp" namespace oopse { +class SimInfo; /** * @class SelectionManager SelectionManager.hpp "selection/SelectionManager.hpp" * @brief */ class SelectionManager { public: - SelectionManager(int size) {bsSelection_.resize(size); clearSelection;} + SelectionManager(SimInfo* info); void addSelection(StuntDouble* sd) { bsSelection_.setBitOn(sd->getGlobalIndex()); @@ -100,17 +101,49 @@ class SelectionManager { } int getSelectionCount() { - bsSelection_.countBits(); + return bsSelection_.countBits(); } BitSet getSelectionSet() { return bsSelection_; } + + + StuntDouble* beginSelected(int& i); + StuntDouble* nextSelected(int& i); + + StuntDouble* beginUnselected(int& i); + StuntDouble* nextUnSelected(int& i); + + SelectionManager& operator&= (const SelectionManager &sman) { + bsSelection_ &= sman.bsSelection_; + return *this; + } - private: + SelectionManager& operator|= (const SelectionManager &sman) { + bsSelection_ |= sman.bsSelection_; + return *this; + } - BitSet bsSelection_; + SelectionManager& operator^= (const SelectionManager &sman) { + bsSelection_ ^= sman.bsSelection_; + return *this; + } + + SelectionManager& operator-= (const SelectionManager &sman) { + bsSelection_ -= sman.bsSelection_; + return *this; + } + + friend SelectionManager operator| (const SelectionManager& sman1, const SelectionManager& sman2); + friend SelectionManager operator& (const SelectionManager& sman1, const SelectionManager& sman2); + friend SelectionManager operator^ (const SelectionManager& sman1, const SelectionManager& sman2); + friend SelectionManager operator-(const SelectionManager& sman1, const SelectionManager& sman2); + + private: SimInfo* info_; + BitSet bsSelection_; + std::vector stuntdoubles_; }; }