Changeset 2387 for GTP/trunk/Lib/Vis
- Timestamp:
- 05/16/07 18:29:58 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r2380 r2387 246 246 virtual bool IsLeaf() const = 0; 247 247 248 inline bool SmallerPvs(const ViewCell *a, const ViewCell *b) 249 { 250 // HACK: take scalar value because pvs may not have been stored properly 251 #if 1 252 return a->mPvsCost < b->mPvsCost; 253 #else 254 return a->GetPvs().EvalPvsCost() < b->GetPvs().EvalPvsCost(); 255 #endif 256 } 257 258 inline bool GreaterOrEqualPvs(const ViewCell *a, const ViewCell *b) 259 { 260 return !SmallerPvs(a, b); 261 } 262 263 inline bool SmallerRenderCost(const ViewCell *a, const ViewCell *b) 264 { 265 return a->GetRenderCost() < b->GetRenderCost(); 266 } 267 268 inline bool LargerRenderCost(const ViewCell *a, const ViewCell *b) 269 { 270 return a->GetRenderCost() > b->GetRenderCost(); 271 } 248 friend inline bool SmallerPvs(const ViewCell *a, const ViewCell *b); 249 friend inline bool GreaterOrEqualPvs(const ViewCell *a, const ViewCell *b); 250 friend inline bool SmallerRenderCost(const ViewCell *a, const ViewCell *b); 251 friend inline bool LargerRenderCost(const ViewCell *a, const ViewCell *b); 252 272 253 273 254 /** Sets merge cost used for merging this view cell from other cells. … … 344 325 }; 345 326 327 inline bool SmallerPvs(const ViewCell *a, const ViewCell *b) 328 { 329 // HACK: take scalar value because pvs may not have been stored properly 330 #if 1 331 return a->mPvsCost < b->mPvsCost; 332 #else 333 return a->GetPvs().EvalPvsCost() < b->GetPvs().EvalPvsCost(); 334 #endif 335 } 336 337 inline bool GreaterOrEqualPvs(const ViewCell *a, const ViewCell *b) 338 { 339 return !SmallerPvs(a, b); 340 } 341 342 inline bool SmallerRenderCost(const ViewCell *a, const ViewCell *b) 343 { 344 return a->GetRenderCost() < b->GetRenderCost(); 345 } 346 347 inline bool LargerRenderCost(const ViewCell *a, const ViewCell *b) 348 { 349 return a->GetRenderCost() > b->GetRenderCost(); 350 } 346 351 347 352 class ViewCellInterior: public ViewCell -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2381 r2387 1220 1220 1221 1221 // sort by render cost 1222 sort(viewCells.begin(), viewCells.end(), ViewCell::SmallerRenderCost);1222 sort(viewCells.begin(), viewCells.end(), SmallerRenderCost); 1223 1223 1224 1224 minRenderCost = viewCells.front()->GetRenderCost(); … … 1323 1323 1324 1324 // sort by pvs size 1325 sort(viewCells.begin(), viewCells.end(), ViewCell::SmallerPvs);1325 sort(viewCells.begin(), viewCells.end(), SmallerPvs); 1326 1326 1327 1327 maxPvs = viewCells.back()->GetTrianglesInPvs(); … … 1410 1410 1411 1411 // sort by pvs size 1412 sort(viewCells.begin(), viewCells.end(), ViewCell::SmallerPvs);1412 sort(viewCells.begin(), viewCells.end(), SmallerPvs); 1413 1413 1414 1414 maxPvs = viewCells.back()->GetTrianglesInPvs(); … … 1923 1923 } 1924 1924 1925 sort(mViewCells.begin(), mViewCells.end(), ViewCell::SmallerPvs);1925 sort(mViewCells.begin(), mViewCells.end(), SmallerPvs); 1926 1926 1927 1927 int start = (int)(mViewCells.size() * minValid); … … 4078 4078 if (sortViewCells) 4079 4079 { // sort view cells to visualize the largest view cells 4080 sort(mViewCells.begin(), mViewCells.end(), ViewCell::LargerRenderCost);4080 sort(mViewCells.begin(), mViewCells.end(), LargerRenderCost); 4081 4081 } 4082 4082 … … 5401 5401 { 5402 5402 // sort view cells to visualize the largest view cells 5403 sort(mViewCells.begin(), mViewCells.end(), ViewCell::LargerRenderCost);5403 sort(mViewCells.begin(), mViewCells.end(), LargerRenderCost); 5404 5404 } 5405 5405 … … 6453 6453 { 6454 6454 // sort view cells to visualize the view cells with highest render cost 6455 sort(mViewCells.begin(), mViewCells.end(), ViewCell::LargerRenderCost);6455 sort(mViewCells.begin(), mViewCells.end(), LargerRenderCost); 6456 6456 } 6457 6457
Note: See TracChangeset
for help on using the changeset viewer.