本文整理汇总了C++中Molecule::beginBond方法的典型用法代码示例。如果您正苦于以下问题:C++ Molecule::beginBond方法的具体用法?C++ Molecule::beginBond怎么用?C++ Molecule::beginBond使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Molecule
的用法示例。
在下文中一共展示了Molecule::beginBond方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
DistanceFinder::DistanceFinder(SimInfo* info) : info_(info) {
nObjects_.push_back(info_->getNGlobalAtoms()+info_->getNGlobalRigidBodies());
nObjects_.push_back(info_->getNGlobalBonds());
nObjects_.push_back(info_->getNGlobalBends());
nObjects_.push_back(info_->getNGlobalTorsions());
nObjects_.push_back(info_->getNGlobalInversions());
stuntdoubles_.resize(nObjects_[STUNTDOUBLE]);
bonds_.resize(nObjects_[BOND]);
bends_.resize(nObjects_[BEND]);
torsions_.resize(nObjects_[TORSION]);
inversions_.resize(nObjects_[INVERSION]);
SimInfo::MoleculeIterator mi;
Molecule::AtomIterator ai;
Molecule::RigidBodyIterator rbIter;
Molecule::BondIterator bondIter;
Molecule::BendIterator bendIter;
Molecule::TorsionIterator torsionIter;
Molecule::InversionIterator inversionIter;
Molecule* mol;
Atom* atom;
RigidBody* rb;
Bond* bond;
Bend* bend;
Torsion* torsion;
Inversion* inversion;
for (mol = info_->beginMolecule(mi); mol != NULL;
mol = info_->nextMolecule(mi)) {
for(atom = mol->beginAtom(ai); atom != NULL;
atom = mol->nextAtom(ai)) {
stuntdoubles_[atom->getGlobalIndex()] = atom;
}
for (rb = mol->beginRigidBody(rbIter); rb != NULL;
rb = mol->nextRigidBody(rbIter)) {
stuntdoubles_[rb->getGlobalIndex()] = rb;
}
for (bond = mol->beginBond(bondIter); bond != NULL;
bond = mol->nextBond(bondIter)) {
bonds_[bond->getGlobalIndex()] = bond;
}
for (bend = mol->beginBend(bendIter); bend != NULL;
bend = mol->nextBend(bendIter)) {
bends_[bend->getGlobalIndex()] = bend;
}
for (torsion = mol->beginTorsion(torsionIter); torsion != NULL;
torsion = mol->nextTorsion(torsionIter)) {
torsions_[torsion->getGlobalIndex()] = torsion;
}
for (inversion = mol->beginInversion(inversionIter); inversion != NULL;
inversion = mol->nextInversion(inversionIter)) {
inversions_[inversion->getGlobalIndex()] = inversion;
}
}
}
示例2: init
void IndexFinder::init() {
SimInfo::MoleculeIterator mi;
Molecule::AtomIterator ai;
Molecule::RigidBodyIterator rbIter;
Molecule::BondIterator bondIter;
Molecule::BendIterator bendIter;
Molecule::TorsionIterator torsionIter;
Molecule::InversionIterator inversionIter;
Molecule* mol;
Atom* atom;
RigidBody* rb;
Bond* bond;
Bend* bend;
Torsion* torsion;
Inversion* inversion;
for (mol = info_->beginMolecule(mi); mol != NULL;
mol = info_->nextMolecule(mi)) {
SelectionSet ss(nObjects_);
ss.bitsets_[MOLECULE].setBitOn(mol->getGlobalIndex());
for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
ss.bitsets_[STUNTDOUBLE].setBitOn(atom->getGlobalIndex());
}
for (rb = mol->beginRigidBody(rbIter); rb != NULL;
rb = mol->nextRigidBody(rbIter)) {
ss.bitsets_[STUNTDOUBLE].setBitOn(rb->getGlobalIndex());
}
for (bond = mol->beginBond(bondIter); bond != NULL;
bond = mol->nextBond(bondIter)) {
ss.bitsets_[BOND].setBitOn(bond->getGlobalIndex());
}
for (bend = mol->beginBend(bendIter); bend != NULL;
bend = mol->nextBend(bendIter)) {
ss.bitsets_[BEND].setBitOn(bend->getGlobalIndex());
}
for (torsion = mol->beginTorsion(torsionIter); torsion != NULL;
torsion = mol->nextTorsion(torsionIter)) {
ss.bitsets_[TORSION].setBitOn(torsion->getGlobalIndex());
}
for (inversion = mol->beginInversion(inversionIter); inversion != NULL;
inversion = mol->nextInversion(inversionIter)) {
ss.bitsets_[INVERSION].setBitOn(inversion->getGlobalIndex());
}
selectionSets_[mol->getGlobalIndex()] = ss;
}
}