Ignore:
Timestamp:
12/13/05 17:28:02 (19 years ago)
Author:
mattausch
Message:

worked on vsp kd view cells

File:
1 edited

Legend:

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

    r452 r462  
    99#include "AxisAlignedBox3.h" 
    1010#include <stack> 
    11 #include <time.h> 
    12 #include <iomanip> 
     11 
    1312#include "Exporter.h" 
    1413#include "Plane3.h" 
     
    19071906} 
    19081907 
    1909 void BspTree::EvaluateViewCellsStats(BspViewCellsStatistics &stat) const 
    1910 { 
    1911         stat.Reset(); 
     1908void BspTree::EvaluateViewCellsStats(ViewCellsStatistics &vcStat) const 
     1909{ 
     1910        vcStat.Reset(); 
    19121911 
    19131912        stack<BspNode *> nodeStack; 
     
    19261925                if (node->IsLeaf())  
    19271926                { 
    1928                         ++ stat.bspLeaves; 
     1927                        ++ vcStat.leaves; 
    19291928 
    19301929                        BspViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->mViewCell; 
     
    19341933                                viewCell->Mail(); 
    19351934                                 
    1936                                 ++ stat.viewCells; 
     1935                                ++ vcStat.viewCells; 
    19371936                                const int pvsSize = viewCell->GetPvs().GetSize(); 
    19381937 
    1939                 stat.pvs += pvsSize; 
     1938                vcStat.pvs += pvsSize; 
    19401939 
    19411940                                if (pvsSize < 1) 
    1942                                         ++ stat.emptyPvs; 
    1943  
    1944                                 if (pvsSize > stat.maxPvs) 
    1945                                         stat.maxPvs = pvsSize; 
    1946  
    1947                                 if (pvsSize < stat.minPvs) 
    1948                                         stat.minPvs = pvsSize; 
    1949  
    1950                                 if ((int)viewCell->mBspLeaves.size() > stat.maxBspLeaves) 
    1951                                         stat.maxBspLeaves = (int)viewCell->mBspLeaves.size();            
     1941                                        ++ vcStat.emptyPvs; 
     1942 
     1943                                if (pvsSize > vcStat.maxPvs) 
     1944                                        vcStat.maxPvs = pvsSize; 
     1945 
     1946                                if (pvsSize < vcStat.minPvs) 
     1947                                        vcStat.minPvs = pvsSize; 
     1948 
     1949                                if ((int)viewCell->mBspLeaves.size() > vcStat.maxLeaves) 
     1950                                        vcStat.maxLeaves = (int)viewCell->mBspLeaves.size();             
    19521951                        } 
    19531952                } 
     
    24122411} 
    24132412 
    2414 void BspViewCellsStatistics::Print(ostream &app) const 
    2415 { 
    2416         app << "===== BspViewCells statistics ===============\n"; 
    2417  
    2418         app << setprecision(4); 
    2419  
    2420         //app << "#N_CTIME  ( Construction time [s] )\n" << Time() << " \n"; 
    2421  
    2422         app << "#N_OVERALLPVS ( objects in PVS )\n" << pvs << endl; 
    2423  
    2424         app << "#N_PMAXPVS ( largest PVS )\n" << maxPvs << endl; 
    2425  
    2426         app << "#N_PMINPVS ( smallest PVS )\n" << minPvs << endl; 
    2427  
    2428         app << "#N_PAVGPVS ( average PVS )\n" << AvgPvs() << endl; 
    2429  
    2430         app << "#N_PEMPTYPVS ( view cells with PVS smaller 2 )\n" << emptyPvs << endl; 
    2431  
    2432         app << "#N_VIEWCELLS ( number of view cells)\n" << viewCells << endl; 
    2433  
    2434         app << "#N_AVGBSPLEAVES (average number of BSP leaves per view cell )\n" << AvgBspLeaves() << endl; 
    2435  
    2436         app << "#N_MAXBSPLEAVES ( maximal number of BSP leaves per view cell )\n" << maxBspLeaves << endl; 
    2437          
    2438         app << "===== END OF BspViewCells statistics ==========\n"; 
    2439 } 
    24402413 
    24412414/*************************************************************/ 
Note: See TracChangeset for help on using the changeset viewer.