本文整理汇总了C++中OBMol::HasAromaticCorrected方法的典型用法代码示例。如果您正苦于以下问题:C++ OBMol::HasAromaticCorrected方法的具体用法?C++ OBMol::HasAromaticCorrected怎么用?C++ OBMol::HasAromaticCorrected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBMol
的用法示例。
在下文中一共展示了OBMol::HasAromaticCorrected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: CorrectAromaticNitrogens
//! Currently sets OBMol::SetAromaticCorrected and returns.
//! \deprecated Currently unused for anything significant.
void OBAtomTyper::CorrectAromaticNitrogens(OBMol &mol)
{
if (!_init)
Init();
if (mol.HasAromaticCorrected())
return;
mol.SetAromaticCorrected();
FOR_ATOMS_OF_MOL(atom, mol) {
if (atom->IsNitrogen() && atom->IsAromatic()) {
atom->SetHyb(2);
atom->SetType("Nar");
if (atom->HasDoubleBond()) {
atom->SetImplicitValence(2 + atom->GetFormalCharge());
} else {
if (atom->GetImplicitValence() == 2)
atom->SetImplicitValence(3 + atom->GetFormalCharge());
}
}
}
return;
}