本文整理汇总了C++中OBMol::HasClosureBondsPerceived方法的典型用法代码示例。如果您正苦于以下问题:C++ OBMol::HasClosureBondsPerceived方法的具体用法?C++ OBMol::HasClosureBondsPerceived怎么用?C++ OBMol::HasClosureBondsPerceived使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OBMol
的用法示例。
在下文中一共展示了OBMol::HasClosureBondsPerceived方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsClosure
bool OBBond::IsClosure()
{
OBMol *mol = (OBMol*)GetParent();
if (!mol)
return false;
if (!mol->HasClosureBondsPerceived())
mol->FindRingAtomsAndBonds();
return HasFlag(OB_CLOSURE_BOND);
}
示例2: IsClosure
bool OBBond::IsClosure()
{
OBMol *mol = (OBMol*)GetParent();
if (!mol)
return(false);
if (mol->HasClosureBondsPerceived())
return(HasFlag(OB_CLOSURE_BOND));
mol->SetClosureBondsPerceived();
obErrorLog.ThrowError(__FUNCTION__,
"Ran OpenBabel::PerceiveClosureBonds", obAuditMsg);
OBBond *bond;
OBAtom *atom,*nbr;
OBBitVec uatoms,ubonds;
vector<OBAtom*> curr,next;
vector<OBAtom*>::iterator i;
vector<OBBond*>::iterator j;
uatoms.Resize(mol->NumAtoms()+1);
ubonds.Resize(mol->NumAtoms()+1);
for (;static_cast<unsigned int>(uatoms.CountBits()) < mol->NumAtoms();)
{
if (curr.empty())
for (atom = mol->BeginAtom(i);atom;atom = mol->NextAtom(i))
if (!uatoms[atom->GetIdx()])
{
uatoms |= atom->GetIdx();
curr.push_back(atom);
break;
}
for (;!curr.empty();)
{
for (i = curr.begin();i != curr.end();++i)
for (nbr = ((OBAtom*)*i)->BeginNbrAtom(j);nbr;nbr = ((OBAtom*)*i)->NextNbrAtom(j))
if (!uatoms[nbr->GetIdx()])
{
uatoms |= nbr->GetIdx();
ubonds |= (*j)->GetIdx();
next.push_back(nbr);
}
curr = next;
next.clear();
}
}
for (bond = mol->BeginBond(j);bond;bond = mol->NextBond(j))
if (!ubonds[bond->GetIdx()])
bond->SetClosure();
return(HasFlag(OB_CLOSURE_BOND));
}
示例3: DetermineFRJ
static int DetermineFRJ(OBMol &mol)
{
if (!mol.HasClosureBondsPerceived())
return (int)FindRingAtomsAndBonds2(mol);
int frj = 0;
OBBond *bond;
vector<OBBond*>::iterator j;
for (bond = mol.BeginBond(j);bond;bond = mol.NextBond(j))
if (bond->IsClosure()) // bond->HasFlag(OB_CLOSURE_BOND)?
frj++;
return frj;
}