# | Line 37 | Line 37 | void ConstraintManager::addConstraints(Molecule* mol){ | |
---|---|---|
37 | vector<ConstraintElement*> tempConsElem; | |
38 | ||
39 | foundResult = iterInfoMap.find(mol); | |
40 | < | if (foundResult != iterInfoMap.end()){ |
40 | > | if (foundResult == iterInfoMap.end()){ |
41 | ||
42 | //to improve efficiency, we will not record the molecule without constraint | |
43 | < | if (mol->getNConstrains() == 0){ |
43 | > | if (mol->getNConstrains() > 0){ |
44 | ||
45 | //if a molecule has constraint, all of its myIntegrableOjects must be constraint elements | |
46 | ||
47 | integrableObjects = mol->getIntegrableObjects(); | |
48 | ||
49 | for(sdIter = integrableObjects.begin(); sdIter != integrableObjects.end(); sdIter++){ | |
50 | < | |
50 | > | sd = *sdIter; |
51 | if(sd->isRigidBody()) | |
52 | ce = new ConstraintRigidBody((RigidBody*)sd, 0); | |
53 | else | |
# | Line 85 | Line 85 | void ConstraintManager::removeConstraints(Molecule* mo | |
85 | ||
86 | } | |
87 | ||
88 | < | ConstraintElementIterator* ConstraintManager::creatElementIterator(){ |
88 | > | ConstraintElementIterator* ConstraintManager::createElementIterator(){ |
89 | return new ConstraintElementIterator(consElements); | |
90 | } | |
91 | ||
92 | < | ConstraintPairIterator* ConstraintManager::creatPairIterator(){ |
92 | > | ConstraintPairIterator* ConstraintManager::createPairIterator(){ |
93 | return new ConstraintPairIterator(consPairs); | |
94 | } | |
95 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |