Ignore:
Timestamp:
04/28/08 18:59:58 (16 years ago)
Author:
mattausch
Message:

working on gvs pixel error evaluation bugfixing

File:
1 edited

Legend:

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

    r2648 r2662  
    846846                { 
    847847                        mViewCells.push_back((*vit)->first); 
     848 
     849                        if (mViewCells.size() >= mMaxViewCells) 
     850                                break; 
    848851                } 
    849  
    850                 return; 
    851         } 
    852  
    853         while ((int)mViewCells.size() < mMaxViewCells) 
    854     { 
    855                 if (0) 
     852        } 
     853        else 
     854        { 
     855                while ((int)mViewCells.size() < mMaxViewCells) 
    856856                { 
    857                         mViewCells.push_back(mViewCellsManager->GetViewCell((int)mViewCells.size())); 
    858                         continue; 
    859                 } 
    860                  
    861                 // HACK 
    862                 const int tries = 10000; 
    863                 int i = 0; 
    864  
    865                 for (i = 0; i < tries; ++ i) 
    866                 { 
    867                         const int idx = (int)RandomValue(0.0f, (float)mViewCellsManager->GetNumViewCells() - 0.5f); 
    868          
    869                         ViewCell *viewCell = mViewCellsManager->GetViewCell(idx); 
    870  
    871                         if (!viewCell->Mailed()) 
     857                        if (0) 
    872858                        { 
    873                                 viewCell->Mail(); 
     859                                mViewCells.push_back(mViewCellsManager->GetViewCell((int)mViewCells.size())); 
     860                                continue; 
     861                        } 
     862 
     863                        // HACK 
     864                        const int tries = 10000; 
     865                        int i = 0; 
     866 
     867                        for (i = 0; i < tries; ++ i) 
     868                        { 
     869                                const int idx = (int)RandomValue(0.0f, (float)mViewCellsManager->GetNumViewCells() - 0.5f); 
     870 
     871                                ViewCell *viewCell = mViewCellsManager->GetViewCell(idx); 
     872 
     873                                if (!viewCell->Mailed()) 
     874                                { 
     875                                        viewCell->Mail(); 
     876                                        break; 
     877                                } 
     878 
     879                                mViewCells.push_back(viewCell); 
     880                        } 
     881 
     882                        if (i == tries) 
     883                        { 
     884                                cerr << "big error! no view cell found" << endl; 
    874885                                break; 
    875886                        } 
    876  
    877                         mViewCells.push_back(viewCell); 
    878887                } 
    879  
    880                 if (i == tries) 
    881                 { 
    882                         cerr << "big error! no view cell found" << endl; 
    883                         return; 
    884                 } 
    885         } 
     888        } 
     889 
     890        cout << "\ncomputing list of " << mViewCells.size() << " view cells" << endl; 
    886891} 
    887892 
     
    11141119                cout << "finished view cell construction" << endl; 
    11151120        } 
    1116 #if 0 
    1117         else 
    1118         {        
    1119                 //-- test successful view cells loading by exporting them again 
    1120                 VssRayContainer dummies; 
    1121                 mViewCellsManager->Visualize(mObjects, dummies); 
    1122                 mViewCellsManager->ExportViewCells("test.xml.gz", mViewCellsManager->GetExportPvs(), mObjects); 
    1123         } 
    1124 #endif 
    11251121 
    11261122        if (mPerViewCell) 
Note: See TracChangeset for help on using the changeset viewer.