本文整理汇总了C++中openbabel::OBAtom::IsCarbon方法的典型用法代码示例。如果您正苦于以下问题:C++ OBAtom::IsCarbon方法的具体用法?C++ OBAtom::IsCarbon怎么用?C++ OBAtom::IsCarbon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openbabel::OBAtom
的用法示例。
在下文中一共展示了OBAtom::IsCarbon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newMol
//.........这里部分代码省略.........
}
}
// Remove ring
std::set<OpenBabel::OBBond*> bondsToBeDeleted;
std::set<OpenBabel::OBAtom*> atomsToBeDeleted;
OpenBabel::OBAtom* nbrAtom[2];
for (bli = ringBonds.begin(); bli != ringBonds.end(); ++bli)
{
bond = *bli;
if (fusionBonds.count(bond))
{
continue;
}
else
{
bondsToBeDeleted.insert(bond);
nbrAtom[0] = bond->GetBeginAtom();
nbrAtom[1] = bond->GetEndAtom();
if (nbrAtom[0] && nbrAtom[1])
{
if (nbrAtom[0]->MemberOfRingCount() == 1)
{
atomsToBeDeleted.insert(nbrAtom[0]);
}
if (nbrAtom[1]->MemberOfRingCount() == 1)
{
atomsToBeDeleted.insert(nbrAtom[1]);
}
}
}
}
newMol.BeginModify();
for (bli = bondsToBeDeleted.begin(); bli != bondsToBeDeleted.end(); ++bli)
{
newMol.DeleteBond(*bli);
}
newMol.EndModify();
newMol.BeginModify();
std::set<OpenBabel::OBAtom*>::iterator ali;
for (ali = atomsToBeDeleted.begin(); ali != atomsToBeDeleted.end(); ++ali)
{
newMol.DeleteAtom(*ali);
}
newMol.EndModify();
// Correct the bond orders of the ex-fusion bond(s)
newMol.BeginModify();
for (bond = newMol.BeginBond(bvi); bond; bond = newMol.NextBond(bvi))
{
if (aromaticNonaromaticFusionBonds.count(bond))
{
bond->SetBondOrder(2);
}
else
if (aromaticAromaticFusionBonds.count(bond) &&
delocalizableBonds.count(bond))
{
bond->SetBondOrder(2);
}
}
newMol.EndModify();
// Remove single atoms that originate from exocyclic bonds at ring
(void) RemoveSidechains(&newMol);
// Check if there are atoms with valences that are not allowed
std::vector<OpenBabel::OBAtom*>::iterator avi;
for (atom = newMol.BeginAtom(avi); atom; atom = newMol.NextAtom(avi))
{
if (atom->IsCarbon() &&
(atom->BOSum() > 4))
{
newMol.Clear();
break;
}
else
if (atom->IsNitrogen() &&
(atom->BOSum() > 3))
{
newMol.Clear();
break;
}
else
if (atom->IsOxygen() &&
(atom->BOSum() > 2))
{
newMol.Clear();
break;
}
}
// Check if there are no discontinuous fragments
if (newMol.Separate().size() > 1)
{
newMol.Clear();
}
return newMol;
}