- Timestamp:
- 03/06/07 14:26:14 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/SimplificationMethod.cpp
r2089 r2194 230 230 // Contract a given pair 231 231 //------------------------------------------------------------------------- 232 void SimplificationMethod::do_contract( simplif::Model& m, 233 simplif::pair_info *auxpair) 232 void SimplificationMethod::do_contract( simplif::Model &m, 233 simplif::pair_info *auxpair, 234 int obligatory) 234 235 { 235 236 simplif::Vertex *v0 = auxpair->v0; … … 243 244 vertex_map_str lb; 244 245 vertex_map_str ub; 246 247 // Stores the simplification step. 248 MeshSimplificationSequence::Step simplifstep; 245 249 246 250 // V0 must be always the alive vertex … … 338 342 339 343 int del_index = 0; 344 345 // Initialize deleted triangles. 346 simplifstep.mT0 = -1; 347 simplifstep.mT1 = -1; 348 349 // Sets obligatory flag. 350 simplifstep.obligatory = obligatory; 340 351 341 352 // Clears faces list. … … 519 530 (vertexMultimap.find(f0) != vertexMultimap.end()) 520 531 && 521 (vertexMultimap.find(f1) != vertexMultimap.end())) 532 (vertexMultimap.find(f1) != vertexMultimap.end()) 533 && 534 ((*pair->v0) != (*pair->v1))) 522 535 { 523 536 break; … … 551 564 candidate = pair->candidate; 552 565 553 // First contract.554 simplifstep.obligatory = 0;555 556 566 // Debug. 557 567 cout << "Contracting... " … … 559 569 560 570 // Contract main pair. 561 do_contract(m, pair); 562 563 // Twin contract and lonely vertex contract. 564 simplifstep.obligatory = 1; 571 do_contract(m, pair, 0); 565 572 566 573 // Attempt to maintain valid vertex information. … … 600 607 float x,y,z; 601 608 609 /* 602 610 if ((*v0) != (*v1)) 603 611 { 612 */ 604 613 // Gets the vertex that is not the candidate. 605 614 if ((*v1) == candidate) … … 621 630 lonely_vert = m.vertex((*it).second); 622 631 632 // Debug. 633 if ((*it).second == 10988) 634 { 635 cout << "Lonely: " 636 << lonely_vert->vID 637 << endl; 638 } 639 623 640 for (int i = 0; i < lonely_vert->edgeUses().length(); i++) 624 641 { … … 671 688 672 689 // Contract twin pair. 673 do_contract(m, pair );690 do_contract(m, pair, 1); 674 691 M0.validVertCount--; 675 692 } … … 686 703 z = (*new_vert)[Z]; 687 704 705 simplif::Vertex *v; 706 707 // Debug. 708 if (new_vert->vID == 10988) 709 { 710 cout << "[" 711 << x 712 << "," 713 << y 714 << "," 715 << z 716 << "]" 717 << endl; 718 719 720 v = m.vertex(10988); 721 } 722 688 723 // Adds new vertex to multimap. 689 724 vertexMultimap.insert(vertex_pair(_float3_(x,y,z),new_vert->vID)); … … 724 759 pair->notInHeap(); 725 760 761 // Debug. 762 cout << "new: " 763 << new_vert->vID 764 << "(" 765 << (*new_vert)[X] 766 << "," 767 << (*new_vert)[Y] 768 << "," 769 << (*new_vert)[Z] 770 << ") lonely: " 771 << lonely_vert->vID 772 << "(" 773 << (*lonely_vert)[X] 774 << "," 775 << (*lonely_vert)[Y] 776 << "," 777 << (*lonely_vert)[Z] 778 << ")" 779 << endl; 780 726 781 // Contract new pair. 727 do_contract(m, pair );782 do_contract(m, pair, 1); 728 783 M0.validVertCount--; 729 784 } 730 785 } 731 } 786 /* 787 } 788 */ 732 789 } 733 790
Note: See TracChangeset
for help on using the changeset viewer.