--- trunk/src/selection/SelectionManager.hpp 2005/02/01 22:49:23 278 +++ trunk/src/selection/SelectionManager.hpp 2005/02/03 23:14:05 283 @@ -52,15 +52,65 @@ class SelectionManager { */ class SelectionManager { public: - SelectionManager(); + SelectionManager(int size) {bsSelection_.resize(size); clearSelection;} + void addSelection(StuntDouble* sd) { + bsSelection_.setBitOn(sd->getGlobalIndex()); + } + + void addSelectionSet(const BitSet& bs) { + bsSelection_ |= bs; + } - bool isSelected(StuntDouble* sd); + void setSelection(StuntDouble* sd) { + bsSelection_.clearAll(); + bsSelection_.setBitOn(sd->getGlobalIndex()); + } + void setSelectionSet(const BitSet& bs) { + bsSelection_ = bs; + } + + void toggleSelection(StuntDouble* sd) { + bsSelection_.flip(sd->getGlobalIndex()); + } + + void toggleSelection() { + bsSelection_.flip(); + } + + void selectAll() { + bsSelection_.setAll(); + } + + void clearSelection() { + bsSelection_.clearAll(); + } + + void clearSelection(StuntDouble* sd) { + bsSelection_.setBitOff(sd->getGlobalIndex()); + } + + bool isSelected(StuntDouble* sd) { + return bsSelection_[sd->getGlobalIndex()]; + } + + bool isEmpty() { + return bsSelection_.none(); + } + + int getSelectionCount() { + bsSelection_.countBits(); + } + + BitSet getSelectionSet() { + return bsSelection_; + } + private: - BitSet bsSelection; - BitSet bsNull; + BitSet bsSelection_; + SimInfo* info_; }; }