Changeset 818 for code/branches/core
- Timestamp:
- Feb 16, 2008, 8:00:06 PM (17 years ago)
- Location:
- code/branches/core/src/orxonox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core/src/orxonox/Orxonox.cc
r817 r818 1088 1088 std::cout << "12\n"; 1089 1089 1090 ClassTreeMask test13_21; 1091 test13_21.excludeSingle(Class(A2)); 1092 std::cout << std::endl; 1093 std::cout << "Mask with single-excluded A2:\n"; 1094 TestClassTreeMask(test13_21); 1095 1096 test13_21.exclude(Class(A2)); 1097 std::cout << std::endl; 1098 std::cout << "Mask with excluded A2:\n"; 1099 TestClassTreeMask(test13_21); 1100 1101 test13_21.includeSingle(Class(A2)); 1102 std::cout << std::endl; 1103 std::cout << "Previous mask with single-included A2:\n"; 1104 TestClassTreeMask(test13_21); 1105 1106 test13_21.includeSingle(Class(A2), false); 1107 std::cout << std::endl; 1108 std::cout << "Previous mask with single-included A2 without clean:\n"; 1109 TestClassTreeMask(test13_21); 1110 1111 std::cout << "13\n"; 1090 1112 /* 1091 1113 std::cout << "Test 14\n"; -
code/branches/core/src/orxonox/core/ClassTreeMask.cc
r817 r818 62 62 /** 63 63 @brief Sets the rule for the node to "included". 64 @param overwrite True = overwrite previously added rules for inheriting classes 64 65 */ 65 66 void ClassTreeMaskNode::include(bool overwrite) … … 70 71 /** 71 72 @brief Sets the rule for the node to "excluded". 73 @param overwrite True = overwrite previously added rules for inheriting classes 72 74 */ 73 75 void ClassTreeMaskNode::exclude(bool overwrite) … … 79 81 @brief Sets the rule for the node to a given value and erases all following rules. 80 82 @param bIncluded The rule: included (true) or excluded (false) 83 @param overwrite True = overwrite previously added rules for inheriting classes 81 84 */ 82 85 void ClassTreeMaskNode::setIncluded(bool bIncluded, bool overwrite) … … 287 290 @brief Adds a new "include" rule for a given subclass to the mask. 288 291 @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 289 294 */ 290 295 void ClassTreeMask::include(const Identifier* subclass, bool overwrite, bool clean) … … 296 301 @brief Adds a new "exclude" rule for a given subclass to the mask. 297 302 @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 298 305 */ 299 306 void ClassTreeMask::exclude(const Identifier* subclass, bool overwrite, bool clean) … … 306 313 @param subclass The subclass 307 314 @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 308 317 */ 309 318 void ClassTreeMask::add(const Identifier* subclass, bool bInclude, bool overwrite, bool clean) … … 334 343 @param subclass The subclass 335 344 @param bInclude The rule: include (true) or exclude (false) 345 @param overwrite True = overwrite previously added rules for inheriting classes 336 346 */ 337 347 void ClassTreeMask::add(ClassTreeMaskNode* node, const Identifier* subclass, bool bInclude, bool overwrite) … … 385 395 386 396 /** 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 /** 387 431 @brief Resets the mask to "include everything". 388 432 */ -
code/branches/core/src/orxonox/core/ClassTreeMask.h
r817 r818 166 166 void exclude(const Identifier* subclass, bool overwrite = true, bool clean = true); 167 167 void add(const Identifier* subclass, bool bInclude, bool overwrite = true, bool clean = true); 168 169 void includeSingle(const Identifier* subclass, bool clean = true); 170 void excludeSingle(const Identifier* subclass, bool clean = true); 171 void addSingle(const Identifier* subclass, bool bInclude, bool clean = true); 172 168 173 void reset(); 169 174 void clean();
Note: See TracChangeset
for help on using the changeset viewer.