Changeset 4761 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jul 2, 2005, 1:28:28 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/coord/p_node.cc
r4742 r4761 21 21 22 22 #include "p_node.h" 23 #include "null_parent.h" 24 25 #include "load_param.h" 26 #include "class_list.h" 27 23 28 #include "stdincl.h" 24 29 #include "compiler.h" 25 26 30 #include "error.h" 27 31 #include "debug.h" 28 32 #include "list.h" 29 33 #include "vector.h" 30 #include "null_parent.h"31 #include "load_param.h"32 34 33 35 //#include "vector.h" … … 123 125 LoadParam<PNode>(root, "rel-coor", this, &PNode::setRelCoor) 124 126 .describe("Sets The relative position of the Node to its parent."); 127 128 LoadParam<PNode>(root, "parent", this, &PNode::setParent) 129 .describe("the Name of the Parent of this PNode"); 125 130 } 126 131 … … 328 333 } 329 334 335 /** 336 * @see PNode::setParent(PNode* parent); 337 * @param parentName the name of the Parent to set to this PNode 338 */ 339 void PNode::setParent (const char* parentName) 340 { 341 PNode* parentNode = dynamic_cast<PNode*>(ClassList::getObject(parentName, CL_PARENT_NODE)); 342 343 344 printf("%p\n", parentNode); 345 printf("%s\n", parentNode->getName()); 346 347 if (parentNode != NULL) 348 parentNode->addChild(this); 349 } 330 350 331 351 /** -
orxonox/trunk/src/lib/coord/p_node.h
r4746 r4761 88 88 89 89 void setParent (PNode* parent); 90 void setParent (const char* name); 91 90 92 void setParentMode (unsigned int parentingMode); 91 93 /** \returns the Parenting mode of this node */ -
orxonox/trunk/src/lib/lang/class_list.cc
r4760 r4761 109 109 /** 110 110 * checks if the BaseObject* object exists. 111 * @param name the name of the BaseObject to look for 112 * @param classID if not CL_NULL it will only search through a specific type of Objects. Otherwise it will be searched everywhere. 113 * @return true, if the Object Exists in the specified ClassID, false otherwise 114 * @todo: speed this up!! 115 */ 116 BaseObject* ClassList::getObject(const char* name, long classID) 117 { 118 if(unlikely(ClassList::first == NULL) || name == NULL) 119 return NULL; 120 else 121 { 122 ClassList* tmp = ClassList::first; 123 while (likely(tmp != NULL)) 124 { 125 if (tmp->classID == classID || (classID == CL_NULL && tmp->classID == CL_BASE_OBJECT)) 126 { 127 tIterator<BaseObject>* iterator = tmp->objectList->getIterator(); 128 BaseObject* enumBO = iterator->nextElement(); 129 const char* tmpName; 130 while (enumBO != NULL) 131 { 132 tmpName = enumBO->getName(); 133 if (tmpName && !strcmp(tmpName, name)) 134 { 135 delete iterator; 136 return enumBO; 137 } 138 enumBO = iterator->nextElement(); 139 } 140 delete iterator; 141 break; 142 } 143 tmp = tmp->next; 144 } 145 } 146 return NULL; 147 } 148 149 150 /** 151 * checks if the BaseObject* object exists. 111 152 * @param object the Pointer to a BaseObject to check if it exists 112 153 * @param classID if not CL_NULL it will only search through a specific type of Objects. Otherwise it will be searched everywhere. … … 127 168 tIterator<BaseObject>* iterator = tmp->objectList->getIterator(); 128 169 BaseObject* enumBO = iterator->nextElement(); 129 while (enumBO )170 while (enumBO != NULL) 130 171 { 131 172 if (enumBO == object) 173 { 174 delete iterator; 132 175 return true; 176 } 133 177 enumBO = iterator->nextElement(); 134 178 } -
orxonox/trunk/src/lib/lang/class_list.h
r4756 r4761 28 28 29 29 // STATIC FUNCTIONS 30 static void addToClassList(BaseObject* objectPointer, const long& classID, const char* className);31 static void removeFromClassList(BaseObject* objectPointer);30 static void addToClassList(BaseObject* objectPointer, const long& classID, const char* className); 31 static void removeFromClassList(BaseObject* objectPointer); 32 32 33 static bool exists(BaseObject* object, long classID = CL_NULL); 33 static BaseObject* getObject(const char* name, long classID = CL_NULL); 34 static bool exists(BaseObject* object, long classID = CL_NULL); 34 35 35 36 static void debug(unsigned int debugLevel = 0); -
orxonox/trunk/src/lib/sound/sound_engine.h
r4746 r4761 37 37 38 38 //! A class that represents a SoundSource 39 class SoundSource : virtualpublic BaseObject39 class SoundSource : public BaseObject 40 40 { 41 41 public:
Note: See TracChangeset
for help on using the changeset viewer.