Ignore:
Timestamp:
12/15/05 15:18:15 (19 years ago)
Author:
bittner
Message:

rsstree statistics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp

    r466 r467  
    208208} 
    209209 
     210void 
     211ViewCellsManager::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 
     233void 
     234ViewCellsManager::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 
    210244/**********************************************************************/ 
    211245/*                   BspViewCellsManager implementation               */ 
     
    260294                sampleRays.push_back(new Ray(*rays[i])); 
    261295 
    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         
    267303        Debug << mBspTree->GetStatistics() << endl; 
    268304         
     
    280316                                  viewcells 
    281317                                  ); 
     318 
     319  ray.mPvsContribution = 0; 
     320  ray.mRelativePvsContribution = 0.0f; 
    282321   
    283322  ViewCellContainer::const_iterator it = viewcells.begin(); 
     
    770809} 
    771810 
     811 
    772812/**********************************************************************/ 
    773813/*                   KdViewCellsManager implementation               */ 
     
    11861226 
    11871227        mVspBspTree->Construct(sampleRays); 
     1228        mVspBspTree->CollectViewCells(mViewCells); 
    11881229         
    11891230        Debug << mVspBspTree->GetStatistics() << endl; 
Note: See TracChangeset for help on using the changeset viewer.