Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/util/object_manager.cc


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/object_manager.cc

    r9656 r9869  
    1717
    1818#include "object_manager.h"
    19 #include "class_list.h"
    2019
    2120#include "world_entity.h"
     
    3029    ->defaultValues("", 0);
    3130
     31ObjectListDefinition(ObjectManager);
    3232/**
    3333 * @brief standard constructor
     
    3535ObjectManager::ObjectManager ()
    3636{
    37    this->setClassID(CL_OBJECT_MANAGER, "ObjectManager");
     37  this->registerObject(this, ObjectManager::_objectList);
    3838   this->setName("ObjectManager");
    3939
     
    6363{
    6464  for (unsigned int i = 0; i < OM_SIZE; ++i)
    65     while(!this->objectLists[i].empty())
    66       delete this->objectLists[i].front();
     65    while(!this->entityLists[i].empty())
     66      delete this->entityLists[i].front();
    6767
    6868  // delete reflection list
     
    8383
    8484  if (likely(entity->getOMListNumber() != OM_INIT))
    85     this->objectLists[entity->getOMListNumber()].erase(entity->getEntityIterator());
     85    this->entityLists[entity->getOMListNumber()].erase(entity->getEntityIterator());
    8686
    8787  if (likely(omList != OM_INIT))
    8888  {
    89     this->objectLists[omList].push_back(entity);
    90     entity->getEntityIterator() = --this->objectLists[omList].end();
     89    this->entityLists[omList].push_back(entity);
     90    entity->getEntityIterator() = --this->entityLists[omList].end();
    9191    entity->getOMListNumber() = omList;
    9292  }
     
    111111 * @returns a new List with a list of WorldEntities of distance Radius from center
    112112 */
    113 void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID)
    114 {
    115   const std::list<BaseObject*>* objectList = ClassList::getList(classID);
    116   if (objectList != NULL)
     113  /*
     114void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, const ClassID& classID)
     115{
     116  TODO FIXME
     117
     118  const std::list<BaseObject*>* entityList = ClassList::getList(classID);
     119  if (entityList != NULL)
    117120  {
    118121
    119122    std::list<BaseObject*>::const_iterator node;
    120     for (node = objectList->begin(); node != objectList->end(); node++)
     123    for (node = entityList->begin(); node != entityList->end(); node++)
    121124      if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius)
    122125        entities.push_back(dynamic_cast<WorldEntity*>(*node));
    123126  }
    124127}
     128  */
    125129
    126130
     
    134138  if (omList != OM_INIT || omList == OM_SIZE)
    135139  {
    136     PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this->objectLists[omList].size());
     140    PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this->entityLists[omList].size());
    137141  //  if (level >= 1)
    138142    {
    139143      ObjectManager::EntityList::const_iterator entity;
    140       for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++)
     144      for (entity = this->entityLists[omList].begin(); entity != this->entityLists[omList].end(); entity++)
    141145      {
    142146        PRINT(0)(" | %s::%s\n",(*entity)->getClassCName(), (*entity)->getCName());
Note: See TracChangeset for help on using the changeset viewer.