Changeset 710 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
- Timestamp:
- 03/20/06 00:11:27 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r708 r710 560 560 mMergeQueue.pop(); 561 561 562 // both view cells equal 562 // both view cells equal because of previous merges 563 563 // NOTE: do I really still need this? probably cannot happen!! 564 564 if (mc.mLeftViewCell == mc.mRightViewCell) … … 579 579 totalRenderCost += renderCostIncr; 580 580 mDeviation += mc.GetDeviationIncr(); 581 582 583 // merge the view cells of leaf1 and leaf2581 582 583 //-- merge the view cells of leaf1 and leaf2 584 584 int pvsDiff; 585 585 ViewCellInterior *mergedVc = 586 586 MergeViewCells(mc.mLeftViewCell, mc.mRightViewCell, pvsDiff); 587 587 588 588 589 589 // total render cost and deviation has changed … … 641 641 642 642 ViewCellInterior *root = mViewCellsManager->MergeViewCells(activeViewCells); 643 644 ViewCellContainer::const_iterator it, it_end = root->mChildren.end(); 645 646 for (it = root->mChildren.begin(); it != it_end; ++ it) 647 (*it)->SetParent(root); 648 643 649 root->SetMergeCost(totalRenderCost); 644 650 // $$JB keep this 0 temporarilly … … 647 653 mRoot = root; 648 654 } 649 else if ((int)activeViewCells.size() == 1) 655 // normal case 656 else if (!activeViewCells.empty()) 650 657 { 651 658 Debug << "setting root of the merge history" << endl; 652 659 mRoot = activeViewCells[0]; 660 Debug << "rootvc volume: " << mRoot->GetVolume() << endl; 653 661 } 654 662 … … 742 750 743 751 // all merged view cells have been found 744 if (i >= viewCells.size())752 if (i >= (int)viewCells.size()) 745 753 break; 746 754 747 // already merged view cell, put it to end of vector755 // already merged this view cell, put it to end of vector 748 756 if (viewCells[i]->GetParent()) 749 757 swap(viewCells[i], viewCells.back()); 750 758 751 viewCells[i ++]->Mail(); 759 // mail view cell as it has not been merged 760 viewCells[i]->Mail(); 761 762 // increase loop counter 763 ++ i; 752 764 } 753 765 … … 847 859 if (!vc) return NULL; 848 860 861 l->SetParent(vc); 862 r->SetParent(vc); 863 849 864 // set new size of view cell 850 865 if (mUseAreaForPvs) 866 { 851 867 vc->SetArea(l->GetArea() + l->GetArea()); 868 } 852 869 else 853 870 { 854 871 vc->SetVolume(r->GetVolume() + l->GetVolume()); 855 872 } 873 874 856 875 // important so other merge candidates sharing this view cell 857 876 // are notified that the merge cost must be updated!! … … 957 976 return shuffledViewCells; 958 977 } 959 960 961 978 962 979
Note: See TracChangeset
for help on using the changeset viewer.