Ignore:
Timestamp:
08/30/06 21:54:49 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1298 r1302  
    232232                || (mHierarchyStats.Leaves() >= mTermMaxLeaves)  
    233233                //|| (mGlobalCostMisses >= mTermGlobalCostMissTolerance) 
    234                 //||    candidate->GlobalTerminationCriteriaMet() 
     234                ||      candidate->GlobalTerminationCriteriaMet() 
    235235                ); 
    236236} 
     
    269269                                                *objectSpaceRays); 
    270270 
    271  
    272271        cout << "Constructing view space / object space tree ... \n"; 
    273272        const long startTime = GetTime();        
    274273         
    275274        const bool repairQueue = true; 
     275        //const bool repairQueue = false; 
     276 
    276277        // process object space candidates 
    277278        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; 
    280280 
    281281        mVspTree->mVspStats.Stop(); 
     
    424424                        if (repair) RepairQueue(); 
    425425 
    426                         cout << "candidate: " << mCurrentCandidate->Type() << ", priority: "  
    427                                  << mCurrentCandidate->GetPriority() << endl; 
    428                 } 
    429  
     426                        Debug << "candidate: " << mCurrentCandidate->Type() << ", priority: "  
     427                                  << mCurrentCandidate->GetPriority() << endl; 
     428                } 
     429                 
    430430                DEL_PTR(mCurrentCandidate); 
    431431        } 
     
    457457 
    458458                        mBvHierarchy->CollectDirtyCandidates(sc, dirtyList); 
     459 
     460sc->mParentData.mNode->SetSubdivisionCandidate(NULL); // HACK 
    459461                        break; 
    460462                } 
     
    471473 
    472474        mVspTree->CollectDirtyCandidates(sc, dirtyList); 
     475 
     476sc->mParentData.mNode->SetSubdivisionCandidate(NULL); // HACK 
    473477} 
    474478 
    475479 
    476480void HierarchyManager::CollectDirtyCandidates(SubdivisionCandidateContainer &dirtyList) 
    477 {        
     481{ 
    478482        // we have either a object space or view space split 
    479483        if (mCurrentCandidate->Type() == SubdivisionCandidate::VIEW_SPACE) 
    480484        { 
     485                Debug << "collecting candidates after view space split" << endl; 
    481486                CollectViewSpaceDirtyList(dirtyList); 
    482487        } 
    483488        else // object space split 
    484         {        
     489        {       Debug << "collecting candidates after object space split" << endl; 
    485490                CollectObjectSpaceDirtyList(dirtyList); 
    486491        } 
     
    509514        // collect list of "dirty" candidates 
    510515        vector<SubdivisionCandidate *> dirtyList; 
     516        Debug << "collecting dirty candidates" << endl; 
    511517        CollectDirtyCandidates(dirtyList); 
    512518         
    513519        //-- reevaluate the dirty list 
    514520        vector<SubdivisionCandidate *>::const_iterator sit, sit_end = dirtyList.end(); 
     521         
     522        Debug << "collected " << (int)dirtyList.size() << " candidates" << endl; 
    515523 
    516524        for (sit = dirtyList.begin(); sit != sit_end; ++ sit) 
    517525        { 
    518526                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 
    525547        } 
    526548} 
Note: See TracChangeset for help on using the changeset viewer.