44 |
|
|
45 |
|
|
46 |
|
|
47 |
< |
IndexFinder::IndexFinder(SimInfo* info) : info_(info){ |
47 |
> |
IndexFinder::IndexFinder(SimInfo* info) : info_(info){ |
48 |
|
nStuntDoubles_ = info_->getNGlobalAtoms() + info_->getNGlobalRigidBodies(); |
49 |
|
bitSets_.resize(info_->getNGlobalMolecules()); |
50 |
|
init(); |
51 |
< |
} |
51 |
> |
} |
52 |
|
|
53 |
|
|
54 |
< |
void IndexFinder::init() { |
54 |
> |
void IndexFinder::init() { |
55 |
|
|
56 |
|
SimInfo::MoleculeIterator mi; |
57 |
|
Molecule* mol; |
62 |
|
|
63 |
|
for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) { |
64 |
|
|
65 |
< |
BitSet bs(nStuntDoubles_); |
66 |
< |
for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { |
67 |
< |
bs.setBitOn(atom->getGlobalIndex()); |
68 |
< |
} |
65 |
> |
OOPSEBitSet bs(nStuntDoubles_); |
66 |
> |
for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { |
67 |
> |
bs.setBitOn(atom->getGlobalIndex()); |
68 |
> |
} |
69 |
|
|
70 |
< |
for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) { |
71 |
< |
bs.setBitOn(rb->getGlobalIndex()); |
72 |
< |
} |
70 |
> |
for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) { |
71 |
> |
bs.setBitOn(rb->getGlobalIndex()); |
72 |
> |
} |
73 |
|
|
74 |
< |
bitSets_[mol->getGlobalIndex()] = bs; |
74 |
> |
bitSets_[mol->getGlobalIndex()] = bs; |
75 |
|
} |
76 |
|
|
77 |
< |
} |
77 |
> |
} |
78 |
|
|
79 |
< |
BitSet IndexFinder::find(int molIndex){ |
79 |
> |
OOPSEBitSet IndexFinder::find(int molIndex){ |
80 |
|
return bitSets_[molIndex]; |
81 |
< |
} |
81 |
> |
} |
82 |
|
|
83 |
< |
BitSet IndexFinder::find(int begMolIndex, int endMolIndex){ |
84 |
< |
BitSet bs(nStuntDoubles_); |
83 |
> |
OOPSEBitSet IndexFinder::find(int begMolIndex, int endMolIndex){ |
84 |
> |
OOPSEBitSet bs(nStuntDoubles_); |
85 |
|
|
86 |
|
for (int i = begMolIndex; i < endMolIndex; ++i) { |
87 |
< |
bs |= bitSets_[i]; |
87 |
> |
bs |= bitSets_[i]; |
88 |
|
} |
89 |
|
|
90 |
|
return bs; |
91 |
< |
} |
91 |
> |
} |
92 |
|
|
93 |
|
|
94 |
|
} |