Ignore:
Timestamp:
07/27/06 02:07:26 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1160 r1161  
    39853985        if (ViewCellsTreeConstructed() && mCompressViewCells) 
    39863986        { 
    3987                 int pvsEntries = mViewCellsTree->GetNumPvsEntries(mViewCellsTree->GetRoot()); 
     3987                int pvsEntries = mViewCellsTree->GetStoredPvsEntriesNum(mViewCellsTree->GetRoot()); 
    39883988                Debug << "number of entries before compress: " << pvsEntries << endl; 
    39893989 
    39903990                mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 
    39913991 
    3992                 pvsEntries = mViewCellsTree->GetNumPvsEntries(mViewCellsTree->GetRoot()); 
     3992                pvsEntries = mViewCellsTree->GetStoredPvsEntriesNum(mViewCellsTree->GetRoot()); 
    39933993                Debug << "number of entries after compress: " << pvsEntries << endl; 
    39943994        } 
     
    45894589{ 
    45904590        int numSamples; 
    4591  
     4591         
    45924592        Environment::GetSingleton()->GetIntValue("RenderSampler.samples", numSamples); 
    45934593        cout << "samples" << numSamples << endl; 
     
    46074607 
    46084608 
    4609         // counting the pvss 
     4609        // for each sample: 
     4610        //    find view cells associated with the samples 
     4611        //    store the sample pvs with the pvs associated with the view cell 
     4612        // for each view cell: 
     4613        //    compute difference point sampled pvs - view cell pvs 
     4614        //    export geometry with color coded pvs difference 
     4615         
     4616    std::map<ViewCell *, ObjectPvs> sampleMap; 
     4617 
    46104618        vector<RenderCostSample>::const_iterator rit, rit_end = samples.end(); 
    46114619 
    4612         //std::map<ViewCell *, ObjectPvs> sampleMap; 
    4613  
     4620        for (rit = samples.begin(); rit != rit_end; ++ rit) 
     4621        { 
     4622                RenderCostSample sample = *rit; 
     4623         
     4624                ViewCell *vc = GetViewCell(sample.mPosition); 
     4625 
     4626                std::map<ViewCell *, ObjectPvs>::iterator it = sampleMap.find(vc); 
     4627 
     4628                if (it == sampleMap.end()) 
     4629                { 
     4630                        sampleMap[vc] = sample.mPvs; 
     4631                } 
     4632                else 
     4633                { 
     4634                        (*it).second.Merge(sample.mPvs); 
     4635                } 
     4636        } 
     4637 
     4638        // visualize the view cells 
     4639        std::map<ViewCell *, ObjectPvs>::const_iterator vit, vit_end = sampleMap.end(); 
     4640 
     4641        Material m;//= RandomMaterial(); 
     4642 
     4643        for (vit = sampleMap.begin(); vit != vit_end; ++ vit) 
     4644        { 
     4645                ViewCell *vc = (*vit).first; 
     4646                 
     4647                const int pvsVc = mViewCellsTree->GetPvsEntries(vc); 
     4648                const int pvs2 = (*vit).second.GetSize(); 
     4649 
     4650        m.mDiffuseColor.r = (float) (pvsVc - pvs2); 
     4651                m.mDiffuseColor.b = 1.0f; 
     4652                //exporter->SetForcedMaterial(m); 
     4653 
     4654//              ExportViewCellGeometry(exporter, vc, mClipPlane); 
     4655 
     4656/*      // counting the pvss 
    46144657        for (rit = samples.begin(); rit != rit_end; ++ rit) 
    46154658        { 
     
    46224665                 
    46234666                DEL_PTR(hMesh); 
    4624 #if 0 
    4625                 if (!sampleMap.find(vc)) 
    4626                         sampleMap.insert(vc, sample.mVisibleObjects); 
    4627                 else 
    4628                         sampleMap[vc].Merge(Merge(sample.mVisibleObjects); 
    4629 #endif 
     4667 
     4668*/ 
    46304669        } 
    46314670} 
     
    50445083        if (ViewCellsTreeConstructed() && mCompressViewCells) 
    50455084        { 
    5046                 int pvsEntries = mViewCellsTree->GetNumPvsEntries(mViewCellsTree->GetRoot()); 
     5085                int pvsEntries = mViewCellsTree->GetStoredPvsEntriesNum(mViewCellsTree->GetRoot()); 
    50475086                Debug << "number of entries before compress: " << pvsEntries << endl; 
    50485087 
    50495088                mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 
    50505089 
    5051                 pvsEntries = mViewCellsTree->GetNumPvsEntries(mViewCellsTree->GetRoot()); 
     5090                pvsEntries = mViewCellsTree->GetStoredPvsEntriesNum(mViewCellsTree->GetRoot()); 
    50525091                Debug << "number of entries after compress: " << pvsEntries << endl; 
    50535092        } 
Note: See TracChangeset for help on using the changeset viewer.