本文整理汇总了C++中BaseMolecule::getBondOrder方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseMolecule::getBondOrder方法的具体用法?C++ BaseMolecule::getBondOrder怎么用?C++ BaseMolecule::getBondOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseMolecule
的用法示例。
在下文中一共展示了BaseMolecule::getBondOrder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: matchBonds
bool MoleculeExactMatcher::matchBonds (BaseMolecule& query, BaseMolecule& target, int sub_idx, int super_idx, int flags)
{
if (flags & CONDITION_ELECTRONS)
if (query.getBondOrder(sub_idx) != target.getBondOrder(super_idx))
return false;
return true;
}
示例2: _bondCode
int MoleculeFingerprintBuilder::_bondCode (BaseMolecule &mol, int edge_idx)
{
//MoleculeFingerprintBuilder *self = (MoleculeFingerprintBuilder *)context;
//if (self->query && mol.asQueryMolecule().aromaticity.canBeAromatic(edge_idx))
// throw Error("internal: _edge_code for possibly aromatic bond");
return mol.getBondOrder(edge_idx);
}
示例3: matchQueryBond
bool MoleculeSubstructureMatcher::matchQueryBond (QueryMolecule::Bond *query,
BaseMolecule &target, int sub_idx, int super_idx, AromaticityMatcher *am, dword flags)
{
int i;
// MR TODO: match topology. Query bond in ring cannot match
// target bond that is not in ring. But R-groups should be
// handled carefully
switch (query->type)
{
case QueryMolecule::OP_NONE:
return true;
case QueryMolecule::OP_AND:
for (i = 0; i < query->children.size(); i++)
if (!matchQueryBond(query->child(i), target, sub_idx, super_idx, am, flags))
return false;
return true;
case QueryMolecule::OP_OR:
for (i = 0; i < query->children.size(); i++)
if (matchQueryBond(query->child(i), target, sub_idx, super_idx, am, flags))
return true;
return false;
case QueryMolecule::OP_NOT:
return !matchQueryBond(query->child(0), target, sub_idx, super_idx, am,
flags ^ MATCH_DISABLED_AS_TRUE);
case QueryMolecule::BOND_ORDER:
{
if (flags & MATCH_BOND_TYPE)
{
if (am != 0)
{
if (target.getBondOrder(super_idx) == BOND_AROMATIC)
return am->canFixQueryBond(sub_idx, true);
else
{
if (!am->canFixQueryBond(sub_idx, false))
return false;
}
}
return target.possibleBondOrder(super_idx, query->value);
}
return (flags & MATCH_DISABLED_AS_TRUE) != 0;
}
case QueryMolecule::BOND_TOPOLOGY:
return target.getEdgeTopology(super_idx) == query->value;
case QueryMolecule::HIGHLIGHTING:
return query->value == (int)target.isAtomHighlighted(super_idx);
default:
throw Error("bad query bond type: %d", query->type);
}
}