本文整理汇总了C++中OBAtom::SetImplicitValence方法的典型用法代码示例。如果您正苦于以下问题:C++ OBAtom::SetImplicitValence方法的具体用法?C++ OBAtom::SetImplicitValence怎么用?C++ OBAtom::SetImplicitValence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBAtom
的用法示例。
在下文中一共展示了OBAtom::SetImplicitValence方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AssignImplicitValence
void OBAtomTyper::AssignImplicitValence(OBMol &mol)
{
// FF Make sure that valence has not been perceived
if(mol.HasImplicitValencePerceived())
return;
if (!_init)
Init();
mol.SetImplicitValencePerceived();
obErrorLog.ThrowError(__FUNCTION__,
"Ran OpenBabel::AssignImplicitValence", obAuditMsg);
// FF Ensure that the aromatic typer will not be called
int oldflags = mol.GetFlags(); // save the current state flags
mol.SetAromaticPerceived(); // and set the aromatic perceived flag on
OBAtom *atom;
vector<OBAtom*>::iterator k;
for (atom = mol.BeginAtom(k);atom;atom = mol.NextAtom(k))
atom->SetImplicitValence(atom->GetValence());
vector<vector<int> >::iterator j;
vector<pair<OBSmartsPattern*,int> >::iterator i;
for (i = _vimpval.begin();i != _vimpval.end();++i)
if (i->first->Match(mol))
{
_mlist = i->first->GetMapList();
for (j = _mlist.begin();j != _mlist.end();++j)
mol.GetAtom((*j)[0])->SetImplicitValence(i->second);
}
if (!mol.HasAromaticCorrected())
CorrectAromaticNitrogens(mol);
for (atom = mol.BeginAtom(k);atom;atom = mol.NextAtom(k))
{
if (atom->GetImplicitValence() < atom->GetValence())
atom->SetImplicitValence(atom->GetValence());
}
// FF Come back to the initial flags
mol.SetFlags(oldflags);
return;
}