Changeset 1771 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 11/20/06 14:02:29 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1769 r1771 34 34 // $$JB HACK 35 35 #define USE_KD_PVS 0 36 #define KD_PVS_AREA (1e- 4f)36 #define KD_PVS_AREA (1e-5f) 37 37 38 38 … … 599 599 600 600 ViewCellContainer viewCells; 601 // $$ JB hack - the collect best viewcells does not work? 602 #if 1 601 603 mViewCellsTree->CollectBestViewCellSet(viewCells, nViewCells); 604 #else 605 viewCells = mViewCells; 606 #endif 602 607 603 608 float maxRenderCost, minRenderCost; … … 823 828 824 829 ViewCellContainer viewCells; 830 831 // $$ JB hack - the collect best viewcells does not work? 832 #if 0 825 833 mViewCellsTree->CollectBestViewCellSet(viewCells, nViewCells); 834 #else 835 viewCells = mViewCells; 836 #endif 837 ViewCellContainer::iterator it = viewCells.begin(), it_end = viewCells.end(); 838 for (; it != it_end; ++it) { 839 //(*it)->UpdatePvsCost(); 840 (*it)->SetPvsCost((*it)->GetFilteredPvsSize()); 841 } 842 826 843 827 844 float maxPvs, maxVal, minVal; 828 845 829 846 // sort by pvs size 830 847 sort(viewCells.begin(), viewCells.end(), ViewCell::SmallerPvs); 831 848 832 maxPvs = mViewCellsTree->GetPvsCost(viewCells.back());849 maxPvs = viewCells.back()->GetPvsCost(); 833 850 minVal = 0; 834 851 … … 863 880 int smallerSum = 0; 864 881 865 ViewCellContainer::const_iterator it = viewCells.begin(), it_end = viewCells.end();882 it = viewCells.begin(); 866 883 867 884 for (int j = 0; j < intervals; ++ j) … … 871 888 872 889 while ((i < (int)viewCells.size()) && 873 ( mViewCellsTree->GetPvsCost(viewCells[i]) < currentPvs))890 (viewCells[i]->GetPvsCost() < currentPvs)) 874 891 { 875 892 volDif += viewCells[i]->GetVolume(); … … 881 898 } 882 899 883 if (0 && (i < (int)viewCells.size()))884 885 << " " << currentPvs << endl;886 900 // if (0 && (i < (int)viewCells.size())) 901 // Debug << "new pvs cost increase: " << mViewCellsTree->GetPvsCost(viewCells[i]) 902 // << " " << currentPvs << endl; 903 887 904 const float volRatioDif = volDif / totalVol; 888 905 const float volRatioSum = volSum / totalVol; … … 900 917 901 918 outstream.close(); 919 902 920 } 903 921 … … 1804 1822 1805 1823 stat.avgFilterRadius += fstat.mAvgFilterRadius; 1806 stat.avgFilterRatio += fstat.mLocalFilterCount / (float) fstat.mGlobalFilterCount; 1824 int sum = fstat.mGlobalFilterCount + fstat.mLocalFilterCount; 1825 if (sum) { 1826 stat.avgFilterRatio += fstat.mLocalFilterCount / 1827 (float) sum; 1828 } 1807 1829 1808 1830 … … 2578 2600 float samples = (float)basePvs.GetSamples(); 2579 2601 2580 cout<<"f #s="<<samples<<"pvs size = "<<basePvs.GetSize();2602 Debug<<"f #s="<<samples<<"pvs size = "<<basePvs.GetSize(); 2581 2603 // cout<<"Filter size = "<<filterSize<<endl; 2582 2604 // cout<<"vbox = "<<vbox<<endl; … … 2681 2703 } 2682 2704 2683 cout<<" nPvs size = "<<pvs.GetSize()<<endl;2705 Debug<<" nPvs size = "<<pvs.GetSize()<<endl; 2684 2706 2685 2707 #if !USE_KD_PVS … … 2691 2713 } 2692 2714 #endif 2715 viewCell->SetFilteredPvsSize(pvs.GetSize()); 2693 2716 2694 2717 Intersectable::NewMail();
Note: See TracChangeset
for help on using the changeset viewer.