Changeset 1420 for GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp
- Timestamp:
- 09/20/06 13:37:29 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp
r1419 r1420 43 43 { 44 44 mVertices.reserve(face->mVertexIndices.size()); 45 46 45 VertexIndexContainer::iterator it, it_end = face->mVertexIndices.end(); 47 46 48 for (it = face->mVertexIndices.begin(); it != it_end; 47 for (it = face->mVertexIndices.begin(); it != it_end; ++ it) 49 48 { 50 49 mVertices.push_back(parentMesh->mVertices[*it]); … … 69 68 VertexContainer::iterator it, it_end = mVertices.end(); 70 69 71 for (it = mVertices.begin(); it != it_end; ++ it) 72 { 73 cout << (*it) << " "; 74 }cout<<endl<<endl; 70 //for (it = mVertices.begin(); it != it_end; ++ it){cout << (*it) << " ";}cout<<endl<<endl; 75 71 //cout << "poly n: " << GetNormal() << " t normal: " << tri.GetNormal() << endl; 76 72 } … … 267 263 } 268 264 265 269 266 bool Polygon3::Valid(const float epsilon) const 270 267 { … … 272 269 return false; 273 270 274 // TODO: remove for performance275 #if 0276 if ( 1)271 // matt: removed for performance issues 272 #if _DEBUG 273 if (0) 277 274 { 278 275 // check if area exceeds certain size … … 291 288 for (it = mVertices.begin(); it != it_end; ++it) 292 289 { 293 if (EpsilonEqualV3(vtx, *it, 0.0001))290 if (EpsilonEqualV3(vtx, *it, epsilon)) 294 291 { 295 // Debug<< "Malformed vertices:\n" << *this << endl;292 //cout << "Malformed vertices:\n" << *this << endl; 296 293 return false; 297 294 } … … 590 587 const int n = (int)mesh.mVertices.size(); 591 588 589 592 590 ///////////// 593 591 //-- add the vertices to the mesh … … 609 607 poly.Triangulate(indices); 610 608 609 //if (indices.size() < 3) return; // something is wrong 610 611 611 // add indices of triangle strip 612 for (int i = n; i < (int)indices.size() + n; i += 3)613 { 614 Face *face = new Face(indices[i] ,615 indices[i + 1] ,616 indices[i + 2] );612 for (int i = 0; i < (int)indices.size(); i += 3) 613 { 614 Face *face = new Face(indices[i] + n, 615 indices[i + 1] + n, 616 indices[i + 2] + n); 617 617 mesh.AddFace(face); 618 618 }
Note: See TracChangeset
for help on using the changeset viewer.