- Timestamp:
- Feb 18, 2006, 5:38:37 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/defs/debug.h
r7162 r7165 33 33 #include <stdio.h> 34 34 #include <cassert> 35 #include <iostream>36 35 37 36 // DEFINE ERROR MODES -
trunk/src/lib/Makefile.am
r7164 r7165 7 7 lang/base_object.cc \ 8 8 lang/class_list.cc \ 9 \ 9 10 coord/p_node.cc \ 11 \ 10 12 util/substring.cc \ 11 13 util/color.cc \ … … 13 15 util/multi_type.cc \ 14 16 util/executor/executor.cc \ 17 \ 15 18 data/data_tank.cc 16 19 … … 18 21 lang/base_object.h \ 19 22 lang/class_list.h \ 23 \ 24 coord/p_node.h \ 25 \ 20 26 util/substring.h \ 21 27 util/multi_type.h \ … … 27 33 util/count_pointer.h \ 28 34 util/list.h \ 29 coord/p_node.h \ 30 data/data_tank.h \ 31 graphics/render2D/element_2d.h \ 32 graphics/render2D/render_2d.h 35 \ 36 data/data_tank.h 33 37 34 38 SUBDIRS = \ -
trunk/src/lib/graphics/Makefile.am
r6815 r7165 7 7 light.cc \ 8 8 shader.cc \ 9 \ 9 10 render2D/render_2d.cc \ 10 11 render2D/element_2d.cc \ 11 12 render2D/billboard.cc \ 13 \ 12 14 text_engine/text_engine.cc \ 13 15 text_engine/text.cc \ 14 16 text_engine/font.cc \ 17 \ 15 18 effects/graphics_effect.cc \ 16 19 effects/fog_effect.cc \ … … 21 24 light.h \ 22 25 shader.h \ 26 \ 23 27 render2D/render_2d.h \ 24 28 render2D/element_2d.h \ 25 29 render2D/billboard.h \ 30 \ 26 31 text_engine/text_engine.h \ 27 32 text_engine/text.h \ 28 33 text_engine/font.h \ 34 text_engine/default_font.xpm \ 35 \ 29 36 effects/graphics_effect.h \ 30 37 effects/fog_effect.h \ … … 35 42 spatial_separation 36 43 37 EXTRA_DIST = text_engine/default_font.xpm44 EXTRA_DIST = -
trunk/src/lib/lang/class_list.cc
r7164 r7165 53 53 54 54 //! a List of all known Classes. 55 std:: vector<ClassList>* ClassList::classList = NULL;55 std::list<ClassList>* ClassList::classList = NULL; 56 56 57 57 //! a List of all strings of all classes, that have registered so far. … … 70 70 { 71 71 if (unlikely(classList == NULL)) 72 ClassList::classList = new std::vector<ClassList>();72 ClassList::classList = new list<ClassList>(); 73 73 74 74 PRINTF(5)("subscribe a '%s'\n", className ); … … 94 94 void ClassList::removeFromClassList(BaseObject* objectPointer) 95 95 { 96 for(unsigned int cl= 0; cl < ClassList::classList->size(); cl++) 97 { 98 if (objectPointer->isA((*ClassList::classList)[cl].classID)) 99 { 100 std::list<BaseObject*>::iterator bo = 101 std::find ((*ClassList::classList)[cl].objectList.begin(), 102 (*ClassList::classList)[cl].objectList.end(), 103 objectPointer); 104 if (bo != (*ClassList::classList)[cl].objectList.end()) 105 (*ClassList::classList)[cl].objectList.erase(bo); 96 list<ClassList>::iterator cl; 97 for(cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++) 98 { 99 if (objectPointer->isA((*cl).classID)) 100 { 101 std::list<BaseObject*>::iterator bo = std::find ((*cl).objectList.begin(), (*cl).objectList.end(), objectPointer); 102 if (bo != (*cl).objectList.end()) 103 (*cl).objectList.erase(bo); 106 104 } 107 105 } … … 121 119 ClassList::classNames.clear(); 122 120 123 for (unsigned int cl = 0; cl < ClassList::classList->size(); cl++) 124 ClassList::classNames.push_back((*ClassList::classList)[cl].className); 121 list<ClassList>::const_iterator cl; 122 for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++) 123 ClassList::classNames.push_back((*cl).className); 125 124 } 126 125 … … 178 177 * !!PRIVATE!! 179 178 * @param classID the ClassID to search for 180 * @returns the ClassList with classID as specif ier, or NULL if not179 * @returns the ClassList with classID as specifyer, or NULL if not 181 180 */ 182 181 ClassList* ClassList::getClassList(ClassID classID) 183 182 { 184 std::vector<ClassList>::iterator classIT = 185 std::find (ClassList::classList->begin(), ClassList::classList->end(), classID); 183 std::list<ClassList>::iterator classIT = find (ClassList::classList->begin(), ClassList::classList->end(), classID); 186 184 return (likely(classIT != classList->end()))? &(*classIT) : NULL; 187 185 } … … 191 189 * !!PRIVATE!! 192 190 * @param className the ClassName to search for 193 * @returns the ClassList with className as specif ier, or NULL if not191 * @returns the ClassList with className as specifyer, or NULL if not 194 192 */ 195 193 ClassList* ClassList::getClassList(const char* className) … … 197 195 if (className == NULL) 198 196 return NULL; 199 std:: vector<ClassList>::iterator classIT = find (ClassList::classList->begin(), ClassList::classList->end(), className);197 std::list<ClassList>::iterator classIT = find (classList->begin(), classList->end(), className); 200 198 return (likely(classIT != classList->end()))? &(*classIT) : NULL; 201 199 } … … 224 222 else 225 223 { 226 std::list<BaseObject*>::iterator bo; 227 for (unsigned int cl = 0; cl < ClassList::classList->size(); cl++) 228 { 229 for (bo = (*ClassList::classList)[cl].objectList.begin(); bo != (*ClassList::classList)[cl].objectList.end(); bo++) 224 list<ClassList>::iterator cl; 225 for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++) 226 { 227 std::list<BaseObject*>::iterator bo; 228 for (bo = (*cl).objectList.begin(); bo != (*cl).objectList.end(); bo++) 230 229 if ((*bo)->getName() != NULL && !strcmp((*bo)->getName(), objectName)) 231 230 return (*bo); … … 256 255 else 257 256 { 258 for (unsigned int cl = 0; cl < ClassList::classList->size(); cl++) 259 { 260 std::list<BaseObject*>::const_iterator bo = 261 find ((*ClassList::classList)[cl].objectList.begin(), 262 (*ClassList::classList)[cl].objectList.end(), object); 263 if (bo != (*ClassList::classList)[cl].objectList.end()) 257 list<ClassList>::iterator cl; 258 for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++) 259 { 260 std::list<BaseObject*>::const_iterator bo = find ((*cl).objectList.begin(), (*cl).objectList.end(), object); 261 if (bo != (*cl).objectList.end()) 264 262 return true; 265 263 } … … 274 272 void ClassList::whatIs(const BaseObject* object) 275 273 { 276 for (unsigned int cl = 0; cl < ClassList::classList->size(); cl++) 277 if (object->isA((*ClassList::classList)[cl].classID)) 278 { 279 PRINT(0)("=%s::0x%.8X=-", 280 (*ClassList::classList)[cl].className, 281 (*ClassList::classList)[cl].classID); 274 list<ClassList>::iterator cl; 275 for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++) 276 if (object->isA((*cl).classID)) 277 { 278 PRINT(0)("=%s::0x%.8X=-", (*cl).className, (*cl).classID); 282 279 } 283 280 } … … 336 333 unsigned int lenCount = 0; 337 334 338 for (unsigned int cl = 0; cl < ClassList::classList->size(); cl++) 339 { 340 if ((debugLevel >= 1 || (*ClassList::classList)[cl].objectList.size() > 0 ) && 341 (classID == CL_NULL || unlikely (classID == (*ClassList::classList)[cl].classID))) 335 list<ClassList>::iterator cl; 336 for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++) 337 { 338 if ((debugLevel >= 1 || (*cl).objectList.size() > 0 ) && 339 (classID == CL_NULL || unlikely (classID == (*cl).classID))) 342 340 { 343 341 lenCount = 1; 344 while (pow(10, lenCount) <= (* ClassList::classList)[cl].objectList.size())342 while (pow(10, lenCount) <= (*cl).objectList.size()) 345 343 ++lenCount; 346 for (int i=0; i < 30-strlen((* ClassList::classList)[cl].className) - lenCount; i++)344 for (int i=0; i < 30-strlen((*cl).className) - lenCount; i++) 347 345 (niceString[i]) = ' '; 348 niceString[30-strlen((*ClassList::classList)[cl].className) - lenCount] = '\0'; 349 350 PRINT(0)("| CLASS %s::%s %d\n", (*ClassList::classList)[cl].className, niceString, 351 (*ClassList::classList)[cl].objectList.size()); 352 353 if (debugLevel >=2 && (*ClassList::classList)[cl].objectList.size() > 0) 346 niceString[30-strlen((*cl).className) - lenCount] = '\0'; 347 348 PRINT(0)("| CLASS %s::%s %d\n", (*cl).className, niceString, (*cl).objectList.size()); 349 350 if (debugLevel >=2 && (*cl).objectList.size() > 0) 354 351 { 355 352 PRINT(0)("| Listing Instances:\n"); 356 353 list<BaseObject*>::const_iterator bo; 357 for (bo = (* ClassList::classList)[cl].objectList.begin(); bo != (*ClassList::classList)[cl].objectList.end(); bo++)354 for (bo = (*cl).objectList.begin(); bo != (*cl).objectList.end(); bo++) 358 355 { 359 356 PRINT(0)("| %s::%s::(0x%.8X->%p ", (*bo)->getClassName(), (*bo)->getName(), (*bo)->getClassID(), (*bo)); -
trunk/src/lib/lang/class_list.h
r7163 r7165 10 10 #include "class_id.h" 11 11 #include <list> 12 #include <vector>13 12 #ifndef NULL 14 13 #define NULL 0 //!< NULL … … 59 58 inline bool operator==(ClassID classID) { return (this->classID == classID); }; 60 59 bool operator==(const char* className); 61 bool operator<(ClassID classID) { return this->classID < classID; };62 63 60 inline ClassID getLeafClassID() const { return this->classID; }; 64 61 … … 76 73 77 74 // STATIC MEMBERS 78 static std:: vector<ClassList>* classList; //!< The list of ClassLists.75 static std::list<ClassList>* classList; //!< The first Class in the List 79 76 static std::list<const char*> classNames; //!< a List of all Names of all classes, that have registered so far. 80 77 }; -
trunk/src/subprojects/importer/importer.cc
r7162 r7165 62 62 } 63 63 } 64 else64 // else 65 65 obj = new PrimitiveModel(PRIM_CYLINDER); 66 66
Note: See TracChangeset
for help on using the changeset viewer.