Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/water/src/util/object_manager.h @ 7687

Last change on this file since 7687 was 7686, checked in by patrick, 20 years ago

water: introduced new render passes

File size: 2.6 KB
Line 
1/*!
2 * @file object_manager.h
3 * @brief Definition of the ObjectManager.
4 */
5
6#ifndef _OBJECT_MANAGER_H
7#define _OBJECT_MANAGER_H
8
9#include "base_object.h"
10#include <list>
11#include <vector>
12
13/// Enumerator for Managed Object Lists
14typedef enum {
15  OM_NULL             =  0,
16  OM_DEAD,
17  OM_DEAD_TICK,
18  OM_ENVIRON_NOTICK,
19  OM_ENVIRON,
20  OM_COMMON,
21
22  OM_REFLECTION,                            //!< list of all object that need to be drawn in the reflection image
23
24  OM_GROUP_00,
25  OM_GROUP_00_PROJ,
26  OM_GROUP_01,
27  OM_GROUP_01_PROJ,
28  OM_GROUP_02,
29  OM_GROUP_02_PROJ,
30  OM_GROUP_03,
31  OM_GROUP_03_PROJ,
32  OM_GROUP_04,
33  OM_GROUP_04_PROJ,
34  OM_GROUP_05,
35  OM_GROUP_05_PROJ,
36  OM_GROUP_06,
37  OM_GROUP_06_PROJ,
38  OM_GROUP_07,
39  OM_GROUP_07_PROJ,
40  OM_GROUP_08,
41  OM_GROUP_08_PROJ,
42  OM_GROUP_09,
43  OM_GROUP_09_PROJ,
44  OM_GROUP_10,
45  OM_GROUP_10_PROJ,
46  OM_GROUP_11,
47  OM_GROUP_11_PROJ,
48  OM_GROUP_12,
49  OM_GROUP_12_PROJ,
50  OM_GROUP_13,
51  OM_GROUP_13_PROJ,
52  OM_GROUP_14,
53  OM_GROUP_14_PROJ,
54  OM_GROUP_15,
55  OM_GROUP_15_PROJ,
56
57  OM_SIZE,
58
59
60  OM_INIT             = -1, //!< DO NOT USE THIS. (WorldEntity Internal).
61} OM_LIST;
62
63#define OM_DEFAULT_LIST  OM_NULL
64
65
66// FORWARD DECLARATION
67class PNode;
68class WorldEntity;
69
70//! A powerfull handler for the Object (WorldEntities) in the World.
71class ObjectManager : public BaseObject
72{
73public:
74  typedef std::list<WorldEntity*> EntityList;      //!< A type definition to make it easy to use EntityLists.
75
76  ObjectManager();
77  virtual ~ObjectManager();
78
79  void flush();
80
81  void toList (WorldEntity* entity, OM_LIST omList = OM_DEFAULT_LIST);
82  void toList (WorldEntity* entity, const std::string& omList);
83
84
85  /** @returns the List (listnumber) of objects. @param listNumber the List to get. */
86  EntityList& getObjectList(OM_LIST listNumber) { return this->objectLists[listNumber]; }
87  /** @returns a constant LIST of Objects. @param listNumber the objectList to returns */
88  const EntityList& getObjectList(OM_LIST listNumber) const { return this->objectLists[listNumber]; }
89
90  static void distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID);
91
92  void debug(OM_LIST omList, unsigned int level = 0) const;
93  void debug(const std::string& listName = "", unsigned int level = 0);
94
95  static OM_LIST StringToOMList(const std::string& listName);
96  static const char* OMListToString(OM_LIST omList);
97
98private:
99  const std::list<BaseObject>*            pNodeList;                //!< The List of PNodes.
100
101  EntityList                              objectLists[OM_SIZE];     //!< The ObjectLists.
102
103  static const char*                      objectManagerListNames[]; //!< Names of all the lists
104};
105
106#endif /* _OBJECT_MANAGER_H */
Note: See TracBrowser for help on using the repository browser.