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 |
|
|
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 |
+ |
} |