本文整理汇总了C++中BaseMolecule::getEdgeTopology方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseMolecule::getEdgeTopology方法的具体用法?C++ BaseMolecule::getEdgeTopology怎么用?C++ BaseMolecule::getEdgeTopology使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseMolecule
的用法示例。
在下文中一共展示了BaseMolecule::getEdgeTopology方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _compare_in_loop
int MoleculeSubstructureMatcher::_compare_in_loop (BaseMolecule &mol, int i1, int i2)
{
const Vertex &v1 = mol.getVertex(i1);
const Vertex &v2 = mol.getVertex(i2);
int in_loop1 = 0;
for (int nei = v1.neiBegin(); nei != v1.neiEnd(); nei = v1.neiNext(nei))
{
int nei_edge = v1.neiEdge(nei);
if (mol.getEdgeTopology(nei_edge) == TOPOLOGY_RING)
{
in_loop1 = 1;
break;
}
}
int in_loop2 = 0;
for (int nei = v2.neiBegin(); nei != v2.neiEnd(); nei = v2.neiNext(nei))
{
int nei_edge = v2.neiEdge(nei);
if (mol.getEdgeTopology(nei_edge) == TOPOLOGY_RING)
{
in_loop2 = 1;
break;
}
}
return in_loop2 - in_loop1;
}
示例2: 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);
}
}