Changeset 2648 for GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
- Timestamp:
- 03/18/08 19:28:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2643 r2648 20 20 21 21 #define GVS_DEBUG 0 22 static ObjectContainer myobjects;23 22 24 23 struct VizStruct … … 32 31 static const float MIN_DIST = 0.001f; 33 32 33 static ObjectContainer myobjects; 34 34 static vector<VizStruct> vizContainer; 35 35 36 36 37 GvsPreprocessor::GvsPreprocessor(): … … 78 79 mGvsStats.Reset(); 79 80 81 // hack: some generic statistical values that can be read 82 // by an application using the preprocessor 80 83 mGenericStats = 0; 81 84 mGenericStats2 = 0; … … 105 108 ViewCell *GvsPreprocessor::NextViewCell() 106 109 { 107 //if (mViewCellsManager->GetNumViewCells() == mProcessedViewCells)108 // return false; // no more view cells109 110 110 if (mProcessedViewCells == (int)mViewCells.size()) 111 111 return NULL; // no more view cells … … 440 440 441 441 const int numBorderSamples = (int)vssRays.size() - numRandomRays; 442 443 #if 0 442 444 // set flags 443 /*VssRayContainer::const_iterator rit, rit_end = vssRays.end();445 VssRayContainer::const_iterator rit, rit_end = vssRays.end(); 444 446 for (rit = vssRays.begin(); rit != rit_end; ++ rit, ++ i) 445 447 (*rit)->mFlags |= VssRay::BorderSample; 446 */ 448 #endif 449 447 450 int castRays = (int)simpleRays.size(); 448 451 449 452 VssRayContainer invalidSamples; 450 451 453 452 454 // handle rays … … 783 785 int oldContribution = mGvsStats.mTotalContribution; 784 786 int passSamples = 0; 787 785 788 mGenericStats = 0; 786 789 mGenericStats2 = 0; … … 831 834 void GvsPreprocessor::CompileViewCellsList() 832 835 { 836 // Receive list of view cells from view cells manager 833 837 ViewCellPointsList *vcPoints = mViewCellsManager->GetViewCellPointsList(); 834 835 836 int i = 0; 837 838 838 839 if (!vcPoints->empty()) 839 840 { … … 843 844 844 845 for (vit = vcPoints->begin(); vit != vit_end; ++ vit) 845 { //cout << i ++ << " " << (*vit)->first->GetId() << endl;846 { 846 847 mViewCells.push_back((*vit)->first); 847 848 } … … 941 942 942 943 943 944 944 void GvsPreprocessor::PerViewCellComputation() 945 945 { … … 954 954 (*oit)->mCounter = 0; 955 955 956 956 ComputeViewCell(vc); 957 957 } 958 958 } … … 1124 1124 #endif 1125 1125 1126 mGvsStats.Stop();1127 mGvsStats.Print(mGvsStatsStream);1128 1129 1126 if (mPerViewCell) 1130 1127 { 1131 #if 01128 #if 1 1132 1129 // provide list of view cells to compute 1133 1130 CompileViewCellsList(); 1134 1135 1131 // start per view cell gvs 1136 1132 PerViewCellComputation(); 1137 1138 if (mEvaluatePixelError)1139 {1140 ComputeRenderError();1141 }1142 1133 #else 1143 1134 PerViewCellComputation2(); … … 1162 1153 { 1163 1154 ExportPreprocessedData(mVisibilityFileName); 1155 } 1156 1157 // compute the pixel error of this visibility solution 1158 if (mEvaluatePixelError) 1159 { 1160 ComputeRenderError(); 1164 1161 } 1165 1162 … … 1211 1208 { 1212 1209 app << "#ViewCells\n" << mViewCells << endl; 1213 app << "#ViewCellId\n" << mViewCellId << endl; 1210 app << "#Id\n" << mViewCellId << endl; 1211 app << "#Time\n" << mTimePerViewCell << endl;; 1212 app << "#TrianglePvs\n" << mTrianglePvs << endl; 1213 app << "#ObjectPvs\n" << mPerViewCellPvs << endl; 1214 app << "#PvsCost\n" << (int)mPvsCost << endl; 1215 1216 #if 0 1217 app << "#TotalPvs\n" << mTotalPvs << endl; 1214 1218 app << "#TotalTime\n" << mTotalTime << endl; 1215 app << "#TimePerViewCell\n" << mTimePerViewCell << endl;;1216 1217 1219 app << "#RaysPerSec\n" << RaysPerSec() << endl; 1218 1219 app << "#TrianglePvs\n" << mTrianglePvs << endl;1220 app << "#TotalTrianglePvs\n" << mTotalTrianglePvs << endl;1221 1222 app << "#PerViewCellPvs\n" << mPerViewCellPvs << endl;1223 app << "#TotalPvs\n" << mTotalPvs << endl;1224 1220 1225 1221 app << "#PerViewCellSamples\n" << mPerViewCellSamples << endl; 1226 1222 app << "#TotalSamples\n" << mTotalSamples << endl; 1227 1223 app << "#SamplesContri\n" << mTotalContribution << endl; 1228 1224 app << "#TotalTrianglePvs\n" << mTotalTrianglePvs << endl; 1225 1226 #endif 1227 1229 1228 //app << "#ReverseSamples\n" << mReverseSamples << endl; 1230 1229 //app << "#BorderSamples\n" << mBorderSamples << endl; … … 1277 1276 else 1278 1277 { 1279 /*// add pvs1280 ObjectContainer::const_iterator it, it_end = mKdPvs.end();1281 1282 for (it = mKdPvs.begin(); it != it_end; ++ it)1283 mCurrentViewCell->GetPvs().AddSampleDirty(*it, 1.0f);1284 */1285 1278 mGvsStats.mPerViewCellPvs = mCurrentViewCell->GetPvs().GetSize(); 1286 1287 cout << "pvs cost: " << mCurrentViewCell->GetPvs().EvalPvsCost() << " pvs tri: " << mGenericStats2 << endl; 1279 mGvsStats.mPvsCost = mCurrentViewCell->GetPvs().EvalPvsCost(); 1280 1281 cout << "id: " << mCurrentViewCell->GetId() << " pvs cost: " 1282 << mGvsStats.mPvsCost << " pvs tri: " << mTrianglePvs.size() << endl; 1288 1283 } 1289 1284 … … 1293 1288 1294 1289 mGvsStats.mViewCells = mProcessedViewCells;//mPass; 1295 1296 1297 1290 mGvsStats.mTotalPvs += mGvsStats.mPerViewCellPvs; 1298 1291 mGvsStats.mTotalSamples += mGvsStats.mPerViewCellSamples;
Note: See TracChangeset
for help on using the changeset viewer.