Exemplo n.º 1
0
/*!
 * \param[in] root Root of the subtree to query.
 * \returns true if \p root or any any of its elements require topology
 *   information, false otherwise.
 */
bool
_gmx_selelem_requires_top(const gmx::SelectionTreeElement &root)
{
    if (root.type == SEL_EXPRESSION || root.type == SEL_MODIFIER)
    {
        if (root.u.expr.method && (root.u.expr.method->flags & SMETH_REQTOP))
        {
            return true;
        }
        if (root.u.expr.pc && gmx_ana_poscalc_requires_top(root.u.expr.pc))
        {
            return true;
        }
    }
    gmx::SelectionTreeElementPointer child = root.child;
    while (child)
    {
        if (_gmx_selelem_requires_top(*child))
        {
            return true;
        }
        child = child->next;
    }
    return false;
}
Exemplo n.º 2
0
/*!
 * \param[in] root Root of the subtree to query.
 * \returns true if \p root or any any of its elements require topology
 *   information, false otherwise.
 */
bool
_gmx_selelem_requires_top(t_selelem *root)
{
    t_selelem *child;

    if (root->type == SEL_EXPRESSION || root->type == SEL_MODIFIER)
    {
        if (root->u.expr.method && (root->u.expr.method->flags & SMETH_REQTOP))
        {
            return true;
        }
        if (root->u.expr.pc && gmx_ana_poscalc_requires_top(root->u.expr.pc))
        {
            return true;
        }
    }
    child = root->child;
    while (child)
    {
        if (_gmx_selelem_requires_top(child))
        {
            return true;
        }
        child = child->next;
    }
    return false;
}