Changeset 1314 for GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
- Timestamp:
- 09/03/06 03:13:29 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1313 r1314 973 973 mLocalSubdivisionCandidates->clear(); 974 974 975 int requestedSize = 2 * (int)(rays.size());975 const int requestedSize = 2 * (int)(rays.size()); 976 976 977 977 // creates a sorted split candidates array … … 992 992 { 993 993 const bool positive = (*rit).mRay->HasPosDir(axis); 994 994 const bool delayMinEvent = false; 995 996 // origin point 995 997 pos = (*rit).ExtrapOrigin(axis); 996 997 mLocalSubdivisionCandidates->push_back(SortableEntry(positive ? SortableEntry::ERayMin : SortableEntry::ERayMax, 998 pos, (*rit).mRay)); 999 998 const int oType = positive ? SortableEntry::ERayMin : SortableEntry::ERayMax; 999 1000 if (delayMinEvent && oType == SortableEntry::ERayMin) 1001 pos += mEpsilon; // for walls 1002 1003 mLocalSubdivisionCandidates->push_back(SortableEntry(oType, pos, (*rit).mRay)); 1004 1005 // termination point 1000 1006 pos = (*rit).ExtrapTermination(axis); 1001 1002 mLocalSubdivisionCandidates->push_back(SortableEntry(positive ? SortableEntry::ERayMax : SortableEntry::ERayMin, 1003 pos, (*rit).mRay)); 1007 const int tType = positive ? SortableEntry::ERayMax : SortableEntry::ERayMin; 1008 1009 if (delayMinEvent && tType == SortableEntry::ERayMin) 1010 pos += mEpsilon; // for walls 1011 1012 mLocalSubdivisionCandidates->push_back(SortableEntry(tType, pos, (*rit).mRay)); 1004 1013 } 1005 1014 … … 1206 1215 vector<SortableEntry>::const_iterator ci, ci_end = mLocalSubdivisionCandidates->end(); 1207 1216 1217 #ifdef _DEBUG 1218 const float volRatio = tData.mBoundingBox.GetVolume() / (sizeBox * mBoundingBox.GetVolume()); 1219 const int leaves = mVspStats.Leaves(); 1220 const bool printStats = ((axis == 0) && (leaves > 0) && (leaves < 90)); 1221 1222 ofstream sumStats; 1223 ofstream pvslStats; 1224 ofstream pvsrStats; 1225 1226 if (printStats) 1227 { 1228 char str[64]; 1229 1230 sprintf(str, "tmp/vsp_heur_sum-%04d.log", leaves); 1231 sumStats.open(str); 1232 sprintf(str, "tmp/vsp_heur_pvsl-%04d.log", leaves); 1233 pvslStats.open(str); 1234 sprintf(str, "tmp/vsp_heur_pvsr-%04d.log", leaves); 1235 pvsrStats.open(str); 1236 } 1237 1238 #endif 1208 1239 for (ci = mLocalSubdivisionCandidates->begin(); ci != ci_end; ++ ci) 1209 1240 { … … 1224 1255 sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value); 1225 1256 1257 #ifdef _DEBUG 1258 if (printStats) 1259 { 1260 sumStats 1261 << "#Position\n" << currentPos << endl 1262 << "#Sum\n" << sum * volRatio << endl 1263 << "#Pvs\n" << pvsl + pvsr << endl; 1264 1265 pvslStats 1266 << "#Position\n" << currentPos << endl 1267 << "#Pvsl\n" << pvsl << endl; 1268 1269 pvsrStats 1270 << "#Position\n" << currentPos << endl 1271 << "#Pvsr\n" << pvsr << endl; 1272 } 1273 #endif 1226 1274 1227 1275 if (sum < minSum) … … 1260 1308 } 1261 1309 1262 const float volRatio = tData.mBoundingBox.GetVolume() / (sizeBox * mBoundingBox.GetVolume()); 1263 1310 #ifdef _DEBUG 1264 1311 Debug << "\n§§§§ eval local cost §§§§" << endl 1265 1312 << "back pvs: " << penaltyBack << " front pvs: " << penaltyFront << " total pvs: " << penaltyOld << endl … … 1267 1314 << "old rc: " << oldRenderCost * volRatio << " new rc: " << newRenderCost * volRatio << endl 1268 1315 << "render cost decrease: " << oldRenderCost * volRatio - newRenderCost * volRatio << endl; 1269 1316 #endif 1270 1317 return ratio; 1271 1318 }
Note: See TracChangeset
for help on using the changeset viewer.