本文整理汇总了C++中openbabel::OBAtom::GetFormalCharge方法的典型用法代码示例。如果您正苦于以下问题:C++ OBAtom::GetFormalCharge方法的具体用法?C++ OBAtom::GetFormalCharge怎么用?C++ OBAtom::GetFormalCharge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openbabel::OBAtom
的用法示例。
在下文中一共展示了OBAtom::GetFormalCharge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
hAccFuncCalc(OpenBabel::OBMol* mol, Pharmacophore* pharmacophore)
{
// Create for every hydrogen acceptor a pharmacophore point
std::vector<OpenBabel::OBAtom*>::iterator ai;
for (OpenBabel::OBAtom* atom = mol->BeginAtom(ai); atom; atom = mol->NextAtom(ai))
{
if (atom->GetAtomicNum() == 7 || atom->GetAtomicNum() == 8)
{
if (atom->GetFormalCharge() <= 0)
{
if(_hAccDelocalized(atom) || (_hAccCalcAccSurf(atom) < 0.02))
{
continue;
}
PharmacophorePoint p;
p.func = HACC;
p.point.x = atom->x();
p.point.y = atom->y();
p.point.z = atom->z();
p.hasNormal = true;
p.alpha = funcSigma[HACC];
p.normal = _hAccCalcNormal(atom);
pharmacophore->push_back(p);
}
}
}
}
示例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);
}
}
}
}