ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/brains/MoleculeCreator.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-2.0/src/brains/MoleculeCreator.cpp (file contents):
Revision 1900 by tim, Mon Dec 6 20:15:02 2004 UTC vs.
Revision 1901 by tim, Tue Jan 4 22:18:36 2005 UTC

# Line 36 | Line 36
36   #include "brains/MoleculeCreator.hpp"
37   #include "primitives/GhostBend.hpp"
38   #include "types/DirectionalAtomType.hpp"
39 + #include "types/FixedBondType.hpp"
40   #include "utils/simError.h"
41   #include "utils/StringUtils.hpp"
42  
# Line 408 | Line 409 | CutoffGroup* MoleculeCreator::createCutoffGroup(Molecu
409      cg->addAtom(atom);
410      return cg;
411   }
411 //Constraint* MoleculeCreator::createConstraint() {
412  
413 < //}
413 > void MoleculeCreator::createConstraintPair(Molecule* mol) {
414 >
415 >    //add bond constraints
416 >    Molecule::BondIterator bi;
417 >    Bond* bond;
418 >    for (bond = mol->beginBond(bi); bond != NULL; bond = mol->nextBond(bi)) {
419 >        
420 >        BondType* bt = bond->getBondType();
421 >        FixedBondType* fbt = dynamic_cast<FixedBondType*>(bt);
422 >
423 >        //found a constraint pair
424 >        if (fbt != NULL) {
425 >            ConstraintPair* consPair = new ConstraintPair(bond->getAtomA(), bond->getAtomB(), fbt->getEquilibriumBondLength());
426 >            mol->addConstraintPair(consPair);
427 >        }
428 >        
429 >    }
430  
431 +    //rigidbody -- rigidbody constraint is not support yet
432 +        
433   }
434 +
435 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines