| 54 |
|
children.clear(); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
– |
|
| 57 |
|
NameFinder::NameFinder(SimInfo* info) : info_(info), root_(NULL){ |
| 58 |
|
nStuntDouble_ = info_->getNGlobalAtoms() + info_->getNGlobalRigidBodies(); |
| 59 |
|
loadNames(); |
| 60 |
|
} |
| 61 |
|
|
| 63 |
– |
|
| 62 |
|
NameFinder::~NameFinder(){ |
| 63 |
|
delete root_; |
| 64 |
|
} |
| 77 |
|
root_->bs.resize(nStuntDouble_); |
| 78 |
|
root_->bs.setAll(); // |
| 79 |
|
|
| 80 |
< |
for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) { |
| 80 |
> |
for (mol = info_->beginMolecule(mi); mol != NULL; |
| 81 |
> |
mol = info_->nextMolecule(mi)) { |
| 82 |
|
|
| 83 |
|
std::string molName = mol->getMoleculeName(); |
| 84 |
|
TreeNode* currentMolNode = createNode(root_, molName); |
| 91 |
|
currentAtomNode->bs.setBitOn(atom->getGlobalIndex()); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
< |
for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) { |
| 94 |
> |
for (rb = mol->beginRigidBody(rbIter); rb != NULL; |
| 95 |
> |
rb = mol->nextRigidBody(rbIter)) { |
| 96 |
|
std::string rbName = rb->getType(); |
| 97 |
|
TreeNode* currentRbNode = createNode(currentMolNode, rbName); |
| 98 |
|
|
| 106 |
|
|
| 107 |
|
currentRbAtomNode->bs.setBitOn(atom->getGlobalIndex()); |
| 108 |
|
} |
| 109 |
– |
|
| 109 |
|
} |
| 110 |
< |
|
| 112 |
< |
} |
| 113 |
< |
|
| 110 |
> |
} |
| 111 |
|
} |
| 112 |
|
|
| 113 |
|
TreeNode* NameFinder::createNode(TreeNode* parent, const std::string& name) { |
| 233 |
|
SimInfo::MoleculeIterator mi; |
| 234 |
|
Molecule* mol; |
| 235 |
|
|
| 236 |
< |
for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) { |
| 236 |
> |
for (mol = info_->beginMolecule(mi); mol != NULL; |
| 237 |
> |
mol = info_->nextMolecule(mi)) { |
| 238 |
|
|
| 239 |
|
if (isMatched(mol->getMoleculeName(), name) ) { |
| 240 |
|
int natoms = mol->getNAtoms(); |
| 248 |
|
bs.setBitOn(mol->getRigidBodyAt(internalIndex - natoms)->getGlobalIndex()); |
| 249 |
|
} |
| 250 |
|
} |
| 251 |
< |
|
| 254 |
< |
} |
| 255 |
< |
|
| 251 |
> |
} |
| 252 |
|
} |
| 253 |
|
|
| 254 |
|
bool NameFinder::isInteger(const std::string str) { |
| 257 |
|
return false; |
| 258 |
|
} |
| 259 |
|
} |
| 264 |
– |
|
| 260 |
|
return true; |
| 261 |
|
} |
| 267 |
– |
|
| 262 |
|
} |