Ignore:
Timestamp:
05/29/06 18:54:02 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r979 r991  
    566566        maxRenderCost = viewCells.back()->GetRenderCost(); 
    567567 
    568         Debug << "histogram minrc: " << minRenderCost << " maxrc: " << maxRenderCost << endl; 
    569  
    570         const int intervals = min(50, (int)viewCells.size()); 
     568        Debug << "histogram min rc: " << minRenderCost << " max rc: " << maxRenderCost << endl; 
     569 
     570 
     571        const int intervals = min(20, (int)viewCells.size()); 
    571572 
    572573        const float range = maxRenderCost - minRenderCost; 
     
    614615                const float volRatioDif = volDif / totalVol; 
    615616 
    616                 outstream << "#Pass\n" << j << endl; 
     617                outstream << "#Pass\n" << j ++ << endl; 
    617618                outstream << "#RenderCostRatio\n" << rcRatio << endl; 
    618619                outstream << "#WeightedCost\n" << currentRenderCost / totalVol << endl; 
     
    624625                // increase current render cost 
    625626                currentRenderCost += stepSize; 
    626                 ++ j; 
    627627        } 
    628628 
     
    763763        maxPvsSize = viewCells.back()->GetPvs().GetSize(); 
    764764        minPvsSize = 0; 
     765        // hack: normalize pvs size 
    765766        maxPvsSize = 1200; 
    766767        minPvsSize = 0; 
     
    768769 
    769770        Debug << "histogram minpvssize: " << minPvsSize << " maxpvssize: " << maxPvsSize << endl; 
     771 
    770772 
    771773        const int intervals = min(20, (int)viewCells.size()); 
     
    826828                currentPvsSize += stepSize; 
    827829        } 
     830 
    828831        outstream.close(); 
    829832} 
     
    902905                cout << "compute new statistics ... "; 
    903906 
    904 /*Debug << "*******+" << endl; 
    905 float overall = 0; 
    906 stable_sort(leaves.begin(), leaves.end(), ViewCell::SmallerPvs); 
    907         for (int i = 0; i < leaves.size(); ++ i) 
    908         { 
    909                 overall += leaves[i]->GetPvs().GetSize(); 
    910                 Debug << "i " << i << " !size: " << leaves[i]->GetPvs().GetSize() << " vol: " << leaves[i]->GetVolume() << " overall " << overall << endl; 
    911                  
    912         } 
    913 */ 
    914907 
    915908                //-- propagate pvs or pvs size information 
     
    12421235                                                          int maxPvsSize) const 
    12431236{ 
    1244   ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 
    1245  
    1246   for (it = mViewCells.begin(); it != it_end; ++ it) { 
    1247         SetValidity(*it, minPvsSize, maxPvsSize); 
    1248   } 
     1237        ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 
     1238 
     1239 
     1240        for (it = mViewCells.begin(); it != it_end; ++ it)  
     1241        { 
     1242                SetValidity(*it, minPvsSize, maxPvsSize); 
     1243        } 
    12491244} 
    12501245 
     
    12611256 
    12621257  for (int i=0; i < mViewCells.size(); i++) 
    1263         mViewCells[i]->SetValid(i >= start && i <= end); 
    1264 } 
    1265  
    1266 int 
    1267 ViewCellsManager::CountValidViewcells() const 
    1268 { 
    1269   ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 
    1270   int valid = 0; 
    1271   for (it = mViewCells.begin(); it != it_end; ++ it) { 
    1272         if ((*it)->GetValid()) 
    1273           valid ++; 
     1258  { 
     1259          mViewCells[i]->SetValid(i >= start && i <= end); 
     1260   
    12741261  } 
    1275   return valid; 
     1262} 
     1263 
     1264int ViewCellsManager::CountValidViewcells() const 
     1265{ 
     1266        ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 
     1267        int valid = 0; 
     1268 
     1269        for (it = mViewCells.begin(); it != it_end; ++ it)  
     1270        {        
     1271                if ((*it)->GetValid()) 
     1272                        ++ valid; 
     1273        } 
     1274 
     1275        return valid; 
    12761276} 
    12771277 
     
    47084708{ 
    47094709        int numSamples; 
     4710 
    47104711        environment->GetIntValue("RenderSampler.samples", numSamples); 
    47114712        cout << "samples" << numSamples << endl; 
     
    47164717                return; 
    47174718 
    4718         // doing the query 
     4719        //start the from point queries 
    47194720        long startTime = GetTime(); 
    47204721        cout << "starting sampling of render cost ... "; 
     
    47284729        vector<RenderCostSample>::const_iterator rit, rit_end = samples.end(); 
    47294730 
     4731        //std::map<ViewCell *, ObjectPvs> sampleMap; 
     4732 
    47304733        for (rit = samples.begin(); rit != rit_end; ++ rit) 
    47314734        { 
    47324735                RenderCostSample sample = *rit; 
    4733                 //ViewCell *vc = GetViewCell(sample.)pos; 
     4736                 
     4737                ViewCell *vc = GetViewCell(sample.mPosition); 
     4738                 
     4739                AxisAlignedBox3 box(sample.mPosition - Vector3(1, 1, 1), sample.mPosition + Vector3(1, 1, 1)); 
     4740         
     4741                Mesh *hMesh = CreateMeshFromBox(box); 
     4742                 
     4743                DEL_PTR(hMesh); 
     4744#if 0 
     4745                if (!sampleMap.find(vc)) 
     4746                        sampleMap.insert(vc, sample.mVisibleObjects); 
     4747                else 
     4748                        sampleMap[vc].Merge(Merge(sample.mVisibleObjects); 
     4749#endif 
    47344750        } 
    47354751} 
Note: See TracChangeset for help on using the changeset viewer.