Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 16, 2008, 8:00:06 PM (16 years ago)
Author:
landauf
Message:

new feature in ClassTreeMask:
you can include or exclude a single class without changing the rule for inheriting classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core/src/orxonox/core/ClassTreeMask.cc

    r817 r818  
    6262    /**
    6363        @brief Sets the rule for the node to "included".
     64        @param overwrite True = overwrite previously added rules for inheriting classes
    6465    */
    6566    void ClassTreeMaskNode::include(bool overwrite)
     
    7071    /**
    7172        @brief Sets the rule for the node to "excluded".
     73        @param overwrite True = overwrite previously added rules for inheriting classes
    7274    */
    7375    void ClassTreeMaskNode::exclude(bool overwrite)
     
    7981        @brief Sets the rule for the node to a given value and erases all following rules.
    8082        @param bIncluded The rule: included (true) or excluded (false)
     83        @param overwrite True = overwrite previously added rules for inheriting classes
    8184    */
    8285    void ClassTreeMaskNode::setIncluded(bool bIncluded, bool overwrite)
     
    287290        @brief Adds a new "include" rule for a given subclass to the mask.
    288291        @param subclass The subclass
     292        @param overwrite True = overwrite previously added rules for inheriting classes
     293        @param clean True = clean the tree after adding the new rule
    289294    */
    290295    void ClassTreeMask::include(const Identifier* subclass, bool overwrite, bool clean)
     
    296301        @brief Adds a new "exclude" rule for a given subclass to the mask.
    297302        @param subclass The subclass
     303        @param overwrite True = overwrite previously added rules for inheriting classes
     304        @param clean True = clean the tree after adding the new rule
    298305    */
    299306    void ClassTreeMask::exclude(const Identifier* subclass, bool overwrite, bool clean)
     
    306313        @param subclass The subclass
    307314        @param bInclude The rule: include (true) or exclude (false)
     315        @param overwrite True = overwrite previously added rules for inheriting classes
     316        @param clean True = clean the tree after adding the new rule
    308317    */
    309318    void ClassTreeMask::add(const Identifier* subclass, bool bInclude, bool overwrite, bool clean)
     
    334343        @param subclass The subclass
    335344        @param bInclude The rule: include (true) or exclude (false)
     345        @param overwrite True = overwrite previously added rules for inheriting classes
    336346    */
    337347    void ClassTreeMask::add(ClassTreeMaskNode* node, const Identifier* subclass, bool bInclude, bool overwrite)
     
    385395
    386396    /**
     397        @brief Adds a new "include" rule for a single subclass. The new rule doesn't change the mask for inheriting classes.
     398        @param subclass The subclass
     399        @param clean True = clean the tree after adding the new rule
     400    */
     401    void ClassTreeMask::includeSingle(const Identifier* subclass, bool clean)
     402    {
     403        this->addSingle(subclass, true, clean);
     404    }
     405
     406    /**
     407        @brief Adds a new "exclude" rule for a single subclass. The new rule doesn't change the mask for inheriting classes.
     408        @param subclass The subclass
     409        @param clean True = clean the tree after adding the new rule
     410    */
     411    void ClassTreeMask::excludeSingle(const Identifier* subclass, bool clean)
     412    {
     413        this->addSingle(subclass, false, clean);
     414    }
     415
     416    /**
     417        @brief Adds a new rule for a single subclass. The new rule doesn't change the mask for inheriting classes.
     418        @param bInclude The rule: include (true) or exclude (false)
     419        @param subclass The subclass
     420        @param clean True = clean the tree after adding the new rule
     421    */
     422    void ClassTreeMask::addSingle(const Identifier* subclass, bool bInclude, bool clean)
     423    {
     424        for (std::list<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)
     425            this->add(*it, this->isIncluded(*it), false, false);
     426
     427        this->add(subclass, bInclude, false, clean);
     428    }
     429
     430    /**
    387431        @brief Resets the mask to "include everything".
    388432    */
Note: See TracChangeset for help on using the changeset viewer.