Changeset 1889 for GTP/trunk


Ignore:
Timestamp:
12/13/06 20:36:32 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
3 edited

Legend:

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

    r1845 r1889  
    284284 
    285285 
     286float HierarchyManager::AvgRayContribution(const float pvs, const float rays) const 
     287{ 
     288        return (float)pvs / rays; 
     289} 
     290 
     291 
    286292void HierarchyManager::EvalSubdivisionStats() 
    287293{ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h

    r1845 r1889  
    264264        Intersectable *GetIntersectable(const VssRay &ray, const bool isTermination) const; 
    265265   
    266   Intersectable *GetIntersectable(Intersectable *obj, 
    267                                                                   const Vector3 &point) const; 
     266        Intersectable *GetIntersectable(Intersectable *obj, const Vector3 &point) const; 
    268267   
     268        float AvgRayContribution(const float pvs, const float rays) const; 
     269 
    269270        /** Export object space partition bounding boxes. 
    270271        */ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1888 r1889  
    16351635void ViewCellsManager::CompressViewCells() 
    16361636{ 
     1637        if (!(ViewCellsTreeConstructed() && mCompressViewCells)) 
     1638                return; 
     1639 
    16371640        //////////// 
    16381641        //-- compression 
    1639  
    1640         if (ViewCellsTreeConstructed() && mCompressViewCells) 
    1641         { 
    1642                 int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 
    1643                  
    1644                 cout << "number of entries before compress: " << pvsEntries << endl; 
    1645                 Debug << "number of entries before compress: " << pvsEntries << endl; 
    1646  
    1647                 mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 
    1648  
    1649                 pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 
    1650                  
    1651                 Debug << "number of entries after compress: " << pvsEntries << endl; 
    1652                 cout << "number of entries after compress: " << pvsEntries << endl; 
    1653         } 
     1642         
     1643        int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 
     1644 
     1645        cout << "number of entries before compress: " << pvsEntries << endl; 
     1646        Debug << "number of entries before compress: " << pvsEntries << endl; 
     1647 
     1648        mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 
     1649 
     1650        pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 
     1651 
     1652        Debug << "number of entries after compress: " << pvsEntries << endl; 
     1653        cout << "number of entries after compress: " << pvsEntries << endl; 
    16541654} 
    16551655 
     
    58555855        viewCell->SetArea(area); 
    58565856} 
    5857          
    5858  
    58595857 
    58605858 
     
    58655863 
    58665864 
     5865static void PrintCompressionStats(HierarchyManager *hm, const int pvsEntries) 
     5866{ 
     5867        float mem = (float)pvsEntries * ObjectPvs::GetEntrySize(); 
     5868                 
     5869        float fullmem = mem +  
     5870                        (hm->GetVspTree()->GetStatistics().Leaves() * 16 +  
     5871                         hm->mBvHierarchy->GetStatistics().Leaves() * 16) / float(1024 * 1024); 
     5872 
     5873        cout << "entries: " << pvsEntries << ", mem=" << mem << ", fullmem=" << fullmem <<endl; 
     5874        Debug << "entries: " << pvsEntries << ", mem=" << mem << ", fullmem=" << fullmem <<endl; 
     5875} 
     5876 
     5877 
    58675878void VspOspViewCellsManager::CompressViewCells() 
    58685879{ 
    5869         if (!mCompressObjects) 
    5870         { 
    5871                 cout << "compressing in the view space" << endl; 
    5872                 Debug << "compressing in the view space" << endl; 
    5873                 ViewCellsManager::CompressViewCells(); 
     5880        if (!(ViewCellsTreeConstructed() && mCompressViewCells)) 
    58745881                return; 
    5875         } 
    58765882 
    58775883        //////////// 
    58785884        //-- compression 
    58795885 
    5880         if (ViewCellsTreeConstructed() && mCompressViewCells) 
    5881         { 
    5882                 int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 
    5883                  
    5884                 cout << "compressing in the objects" << endl; 
    5885                 Debug << "compressing in the objects" << endl; 
    5886                 float mem = (float)pvsEntries * ObjectPvs::GetEntrySize(); 
    5887  
    5888                 cout << "number of entries before compress: " << pvsEntries << ", mem=" << mem << endl; 
    5889                 Debug << "number of entries before compress: " << pvsEntries << ", mem=" << mem << endl; 
     5886        int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 
     5887 
     5888        cout << "before compression: " << endl; 
     5889        Debug << "before compression: " << endl; 
     5890         
     5891        PrintCompressionStats(mHierarchyManager, pvsEntries); 
     5892 
     5893        if (mCompressObjects) 
     5894        { 
     5895                cout << "compressing in the objects: " << endl; 
     5896                Debug << "compressing in the objects: " << endl; 
    58905897 
    58915898                pvsEntries = mHierarchyManager->CompressObjectSpace(); 
    5892                 mem = (float)pvsEntries * ObjectPvs::GetEntrySize(); 
    5893  
    5894                 Debug << "number of entries after compress: " << pvsEntries << ", mem=" << mem << endl; 
    5895                 cout << "number of entries after compress: " << pvsEntries << ", mem=" << mem << endl; 
    5896         } 
     5899        } 
     5900        else 
     5901        { 
     5902                cout << "compressing in the view space: " << endl; 
     5903                Debug << "compressing in the view space: " << endl; 
     5904 
     5905                mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 
     5906                pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 
     5907        } 
     5908 
     5909        PrintCompressionStats(mHierarchyManager, pvsEntries); 
    58975910} 
    58985911 
     
    59125925        return vm; 
    59135926} 
     5927 
    59145928 
    59155929void 
Note: See TracChangeset for help on using the changeset viewer.