- Timestamp:
- 12/15/05 15:18:15 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r466 r467 208 208 } 209 209 210 void 211 ViewCellsManager::GetPvsStatistics(PvsStatistics &stat) 212 { 213 ViewCellContainer::const_iterator it = mViewCells.begin(); 214 stat.viewcells = 0; 215 stat.minPvs = 100000000; 216 stat.maxPvs = 0; 217 stat.avgPvs = 0.0f; 218 219 for (; it != mViewCells.end(); ++it) { 220 ViewCell *viewcell = *it; 221 int pvsSize = viewcell->GetPvs().GetSize(); 222 if ( pvsSize < stat.minPvs) 223 stat.minPvs = pvsSize; 224 if (pvsSize > stat.maxPvs) 225 stat.maxPvs = pvsSize; 226 stat.avgPvs += pvsSize; 227 stat.viewcells++; 228 } 229 if (stat.viewcells) 230 stat.avgPvs/=stat.viewcells; 231 } 232 233 void 234 ViewCellsManager::PrintPvsStatistics(ostream &s) 235 { 236 s<<"############# Viewcell PVS STAT ##################\n"; 237 PvsStatistics pvsStat; 238 GetPvsStatistics(pvsStat); 239 s<<"#AVG_PVS\n"<<pvsStat.avgPvs<<endl; 240 s<<"#MAX_PVS\n"<<pvsStat.maxPvs<<endl; 241 s<<"#MIN_PVS\n"<<pvsStat.minPvs<<endl; 242 } 243 210 244 /**********************************************************************/ 211 245 /* BspViewCellsManager implementation */ … … 260 294 sampleRays.push_back(new Ray(*rays[i])); 261 295 262 if (mViewCells.empty()) // no view cells loaded 263 mBspTree->Construct(objects, sampleRays); 264 else 265 mBspTree->Construct(mViewCells); 266 296 if (mViewCells.empty()) { // no view cells loaded 297 mBspTree->Construct(objects, sampleRays); 298 mBspTree->CollectViewCells(mViewCells); 299 } else 300 mBspTree->Construct(mViewCells); 301 302 267 303 Debug << mBspTree->GetStatistics() << endl; 268 304 … … 280 316 viewcells 281 317 ); 318 319 ray.mPvsContribution = 0; 320 ray.mRelativePvsContribution = 0.0f; 282 321 283 322 ViewCellContainer::const_iterator it = viewcells.begin(); … … 770 809 } 771 810 811 772 812 /**********************************************************************/ 773 813 /* KdViewCellsManager implementation */ … … 1186 1226 1187 1227 mVspBspTree->Construct(sampleRays); 1228 mVspBspTree->CollectViewCells(mViewCells); 1188 1229 1189 1230 Debug << mVspBspTree->GetStatistics() << endl;
Note: See TracChangeset
for help on using the changeset viewer.