45#ifndef SELECTION_SELECTIONMANAGER_HPP
46#define SELECTION_SELECTIONMANAGER_HPP
54#include "selection/SelectionSet.hpp"
66 void addSelection(
Bond* b) {
69 void addSelection(
Bend* b) {
86 ss_.bitsets_[
BOND] |= bs.bitsets_[
BOND];
89 ss_.bitsets_[
BEND] |= bs.bitsets_[
BEND];
102 return ss_.bitsets_[
STUNTDOUBLE].none() && ss_.bitsets_[
BOND].none() &&
103 ss_.bitsets_[
BEND].none() && ss_.bitsets_[
TORSION].none() &&
108 for (
int i = 0; i < N_SELECTIONTYPES; i++)
109 ss_.bitsets_[i] = bs.bitsets_[i];
116 ss_.bitsets_[
BOND] = bs.bitsets_[
BOND];
119 ss_.bitsets_[
BEND] = bs.bitsets_[
BEND];
131 std::vector<int> getSelectionCounts() {
132 std::vector<int> counts(N_SELECTIONTYPES, 0);
133 for (
int i = 0; i < N_SELECTIONTYPES; i++) {
134 counts[i] = ss_.bitsets_[i].countBits();
139 int getSelectionCount() {
return ss_.bitsets_[
STUNTDOUBLE].countBits(); }
140 int getBondSelectionCount() {
return ss_.bitsets_[
BOND].countBits(); }
141 int getBendSelectionCount() {
return ss_.bitsets_[
BEND].countBits(); }
142 int getTorsionSelectionCount() {
return ss_.bitsets_[
TORSION].countBits(); }
143 int getInversionSelectionCount() {
144 return ss_.bitsets_[
INVERSION].countBits();
146 int getMoleculeSelectionCount() {
147 return ss_.bitsets_[
MOLECULE].countBits();
168 void setSelection(
Bond* b) {
169 ss_.bitsets_[
BOND].clearAll();
172 void setSelection(
Bend* b) {
173 ss_.bitsets_[
BEND].clearAll();
176 void setSelection(
Torsion* t) {
177 ss_.bitsets_[
TORSION].clearAll();
192 void toggleSelection(
Bond* b) {
195 void toggleSelection(
Bend* b) {
198 void toggleSelection(
Torsion* t) {
208 void toggleSelection() {
209 for (
int i = 0; i < N_SELECTIONTYPES; i++)
210 ss_.bitsets_[i].flip();
214 for (
int i = 0; i < N_SELECTIONTYPES; i++)
215 ss_.bitsets_[i].setAll();
218 void clearSelection() {
219 for (
int i = 0; i < N_SELECTIONTYPES; i++)
220 ss_.bitsets_[i].clearAll();
229 void clearSelection(
Bond* b) {
232 void clearSelection(
Bend* b) {
235 void clearSelection(
Torsion* t) {
245 bool isGlobalIDSelected(
int globalIndex) {
495 for (
int i = 0; i < N_SELECTIONTYPES; i++)
496 ss_.bitsets_[i] &= sman.ss_.bitsets_[i];
501 for (
int i = 0; i < N_SELECTIONTYPES; i++)
502 ss_.bitsets_[i] |= sman.ss_.bitsets_[i];
507 for (
int i = 0; i < N_SELECTIONTYPES; i++)
508 ss_.bitsets_[i] ^= sman.ss_.bitsets_[i];
513 for (
int i = 0; i < N_SELECTIONTYPES; i++)
514 ss_.bitsets_[i] -= sman.ss_.bitsets_[i];
530 std::vector<int> nObjects_;
531 std::vector<StuntDouble*> stuntdoubles_;
532 std::vector<Bond*> bonds_;
533 std::vector<Bend*> bends_;
534 std::vector<Torsion*> torsions_;
535 std::vector<Inversion*> inversions_;
536 std::vector<Molecule*> molecules_;
int getGlobalIndex()
Returns the global index of this molecule.
Bend * nextUnselectedBend(int &i)
Finds the next unselected Bend.
Bend * beginUnselectedBend(int &i)
Finds the first unselected Bend.
Bend * nextSelectedBend(int &i)
Finds the next selected Bend in the selection.
Bond * nextUnselectedBond(int &i)
Finds the next unselected Bond.
Torsion * nextUnselectedTorsion(int &i)
Finds the next unselected Torsion.
Molecule * nthSelectedMolecule(int &n)
Finds the n^th selected Molecule in the selection.
Bend * beginSelectedBend(int &i)
Finds the first selected Bend in the selection.
Bond * nextSelectedBond(int &i)
Finds the next selected Bond in the selection.
Bond * beginSelectedBond(int &i)
Finds the first selected Bond in the selection.
AtomTypeSet getSelectedAtomTypes()
getSelectedAtomTypes
Molecule * nextSelectedMolecule(int &i)
Finds the next selected Molecule in the selection.
StuntDouble * nextSelected(int &i)
Finds the next selected StuntDouble in the selection.
StuntDouble * nextUnselected(int &i)
Finds the next unselected StuntDouble.
Inversion * beginUnselectedInversion(int &i)
Finds the first unselected Inversion.
Inversion * beginSelectedInversion(int &i)
Finds the first selected Inversion in the selection.
StuntDouble * beginSelected(int &i)
Finds the first selected StuntDouble in the selection.
Bond * beginUnselectedBond(int &i)
Finds the first unselected Bond.
Molecule * beginSelectedMolecule(int &i)
Finds the first selected Molecule in the selection.
Torsion * beginSelectedTorsion(int &i)
Finds the first selected Torsion in the selection.
Torsion * beginUnselectedTorsion(int &i)
Finds the first unselected Torsion.
Inversion * nextSelectedInversion(int &i)
Finds the next selected Inversion in the selection.
Inversion * nextUnselectedInversion(int &i)
Finds the next unselected Inversion.
Molecule * beginUnselectedMolecule(int &i)
Finds the first unselected Molecule.
Molecule * nextUnselectedMolecule(int &i)
Finds the next unselected Molecule.
StuntDouble * beginUnselected(int &i)
Finds the first unselected StuntDouble.
Torsion * nextSelectedTorsion(int &i)
Finds the next selected Torsion in the selection.
int getGlobalIndex()
Returns the global index of this ShortRangeInteraction.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
"Don't move, or you're dead! Stand up! Captain, we've got them!"
int getGlobalIndex()
Returns the global index of this stuntDouble.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
@ STUNTDOUBLE
StuntDoubles (Atoms & RigidBodies)