Changeset 991 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 05/29/06 18:54:02 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r979 r991 566 566 maxRenderCost = viewCells.back()->GetRenderCost(); 567 567 568 Debug << "histogram minrc: " << minRenderCost << " maxrc: " << maxRenderCost << endl; 569 570 const int intervals = min(50, (int)viewCells.size()); 568 Debug << "histogram min rc: " << minRenderCost << " max rc: " << maxRenderCost << endl; 569 570 571 const int intervals = min(20, (int)viewCells.size()); 571 572 572 573 const float range = maxRenderCost - minRenderCost; … … 614 615 const float volRatioDif = volDif / totalVol; 615 616 616 outstream << "#Pass\n" << j << endl;617 outstream << "#Pass\n" << j ++ << endl; 617 618 outstream << "#RenderCostRatio\n" << rcRatio << endl; 618 619 outstream << "#WeightedCost\n" << currentRenderCost / totalVol << endl; … … 624 625 // increase current render cost 625 626 currentRenderCost += stepSize; 626 ++ j;627 627 } 628 628 … … 763 763 maxPvsSize = viewCells.back()->GetPvs().GetSize(); 764 764 minPvsSize = 0; 765 // hack: normalize pvs size 765 766 maxPvsSize = 1200; 766 767 minPvsSize = 0; … … 768 769 769 770 Debug << "histogram minpvssize: " << minPvsSize << " maxpvssize: " << maxPvsSize << endl; 771 770 772 771 773 const int intervals = min(20, (int)viewCells.size()); … … 826 828 currentPvsSize += stepSize; 827 829 } 830 828 831 outstream.close(); 829 832 } … … 902 905 cout << "compute new statistics ... "; 903 906 904 /*Debug << "*******+" << endl;905 float overall = 0;906 stable_sort(leaves.begin(), leaves.end(), ViewCell::SmallerPvs);907 for (int i = 0; i < leaves.size(); ++ i)908 {909 overall += leaves[i]->GetPvs().GetSize();910 Debug << "i " << i << " !size: " << leaves[i]->GetPvs().GetSize() << " vol: " << leaves[i]->GetVolume() << " overall " << overall << endl;911 912 }913 */914 907 915 908 //-- propagate pvs or pvs size information … … 1242 1235 int maxPvsSize) const 1243 1236 { 1244 ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 1245 1246 for (it = mViewCells.begin(); it != it_end; ++ it) { 1247 SetValidity(*it, minPvsSize, maxPvsSize); 1248 } 1237 ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 1238 1239 1240 for (it = mViewCells.begin(); it != it_end; ++ it) 1241 { 1242 SetValidity(*it, minPvsSize, maxPvsSize); 1243 } 1249 1244 } 1250 1245 … … 1261 1256 1262 1257 for (int i=0; i < mViewCells.size(); i++) 1263 mViewCells[i]->SetValid(i >= start && i <= end); 1264 } 1265 1266 int 1267 ViewCellsManager::CountValidViewcells() const 1268 { 1269 ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 1270 int valid = 0; 1271 for (it = mViewCells.begin(); it != it_end; ++ it) { 1272 if ((*it)->GetValid()) 1273 valid ++; 1258 { 1259 mViewCells[i]->SetValid(i >= start && i <= end); 1260 1274 1261 } 1275 return valid; 1262 } 1263 1264 int ViewCellsManager::CountValidViewcells() const 1265 { 1266 ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 1267 int valid = 0; 1268 1269 for (it = mViewCells.begin(); it != it_end; ++ it) 1270 { 1271 if ((*it)->GetValid()) 1272 ++ valid; 1273 } 1274 1275 return valid; 1276 1276 } 1277 1277 … … 4708 4708 { 4709 4709 int numSamples; 4710 4710 4711 environment->GetIntValue("RenderSampler.samples", numSamples); 4711 4712 cout << "samples" << numSamples << endl; … … 4716 4717 return; 4717 4718 4718 // doing the query4719 //start the from point queries 4719 4720 long startTime = GetTime(); 4720 4721 cout << "starting sampling of render cost ... "; … … 4728 4729 vector<RenderCostSample>::const_iterator rit, rit_end = samples.end(); 4729 4730 4731 //std::map<ViewCell *, ObjectPvs> sampleMap; 4732 4730 4733 for (rit = samples.begin(); rit != rit_end; ++ rit) 4731 4734 { 4732 4735 RenderCostSample sample = *rit; 4733 //ViewCell *vc = GetViewCell(sample.)pos; 4736 4737 ViewCell *vc = GetViewCell(sample.mPosition); 4738 4739 AxisAlignedBox3 box(sample.mPosition - Vector3(1, 1, 1), sample.mPosition + Vector3(1, 1, 1)); 4740 4741 Mesh *hMesh = CreateMeshFromBox(box); 4742 4743 DEL_PTR(hMesh); 4744 #if 0 4745 if (!sampleMap.find(vc)) 4746 sampleMap.insert(vc, sample.mVisibleObjects); 4747 else 4748 sampleMap[vc].Merge(Merge(sample.mVisibleObjects); 4749 #endif 4734 4750 } 4735 4751 }
Note: See TracChangeset
for help on using the changeset viewer.