本文整理汇总了C++中openbabel::OBAtom::BeginBond方法的典型用法代码示例。如果您正苦于以下问题:C++ OBAtom::BeginBond方法的具体用法?C++ OBAtom::BeginBond怎么用?C++ OBAtom::BeginBond使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openbabel::OBAtom
的用法示例。
在下文中一共展示了OBAtom::BeginBond方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool
_hAccDelocalized(OpenBabel::OBAtom* a)
{
if (a->GetAtomicNum() != 7)
{
return false;
}
if (a->IsAromatic() && a->GetImplicitValence() == 3)
{
return true;
}
std::vector<OpenBabel::OBBond*>::iterator bi1;
for (OpenBabel::OBBond* b1 = a->BeginBond(bi1); b1; b1 = a->NextBond(bi1))
{
OpenBabel::OBAtom* aa = b1->GetNbrAtom(a);
if (aa->IsAromatic() && a->GetImplicitValence() == 3)
{
return true;
}
if (aa->GetAtomicNum() == 6)
{
std::vector<OpenBabel::OBBond*>::iterator bi2;
for (OpenBabel::OBBond* b2 = aa->BeginBond(bi2); b2; b2 = aa->NextBond(bi2))
{
OpenBabel::OBAtom* aaa = b2->GetNbrAtom(aa);
if (aaa == a)
{
continue;
}
if (b2->GetBO() == 2)
{
if (aaa->GetAtomicNum() == 8) return true;
if (aaa->GetAtomicNum() == 7) return true;
if (aaa->GetAtomicNum() == 16) return true;
}
}
}
else if (aa->GetAtomicNum() == 16)
{
std::vector<OpenBabel::OBBond*>::iterator bi2;
for (OpenBabel::OBBond* b2 = aa->BeginBond(bi2); b2; b2 = aa->NextBond(bi2))
{
OpenBabel::OBAtom* aaa = b2->GetNbrAtom(aa);
if (aaa == a)
{
continue;
}
if ((b2->GetBO() == 2) && (aaa->GetAtomicNum() == 8))
{
return true;
}
}
}
}
return false;
}
示例2: newMol
OpenBabel::OBMol
Schuffenhauer::RemoveRing(OpenBabel::OBMol& oldMol,
std::vector<OpenBabel::OBRing*>& rings, unsigned int ringIdx)
{
OpenBabel::OBMol newMol(oldMol);
// Make list of the ring bonds
std::set<OpenBabel::OBBond*> ringBonds;
OpenBabel::OBBond* bond;
std::vector<OpenBabel::OBBond*>::iterator bvi;
for (bond = newMol.BeginBond(bvi); bond; bond = newMol.NextBond(bvi))
{
if (rings[ringIdx]->IsMember(bond))
{
ringBonds.insert(bond);
}
}
// Make list of delocalizable bonds (aromatic, single and flanked by two double bonds)
std::set<OpenBabel::OBBond*> delocalizableBonds;
std::set<OpenBabel::OBBond*>::iterator bli;
OpenBabel::OBBondIterator bi;
OpenBabel::OBAtom* atom;
OpenBabel::OBBond* nbrBond;
unsigned int n;
for (bli = ringBonds.begin(); bli != ringBonds.end(); ++bli)
{
bond = *bli;
if ((bond->GetBondOrder() == 1) &&
bond->IsAromatic())
{
n = 0;
atom = bond->GetBeginAtom();
for (nbrBond = atom->BeginBond(bi); nbrBond; nbrBond = atom->NextBond(bi))
{
if ((nbrBond != bond) &&
ringBonds.count(nbrBond) &&
(nbrBond->GetBondOrder() == 2))
{
++n;
}
}
atom = bond->GetEndAtom();
for (nbrBond = atom->BeginBond(bi); nbrBond; nbrBond = atom->NextBond(bi))
{
if ((nbrBond != bond) &&
ringBonds.count(nbrBond) &&
(nbrBond->GetBondOrder() == 2))
{
++n;
}
}
}
if (n == 2)
{
delocalizableBonds.insert(bond);
}
}
// Make list of bonds which form the fusion with other rings
std::set<OpenBabel::OBBond*> fusionBonds;
for (bli = ringBonds.begin(); bli != ringBonds.end(); ++bli)
{
bond = *bli;
for (unsigned int i(0); i < rings.size(); ++i)
{
if (i != ringIdx)
{
if (rings[i]->IsMember(bond))
{
fusionBonds.insert(bond);
}
}
}
}
// Make list of bonds which are the fusion between aromatic and non-aromatic
std::set<OpenBabel::OBBond*> aromaticNonaromaticFusionBonds;
if (rings[ringIdx]->IsAromatic())
{
for (bli = fusionBonds.begin(); bli != fusionBonds.end(); ++bli)
{
bond = *bli;
for (unsigned int i(0); i < rings.size(); ++i)
{
if (i != ringIdx)
{
if (rings[i]->IsMember(bond) &&
!rings[i]->IsAromatic())
{
aromaticNonaromaticFusionBonds.insert(bond);
}
}
}
}
}
// Make list of bonds which are the fusion between aromatic and aromatic
std::set<OpenBabel::OBBond*> aromaticAromaticFusionBonds;
if (rings[ringIdx]->IsAromatic())
//.........这里部分代码省略.........