本文整理汇总了C++中Bond::getBondDir方法的典型用法代码示例。如果您正苦于以下问题:C++ Bond::getBondDir方法的具体用法?C++ Bond::getBondDir怎么用?C++ Bond::getBondDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bond
的用法示例。
在下文中一共展示了Bond::getBondDir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DetectAtomStereoChemistry
// handles stereochem markers set by the Mol file parser and
// converts them to the RD standard:
void DetectAtomStereoChemistry(RWMol &mol, const Conformer *conf) {
PRECONDITION(conf, "no conformer");
// make sure we've calculated the implicit valence on each atom:
for (RWMol::AtomIterator atomIt = mol.beginAtoms(); atomIt != mol.endAtoms();
++atomIt) {
(*atomIt)->calcImplicitValence(false);
}
for (RWMol::BondIterator bondIt = mol.beginBonds(); bondIt != mol.endBonds();
++bondIt) {
Bond *bond = *bondIt;
if (bond->getBondDir() != Bond::UNKNOWN) {
Bond::BondDir dir = bond->getBondDir();
// the bond is marked as chiral:
if (dir == Bond::BEGINWEDGE || dir == Bond::BEGINDASH) {
Atom *atom = bond->getBeginAtom();
if (atom->getImplicitValence() == -1) {
atom->calcExplicitValence();
atom->calcImplicitValence();
}
Atom::ChiralType code = FindAtomStereochemistry(mol, bond, conf);
atom->setChiralTag(code);
// within the RD representation, if a three-coordinate atom
// is chiral and has an implicit H, that H needs to be made explicit:
if (atom->getDegree() == 3 && !atom->getNumExplicitHs() &&
atom->getNumImplicitHs() == 1) {
atom->setNumExplicitHs(1);
// recalculated number of implicit Hs:
atom->updatePropertyCache();
}
}
}
}
}
示例2: setNewProductBond
void setNewProductBond(const Bond &origB, RWMOL_SPTR product,
unsigned bondBeginIdx, unsigned bondEndIdx) {
unsigned bondIdx =
product->addBond(bondBeginIdx, bondEndIdx, origB.getBondType()) - 1;
Bond *newB = product->getBondWithIdx(bondIdx);
newB->setBondDir(origB.getBondDir());
}