本文整理汇总了C++中openbabel::OBAtom::GetHvyValence方法的典型用法代码示例。如果您正苦于以下问题:C++ OBAtom::GetHvyValence方法的具体用法?C++ OBAtom::GetHvyValence怎么用?C++ OBAtom::GetHvyValence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openbabel::OBAtom
的用法示例。
在下文中一共展示了OBAtom::GetHvyValence方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newMol
OpenBabel::OBMol
Schuffenhauer::Rule_1(OpenBabel::OBMol& oldMol)
{
if (oldMol.GetSSSR().size() <= _ringsToBeRetained)
{
return oldMol;
}
OpenBabel::OBMol newMol(oldMol);
std::vector<OpenBabel::OBAtom*>::iterator avi;
OpenBabel::OBBondIterator bi;
OpenBabel::OBAtom* atom;
OpenBabel::OBAtom* nbrAtom[2];
for (atom = newMol.BeginAtom(avi); atom; atom = newMol.NextAtom(avi))
{
if ((atom->MemberOfRingSize() == 3) &&
(atom->IsNitrogen() || atom->IsOxygen()) &&
(atom->MemberOfRingCount() == 1) &&
(atom->GetHvyValence() == 2))
{
nbrAtom[0] = atom->BeginNbrAtom(bi);
nbrAtom[1] = atom->NextNbrAtom(bi);
if (nbrAtom[0] && nbrAtom[1])
{
newMol.DeleteAtom(atom);
newMol.GetBond(nbrAtom[0], nbrAtom[1])->SetBondOrder(2);
}
}
}
return newMol;
}
示例2:
void
hDonFuncCalc(OpenBabel::OBMol* mol, Pharmacophore* pharmacophore)
{
// Create for every hydrogen donor a pharmacophore point
std::vector<OpenBabel::OBAtom*>::iterator ai;
for (OpenBabel::OBAtom* a = mol->BeginAtom(ai); a; a = mol->NextAtom(ai))
{
if (a->GetAtomicNum() == 7 || a->GetAtomicNum() == 8)
{
if (a->GetFormalCharge() >= 0 && ((a->GetImplicitValence() - a->GetHvyValence()) !=0))
{
PharmacophorePoint p;
p.func = HDON;
p.point.x = a->x();
p.point.y = a->y();
p.point.z = a->z();
p.hasNormal = true;
p.alpha = funcSigma[HDON];
p.normal = _hDonCalcNormal(a);
pharmacophore->push_back(p);
}
}
}
}