Logo Search packages:      
Sourcecode: fillets-ng version File versions

bool Rules::isOnCond ( const OnCondition cond  )  [private]

Whether object is direct or undirect on something specific.

Parameters:
cond condition which will be satify when object is on.

Definition at line 310 of file Rules.cpp.

References MarkMask::getResist(), OnCondition::isSatisfy(), OnCondition::isWrong(), MarkMask::mask(), and MarkMask::unmask().

Referenced by isOnStack(), isOnStrongPad(), and isOnWall().

{
    bool result = false;
    if (cond.isSatisfy(m_model)) {
        result = true;
    }
    else if (cond.isWrong(m_model)) {
        result = false;
    }
    else {
        m_mask->unmask();

        result = false;
        Cube::t_models resist = m_mask->getResist(Dir::DIR_DOWN);
        Cube::t_models::iterator end = resist.end();
        for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) {
            if ((*i)->rules()->isOnCond(cond)) {
                //NOTE: don't forget to mask()
                result = true;
                break;
            }
        }

        m_mask->mask();
    }

    return result;
}


Generated by  Doxygen 1.6.0   Back to index