Changeset 1302 for GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
- Timestamp:
- 08/30/06 21:54:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1298 r1302 232 232 || (mHierarchyStats.Leaves() >= mTermMaxLeaves) 233 233 //|| (mGlobalCostMisses >= mTermGlobalCostMissTolerance) 234 //|| candidate->GlobalTerminationCriteriaMet()234 || candidate->GlobalTerminationCriteriaMet() 235 235 ); 236 236 } … … 269 269 *objectSpaceRays); 270 270 271 272 271 cout << "Constructing view space / object space tree ... \n"; 273 272 const long startTime = GetTime(); 274 273 275 274 const bool repairQueue = true; 275 //const bool repairQueue = false; 276 276 277 // process object space candidates 277 278 RunConstruction(repairQueue); 278 279 cout << "finished in " << TimeDiff(startTime, GetTime())*1e-3 << " secs" << endl; 279 cout << "finished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 280 280 281 281 mVspTree->mVspStats.Stop(); … … 424 424 if (repair) RepairQueue(); 425 425 426 cout<< "candidate: " << mCurrentCandidate->Type() << ", priority: "427 << mCurrentCandidate->GetPriority() << endl;428 } 429 426 Debug << "candidate: " << mCurrentCandidate->Type() << ", priority: " 427 << mCurrentCandidate->GetPriority() << endl; 428 } 429 430 430 DEL_PTR(mCurrentCandidate); 431 431 } … … 457 457 458 458 mBvHierarchy->CollectDirtyCandidates(sc, dirtyList); 459 460 sc->mParentData.mNode->SetSubdivisionCandidate(NULL); // HACK 459 461 break; 460 462 } … … 471 473 472 474 mVspTree->CollectDirtyCandidates(sc, dirtyList); 475 476 sc->mParentData.mNode->SetSubdivisionCandidate(NULL); // HACK 473 477 } 474 478 475 479 476 480 void HierarchyManager::CollectDirtyCandidates(SubdivisionCandidateContainer &dirtyList) 477 { 481 { 478 482 // we have either a object space or view space split 479 483 if (mCurrentCandidate->Type() == SubdivisionCandidate::VIEW_SPACE) 480 484 { 485 Debug << "collecting candidates after view space split" << endl; 481 486 CollectViewSpaceDirtyList(dirtyList); 482 487 } 483 488 else // object space split 484 { 489 { Debug << "collecting candidates after object space split" << endl; 485 490 CollectObjectSpaceDirtyList(dirtyList); 486 491 } … … 509 514 // collect list of "dirty" candidates 510 515 vector<SubdivisionCandidate *> dirtyList; 516 Debug << "collecting dirty candidates" << endl; 511 517 CollectDirtyCandidates(dirtyList); 512 518 513 519 //-- reevaluate the dirty list 514 520 vector<SubdivisionCandidate *>::const_iterator sit, sit_end = dirtyList.end(); 521 522 Debug << "collected " << (int)dirtyList.size() << " candidates" << endl; 515 523 516 524 for (sit = dirtyList.begin(); sit != sit_end; ++ sit) 517 525 { 518 526 SubdivisionCandidate* sc = *sit; 519 // erase from queue 520 mTQueue.Erase(sc); 521 // reevaluate 522 sc->EvalPriority(); 523 // reinsert 524 mTQueue.Push(sc); 527 float rcd = sc->GetRenderCostDecrease(); 528 Debug << "here6 " << rcd << endl; 529 Debug << "here84 " << endl; 530 Debug << "here7 " << sc << endl; 531 Debug << "here90 " << sc->GetPosition() << endl; 532 Debug << "here91 " << sc->Type() << endl; 533 //Debug << "here1191" << sc->Type() << endl; 534 //Debug << "sc: " << sc << " " << sc->GetPosition() << " " << sc->Type() << endl; 535 536 Debug << "here11" << endl; 537 mTQueue.Erase(sc); // erase from queue 538 Debug << "here2" << endl; 539 540 sc->EvalPriority(); // reevaluate 541 542 /* cout << "render cost decrease diff " << rcd - sc->GetRenderCostDecrease() 543 << " old: " << rcd << " new " << sc->GetRenderCostDecrease() 544 << " type " << sc->Type() << endl;*/ 545 546 mTQueue.Push(sc); // reinsert 525 547 } 526 548 }
Note: See TracChangeset
for help on using the changeset viewer.