Changeset 2307 for GTP/trunk/Lib
- Timestamp:
- 04/02/07 11:52:04 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
r2176 r2307 80 80 { 81 81 char *pch = strtok(str + 1, " "); 82 82 83 83 VertexIndexContainer indices; 84 84 int i = 0; 85 85 while (pch != NULL) 86 { 86 {++ i; 87 87 const int index = (int)strtol(pch, NULL, 10) - 1; 88 88 89 89 // store vertex in hash table 90 90 //hashTable[index] = vertices[index]; 91 if (index >=0)91 if (index >= 0) 92 92 indices.push_back(index); 93 93 94 //if (line == 451703)95 // cout << index + 1 << " ";96 97 94 pch = strtok(NULL, " "); 98 95 … … 106 103 vertices[indices[index_2]], 107 104 vertices[indices[index_3]])); 108 indices.clear();109 105 } 110 106 } … … 129 125 { 130 126 // go through indices 131 const int index = *vit; 132 //Debug << "old idx: " << (*vit) << endl; 127 const int index = *vit; 133 128 map<int, Vector3>::const_iterator hit = hashTable.find(index); 134 129 135 130 // correct face index (nust be relative to start of verices) 136 131 (*vit) = (int)distance(hashTable.begin(), hit); 137 //Debug << "new idx: " << (*vit) << endl;138 132 } 139 133 } … … 228 222 int line = 0; 229 223 230 char str[1000 ];224 char str[100000]; 231 225 int meshGrouping; 232 226 Environment::GetSingleton()->GetIntValue("ObjParser.meshGrouping", meshGrouping); … … 234 228 int nMaxFaces = meshGrouping; 235 229 236 while (fgets(str, 1000, file) != NULL) 237 { 238 ++ line; 230 while (fgets(str, 100000, file) != NULL) 231 { 239 232 switch (str[0]) 240 233 { … … 264 257 faces.push_back(face); 265 258 266 if ( faces.size() >= nMaxFaces)259 if ((int)faces.size() >= nMaxFaces) 267 260 { 268 261 ProcessMesh(faces, hashTable, root, parents); … … 271 264 else 272 265 { 266 ++ line; 273 267 vector<Triangle3> triangles; 274 268 … … 291 285 } 292 286 } 293 //cout << "\n** " << root->mGeometry.size() << " " << " lines: " << line << endl; 287 288 //cout << "\n**** " << root->mGeometry.size() << " " << " lines: " << line << endl; 294 289 if (loadMeshes) 295 290 { -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2198 r2307 356 356 if (index >= (int)mObjects.size()) 357 357 { 358 cerr<<"Warning: triangle index out of range! " << index<< endl;358 cerr<<"Warning: triangle index out of range! " << index << " of " << (int)mObjects.size() << endl; 359 359 return NULL; 360 360 }
Note: See TracChangeset
for help on using the changeset viewer.