Ignore:
Timestamp:
02/08/06 15:05:04 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r604 r605  
    160160 
    161161 
    162 void ViewCell::UpdateViewCellsStats(ViewCellsStatistics &vcStat) 
    163 { 
    164         ++ vcStat.viewCells; 
    165                  
    166         const int pvsSize = mPvs.GetSize(); 
    167  
    168         vcStat.pvs += pvsSize; 
    169  
    170         if (pvsSize == 0) 
    171                 ++ vcStat.emptyPvs; 
    172  
    173         if (pvsSize > vcStat.maxPvs) 
    174                 vcStat.maxPvs = pvsSize; 
    175  
    176         if (pvsSize < vcStat.minPvs) 
    177                 vcStat.minPvs = pvsSize; 
    178  
    179         if (!mValid) 
    180                 ++ vcStat.invalid; 
    181 } 
    182  
    183  
    184162float ViewCell::GetArea() const 
    185163{ 
     
    477455        mViewCellsManager->GetPvsStatistics(pvsStats); 
    478456 
    479         static float expectedValue = pvsStats.avgPvs; 
     457        //static float expectedValue = pvsStats.avgPvs; 
    480458         
    481459        // the current view cells are kept in this container 
     
    521499 
    522500        mStats << "#Pass\n" << pass << endl 
    523                 << "#Merged\n" << mergeStats.merged << endl  
    524                 << "#Viewcells\n" << realNumActiveViewCells << endl  
    525                 << "#RenderCostIncrease\n" << 0 << endl 
    526                 << "#TotalRenderCost\n" << totalRenderCost << endl 
    527                 << "#CurrentPvs\n" << 0 << endl 
    528                 << "#ExpectedCost\n" << realExpectedCost << endl 
    529                 << "#AvgRenderCost\n" << realAvgRenderCost << endl 
    530                 << "#Deviation\n" << mDeviation << endl 
    531                 << "#TotalPvs\n" << totalPvs << endl 
    532                 << "#PvsSizeDecrease\n" << 0 << endl 
    533                 << "#Volume\n" << 0 << endl 
    534                 << "#Dummy\n" << 0 << endl; 
     501                   << "#Merged\n" << mergeStats.merged << endl  
     502                   << "#Viewcells\n" << realNumActiveViewCells << endl  
     503                   << "#RenderCostIncrease\n" << 0 << endl 
     504                   << "#TotalRenderCost\n" << totalRenderCost << endl 
     505                   << "#CurrentPvs\n" << 0 << endl 
     506                   << "#ExpectedCost\n" << realExpectedCost << endl 
     507                   << "#AvgRenderCost\n" << realAvgRenderCost << endl 
     508                   << "#Deviation\n" << mDeviation << endl 
     509                   << "#TotalPvs\n" << totalPvs << endl 
     510                   << "#PvsSizeDecrease\n" << 0 << endl 
     511                   << "#Volume\n" << endl; 
    535512 
    536513        //-- use priority queue to merge leaf pairs 
     
    584561                } 
    585562 
    586 #ifdef _DEBUG 
    587                 Debug << "abs mergecost: " << mMergeQueue.top().GetMergeCost() <<  
    588                           << " rel mergecost: " << mMergeQueue.top().GetRenderCost() / mExpectedCost <<  
    589                           << " max ratio: " << mMergeMaxCostRatio << endl 
    590                           << " expected value: " << realExpectedCost << endl; 
    591 #endif 
    592563 
    593564         
     
    637608                                ++ mergeStats.siblings; 
    638609#endif 
    639                 //      if (((mergeStats.merged % statsOut) == 0) ||  
    640                 //              (realNumActiveViewCells == mMergeMinViewCells)) 
    641                 //      { 
     610                        if (((mergeStats.merged % statsOut) == 0) ||  
     611                        (realNumActiveViewCells == mMergeMinViewCells)) 
     612                        { 
    642613                                cout << "merged " << mergeStats.merged << " view cells" << endl; 
    643614 
     
    646617                                        << "#Merged\n" << mergeStats.merged << endl  
    647618                                        << "#Viewcells\n" << realNumActiveViewCells << endl  
    648                                         << "#RenderCostIncrease\n" << renderCostIncr << endl 
     619                    << "#RenderCostIncrease\n" << renderCostIncr << endl 
    649620                                        << "#TotalRenderCost\n" << totalRenderCost << endl 
    650621                                        << "#CurrentPvs\n" << mergedVc->GetPvs().GetSize() << endl 
    651                                         << "#ExpectedCost\n" << realExpectedCost / (float) realNumActiveViewCells << endl 
     622                    << "#ExpectedCost\n" << realExpectedCost << endl 
    652623                                        << "#AvgRenderCost\n" << realAvgRenderCost << endl 
    653624                                        << "#Deviation\n" << mDeviation << endl 
    654625                                        << "#TotalPvs\n" << totalPvs << endl 
    655626                                        << "#PvsSizeDecrease\n" << -pvsDiff << endl 
    656                                         <<  "#Volume\n" << mergedVc->GetVolume() << endl 
    657                                         << "#Dummy\n" << (float)mergedVc->GetPvs().GetSize() * mergedVc->GetVolume() / mViewCellsManager->GetViewSpaceBox().GetVolume() << endl; 
    658                 //      } 
     627                                        << "#Volume\n" << mergedVc->GetVolume() << endl; 
     628                        } 
    659629                } 
    660630                else 
     
    14891459        tstack.push(vc); 
    14901460 
    1491         Debug << "current size: " << pvsSize << endl; 
    1492  
    14931461        while (!tstack.empty()) 
    14941462        { 
     
    15631531        return vc; 
    15641532} 
     1533 
     1534 
     1535 
     1536void  ViewCellsTree::UpdateViewCellsStats(ViewCell *vc, ViewCellsStatistics &vcStat) 
     1537{ 
     1538        ++ vcStat.viewCells; 
     1539                 
     1540        const int pvsSize = GetPvsSize(vc); 
     1541 
     1542        vcStat.pvs += pvsSize; 
     1543 
     1544        if (pvsSize == 0) 
     1545                ++ vcStat.emptyPvs; 
     1546 
     1547        if (pvsSize > vcStat.maxPvs) 
     1548                vcStat.maxPvs = pvsSize; 
     1549 
     1550        if (pvsSize < vcStat.minPvs) 
     1551                vcStat.minPvs = pvsSize; 
     1552 
     1553        if (!vc->GetValid()) 
     1554                ++ vcStat.invalid; 
     1555} 
     1556 
    15651557 
    15661558 
     
    16431635 
    16441636 
     1637 
    16451638/************************************************************************/ 
    16461639/*                    MergeStatistics implementation                    */ 
Note: See TracChangeset for help on using the changeset viewer.