- Timestamp:
- 01/15/07 11:07:24 (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
r1976 r1978 76 76 static void LoadTriangles(char *str, 77 77 const VertexContainer &vertices, 78 map<int, Vector3> &hashTable, 79 vector<Triangle3> &triangles) 78 vector<Triangle3> &triangles) 80 79 { 81 80 char *pch = strtok(str + 1, " "); … … 98 97 if ((int)indices.size() > 2) 99 98 { 100 int index_2 = (int)indices.size() - 2;101 int index_3 = (int)indices.size() - 1;99 const int index_2 = (int)indices.size() - 2; 100 const int index_3 = (int)indices.size() - 1; 102 101 103 102 triangles.push_back(Triangle3(vertices[indices[0]], … … 190 189 191 190 192 193 191 bool TriangleValid(const Triangle3 &triangle) 194 192 { … … 199 197 if (SqrMagnitude(cross_a_b) <= 0.000001 * FLT_EPSILON * FLT_EPSILON) 200 198 { 201 // v0, v1 & v2 lays on a line (area == 0) 199 cout << "x"; 200 // v0, v1 & v2 lies on a line (area == 0) 202 201 return false; 203 202 } … … 265 264 vector<Triangle3> triangles; 266 265 267 LoadTriangles(str, vertices, hashTable, triangles); 266 LoadTriangles(str, vertices, triangles); 267 268 268 vector<Triangle3>::const_iterator tit, tit_end = triangles.end(); 269 269 270 270 for (tit = triangles.begin(); tit != tit_end; ++ tit) 271 271 { 272 if (!TriangleValid(*tit)) 273 continue; 272 //if (!TriangleValid(*tit)) continue; 274 273 275 274 TriangleIntersectable *obj = new TriangleIntersectable(*tit); 276 275 root->mGeometry.push_back(obj); 277 278 // matt: we don't really need to keep an additional data structure279 // if working with triangles => remove this280 if (0 && parents)281 {282 FaceParentInfo info(obj, 0);283 parents->push_back(info);284 }285 276 } 286 277 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1974 r1978 410 410 if (index >= (int)mFaceParents.size()) 411 411 { 412 cerr <<"Warning: triangle index out of range! "<<index<<endl;412 cerr << "Warning: triangle index out of range! " << index << endl; 413 413 return NULL; 414 414 } … … 422 422 if (index >= (int)mObjects.size()) 423 423 { 424 cerr <<"Warning: triangle index out of range! "<<index<<endl;424 cerr << "Warning: triangle index out of range! " << index << endl; 425 425 return NULL; 426 426 }
Note: See TracChangeset
for help on using the changeset viewer.