Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7129 in orxonox.OLD for trunk/src/lib/coord


Ignore:
Timestamp:
Feb 13, 2006, 1:30:31 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: minor cleanup in PNode (removed unused lines)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/coord/p_node.cc

    r7126 r7129  
    8282  PRINTF(4)("delete %s::%s\n", this->getClassName(), this->getName());
    8383  // remove the Node, delete it's children (if required).
    84   std::list<PNode*>::iterator tmp = this->children.begin();
    8584  std::list<PNode*>::iterator deleteNode;
    8685  unsigned int size;
    8786  while(!this->children.empty())
    8887  {
    89     tmp = this->children.begin();
    90     //while (tmp != this->children.end())
     88    deleteNode = this->children.begin();
     89    size = this->children.size();
     90    if ((this->parentMode & PNODE_PROHIBIT_CHILD_DELETE) ||
     91        ((*deleteNode)->parentMode & PNODE_PROHIBIT_DELETE_WITH_PARENT))
    9192    {
    92       deleteNode = tmp;
    93       tmp++;
    94       size = this->children.size();
    95       if ((this->parentMode & PNODE_PROHIBIT_CHILD_DELETE) ||
    96           ((*deleteNode)->parentMode & PNODE_PROHIBIT_DELETE_WITH_PARENT))
     93      if (this == PNode::nullParent && (*deleteNode)->parentMode & PNODE_REPARENT_TO_NULL)
    9794      {
    98         if (this == PNode::nullParent && (*deleteNode)->parentMode & PNODE_REPARENT_TO_NULL)
    99         {
    100           PRINTF(4)("%s::%s deletes %s::%s\n",
    101                  this->getClassName(), this->getName(),
    102                  (*deleteNode)->getClassName(), (*deleteNode)->getName());
    103           delete (*deleteNode);
    104         }
    105         else
    106         {
    107           PRINTF(4)("%s::%s reparents %s::%s\n",
    108                  this->getClassName(), this->getName(),
    109                  (*deleteNode)->getClassName(), (*deleteNode)->getName());
    110           (*deleteNode)->reparent();
    111         }
     95        PRINTF(4)("%s::%s deletes %s::%s\n",
     96                  this->getClassName(), this->getName(),
     97                  (*deleteNode)->getClassName(), (*deleteNode)->getName());
     98        delete (*deleteNode);
    11299      }
    113100      else
    114101      {
    115         PRINTF(4)("%s::%s deletes PNode: %s::%s\n",
    116                this->getClassName(), this->getName(),
    117                (*deleteNode)->getClassName(), (*deleteNode)->getName());
    118         delete (*deleteNode);
     102        PRINTF(4)("%s::%s reparents %s::%s\n",
     103                  this->getClassName(), this->getName(),
     104                  (*deleteNode)->getClassName(), (*deleteNode)->getName());
     105        (*deleteNode)->reparent();
    119106      }
    120       //if (size <= this->children.size()) break;
     107    }
     108    else
     109    {
     110      PRINTF(4)("%s::%s deletes PNode: %s::%s\n",
     111                this->getClassName(), this->getName(),
     112                (*deleteNode)->getClassName(), (*deleteNode)->getName());
     113      delete (*deleteNode);
    121114    }
    122115  }
Note: See TracChangeset for help on using the changeset viewer.