Changeset 1160


Ignore:
Timestamp:
07/26/06 17:38:01 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
6 edited

Legend:

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

    r1142 r1160  
    113113mMergeCost(0), 
    114114mPvsSize(0), 
     115mEntriesInPvs(0), 
    115116mPvsSizeValid(false) 
    116117{ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h

    r1145 r1160  
    266266        /// the potentially visible objects 
    267267        ObjectPvs mPvs; 
    268         /// the potentially visible kd leaves 
    269         KdPvs mKdPvs; 
    270  
     268        /// the volume of this view cell 
    271269        float mVolume; 
    272270        float mArea; 
    273  
     271        /// the cost that were paid for merging this view cells from two others. 
    274272        float mMergeCost; 
    275  
     273        /// if the view cell is valid view space 
    276274        bool mValid; 
    277275 
     
    279277        RgbColor mColor; 
    280278 
    281          
    282279        /// store pvs size, used for evaluation purpose when pvss are stored only in the leaves 
    283280        int mPvsSize; 
     281        // stores number of entries in pvs 
     282        int mEntriesInPvs; 
     283 
    284284        /// if the pvs size scalar is up to date and corresponding to the real pvs size 
    285285        bool mPvsSizeValid; 
     286         
    286287 
    287288}; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1159 r1160  
    22142214 
    22152215 
    2216 void ViewCellsManager::SetScalarPvsSize(ViewCell *vc,  
    2217                                                                                 const int pvsSize) const 
     2216void ViewCellsManager::UpdateScalarPvsSize(ViewCell *vc, const int pvsSize, const int entriesInPvs) const 
    22182217{ 
    22192218        vc->mPvsSize = pvsSize; 
     2219        vc->mEntriesInPvs = entriesInPvs; 
     2220 
    22202221        vc->mPvsSizeValid = true; 
    22212222} 
     
    31983199        { 
    31993200                pvs = root->GetPvs(); 
    3200                 SetScalarPvsSize(root, pvs.GetSize()); 
     3201                UpdateScalarPvsSize(root, pvs.CountPvs(), pvs.GetSize()); 
    32013202                 
    32023203                return; 
     
    32533254        } 
    32543255         
    3255         // set new pvs size 
    3256     SetScalarPvsSize(interior, pvs.GetSize()); 
     3256        // set correct pvs size for interior 
     3257        UpdateScalarPvsSize(interior, pvs.CountPvs(), pvs.GetSize()); 
    32573258 
    32583259#else 
     
    40814082        { 
    40824083                pvs = root->GetPvs(); 
    4083                 SetScalarPvsSize(root, root->GetPvs().CountPvs()); 
     4084                UpdateScalarPvsSize(root, pvs.CountPvs(), pvs.GetSize()); 
    40844085                 
    40854086                return; 
     
    41384139         
    41394140        // set new pvs size 
    4140         SetScalarPvsSize(interior, pvs.GetSize()); 
     4141        UpdateScalarPvsSize(interior, pvs.CountPvs(), pvs.GetSize()); 
    41414142         
    41424143 
     
    51215122        // terminate traversal 
    51225123        if (root->IsLeaf()) 
    5123         { 
     5124        {  
     5125                // we assume that pvs is explicitly stored in leaves 
    51245126                pvs = root->GetPvs(); 
    5125                 SetScalarPvsSize(root, root->GetPvs().GetSize()); 
     5127                UpdateScalarPvsSize(root, pvs.CountPvs(), pvs.GetSize()); 
    51265128                 
    51275129                return; 
     
    51795181         
    51805182        // set new pvs size 
    5181         SetScalarPvsSize(interior, pvs.GetSize()); 
     5183        UpdateScalarPvsSize(interior, pvs.CountPvs(), pvs.GetSize()); 
    51825184         
    51835185 
     
    57975799                                        if (!mStoreKdPvs) 
    57985800                                        { 
    5799                                                 viewcell->GetPvs().AddSample(ray.mTerminationObject, ray.mPdf); 
     5801                                                viewcell->AddPvsSample(ray.mTerminationObject, ray.mPdf, ray.mRelativePvsContribution); 
    58005802                                        } 
    58015803                                        else 
     
    58035805                                                /// get current leaf the point 
    58045806                                                KdLeaf *leaf = mOspTree->GetLeaf(ray.mTermination); 
    5805  
    58065807                                                KdIntersectable *entry = mOspTree->GetOrCreateKdIntersectable(leaf); 
    58075808 
    5808                                                 viewcell->GetPvs().AddSample(entry, ray.mPdf); 
     5809                                                viewcell->AddPvsSample(entry, ray.mPdf, ray.mRelativePvsContribution); 
    58095810                                        } 
    58105811                                } 
     
    58125813#if COUNT_ORIGIN_OBJECTS 
    58135814                                 if (ray.mOriginObject) 
    5814                                          viewcell->GetPvs().AddSample(ray.mOriginObject, ray.mPdf); 
     5815                                         viewcell->AddPvsSample(ray.mOriginObject, ray.mPdf, ray.mPvsContribution); 
    58155816#endif 
    58165817                        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r1159 r1160  
    412412                of the hierarchy. 
    413413        */ 
    414         void SetScalarPvsSize(ViewCell *vc, const int pvsSize) const; 
     414        void UpdateScalarPvsSize(ViewCell *vc, const int pvsSize, const int entriesInPvs) const; 
    415415 
    416416 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r1149 r1160  
    842842 
    843843                // update scalar pvs size lookup 
    844                 mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().CountPvs()); 
     844                ObjectPvs &pvs = viewCell->GetPvs(); 
     845                mViewCellsManager->UpdateScalarPvsSize(viewCell, pvs.CountPvs(), pvs.GetSize()); 
    845846         
    846847 
     
    982983 
    983984                // update scalar pvs size value 
    984                 mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().CountPvs()); 
     985                ObjectPvs &pvs = viewCell->GetPvs(); 
     986                mViewCellsManager->UpdateScalarPvsSize(viewCell, pvs.CountPvs(), pvs.GetSize()); 
    985987 
    986988                mBspStats.contributingSamples += conSamp; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp

    r1155 r1160  
    609609 
    610610                // update scalar pvs size value 
    611                 mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().CountPvs()); 
     611                ObjectPvs &pvs = viewCell->GetPvs(); 
     612                mViewCellsManager->UpdateScalarPvsSize(viewCell, pvs.CountPvs(), pvs.GetSize()); 
    612613 
    613614                mVspStats.contributingSamples += conSamp; 
     
    723724 
    724725                // update scalar pvs size value 
    725                 mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().CountPvs()); 
     726                ObjectPvs &pvs = viewCell->GetPvs(); 
     727                mViewCellsManager->UpdateScalarPvsSize(viewCell, pvs.CountPvs(), pvs.GetSize()); 
    726728 
    727729                mVspStats.contributingSamples += conSamp; 
Note: See TracChangeset for help on using the changeset viewer.