Ignore:
Timestamp:
01/21/07 00:40:56 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp

    r2000 r2003  
    3232Preprocessor(),  
    3333mSamplingType(SamplingStrategy::VIEWCELL_BASED_DISTRIBUTION), 
    34 //mSamplingType(SamplingStrategy::DIRECTION_BASED_DISTRIBUTION), 
    3534mProcessedViewCells(0), 
    3635mCurrentViewCell(NULL) 
     
    203202                return false; 
    204203 
    205         if (0 && GVS_DEBUG) 
     204        if (1 && GVS_DEBUG) 
    206205                mVssRays.push_back(new VssRay(*vssRay)); 
    207206 
     
    653652        //exporter->ExportRays(vcRays, RgbColor(1, 0, 0)); 
    654653        //exporter->ExportRays(vcRays2, RgbColor(0, 1, 0)); 
    655         //exporter->ExportRays(vcRays3, RgbColor(1, 1, 1)); 
     654        exporter->ExportRays(vcRays3, RgbColor(1, 1, 1)); 
    656655} 
    657656 
     
    773772                passSamples += newSamples; 
    774773                mGvsStats.mPerViewCellSamples += newSamples; 
    775                 //cout << "here2 " << passSamples % (mSamplesPerPass + 1) << endl; 
     774                 
    776775 
    777776                if (passSamples >= mSamplesPerPass) 
     
    884883                (*oit)->mCounter = 0; 
    885884        } 
     885        long lastTime = GetTime(); 
    886886 
    887887        while (NextViewCell()) 
     
    896896                //mGvsStats.mTrianglePvs = mCurrentViewCell->GetPvs().GetSize(); 
    897897                mGvsStats.mTrianglePvs = (int)mTrianglePvs.size(); 
     898                mGvsStats.mTotalTrianglePvs += mGvsStats.mTrianglePvs; 
    898899 
    899900                ObjectContainer objectPvs; 
     
    910911                mGvsStats.mViewCells = mProcessedViewCells;//mPass; 
    911912                //mGvsStats.mPerViewCellPvs = mCurrentViewCell->GetPvs().GetSize(); 
    912                 mGvsStats.mPerViewCellPvs = (int)mTrianglePvs.size(); 
     913                mGvsStats.mPerViewCellPvs = (int)objectPvs.size(); 
    913914 
    914915                mGvsStats.mTotalPvs += mGvsStats.mPerViewCellPvs; 
    915916                mGvsStats.mTotalSamples += mGvsStats.mPerViewCellSamples; 
    916917 
     918                // timing 
     919                const long currentTime = GetTime(); 
     920         
     921                mGvsStats.mTimePerViewCell = TimeDiff(lastTime, currentTime) * 1e-3f; 
     922                mGvsStats.mTotalTime += mGvsStats.mTimePerViewCell; 
     923 
     924                lastTime = currentTime; 
     925 
    917926                mGvsStats.Stop(); 
    918927                mGvsStats.Print(mGvsStatsStream); 
    919928 
    920                 mTrianglePvs.clear(); 
     929        mTrianglePvs.clear(); 
    921930 
    922931                if (GVS_DEBUG) 
     
    10371046 
    10381047        //Randomize(0); 
    1039          
    10401048        mGvsStats.Reset(); 
    10411049        mGvsStats.Start(); 
     
    11191127void GvsStatistics::Print(ostream &app) const 
    11201128{ 
    1121         app << "#Pass\n" << mPass << endl; 
     1129        app << "#ViewCells\n" << mViewCells << endl; 
    11221130        app << "#ViewCellId\n" << mViewCellId << endl; 
    1123         app << "#Time\n" << Time() << endl; 
     1131        app << "#TotalTime\n" << mTotalTime << endl; 
     1132        app << "#TimePerViewCell\n" << mTimePerViewCell << endl;; 
     1133 
     1134        app << "#RaysPerSec\n" << RaysPerSec() << endl; 
     1135 
     1136        app << "#TrianglePvs\n" << mTrianglePvs << endl; 
     1137        app << "#TotalTrianglePvs\n" << mTotalTrianglePvs << endl; 
     1138 
     1139        app << "#PerViewCellPvs\n" << mPerViewCellPvs << endl; 
     1140        app << "#TotalPvs\n" << mTotalPvs << endl; 
     1141         
     1142        app << "#PerViewCellSamples\n" << mPerViewCellSamples << endl; 
    11241143        app << "#TotalSamples\n" << mTotalSamples << endl; 
    1125         app << "#ScDiff\n" << mPassContribution << endl; 
    11261144        app     << "#SamplesContri\n" << mTotalContribution << endl; 
    1127         app << "#ReverseSamples\n" << mReverseSamples << endl; 
    1128         app << "#BorderSamples\n" << mBorderSamples << endl;             
    1129         app << "#GvsRuns\n" << mGvsPass << endl; 
    1130         app << "#ViewCells\n" << mViewCells << endl; 
    1131         app << "#TotalPvs\n" << mTotalPvs << endl; 
    1132         app << "#PerViewCellPvs\n" << mPerViewCellPvs << endl; 
    1133         app << "#TrianglePvs\n" << mTrianglePvs << endl; 
    1134         app << "#RaysPerSec\n" << RaysPerSec() << endl; 
    1135         app << "#PerViewCellSamples\n" << mPerViewCellSamples << endl << endl; 
    1136 } 
    1137  
    1138  
    1139 } 
     1145                 
     1146        //app << "#ReverseSamples\n" << mReverseSamples << endl; 
     1147        //app << "#BorderSamples\n" << mBorderSamples << endl; 
     1148 
     1149        //app << "#Pass\n" << mPass << endl; 
     1150        //app << "#ScDiff\n" << mPassContribution << endl; 
     1151        //app << "#GvsRuns\n" << mGvsPass << endl;       
     1152 
     1153        app << endl; 
     1154} 
     1155 
     1156 
     1157} 
Note: See TracChangeset for help on using the changeset viewer.