Changeset 1160 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 07/26/06 17:38:01 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r1142 r1160 113 113 mMergeCost(0), 114 114 mPvsSize(0), 115 mEntriesInPvs(0), 115 116 mPvsSizeValid(false) 116 117 { -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r1145 r1160 266 266 /// the potentially visible objects 267 267 ObjectPvs mPvs; 268 /// the potentially visible kd leaves 269 KdPvs mKdPvs; 270 268 /// the volume of this view cell 271 269 float mVolume; 272 270 float mArea; 273 271 /// the cost that were paid for merging this view cells from two others. 274 272 float mMergeCost; 275 273 /// if the view cell is valid view space 276 274 bool mValid; 277 275 … … 279 277 RgbColor mColor; 280 278 281 282 279 /// store pvs size, used for evaluation purpose when pvss are stored only in the leaves 283 280 int mPvsSize; 281 // stores number of entries in pvs 282 int mEntriesInPvs; 283 284 284 /// if the pvs size scalar is up to date and corresponding to the real pvs size 285 285 bool mPvsSizeValid; 286 286 287 287 288 }; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1159 r1160 2214 2214 2215 2215 2216 void ViewCellsManager::SetScalarPvsSize(ViewCell *vc, 2217 const int pvsSize) const 2216 void ViewCellsManager::UpdateScalarPvsSize(ViewCell *vc, const int pvsSize, const int entriesInPvs) const 2218 2217 { 2219 2218 vc->mPvsSize = pvsSize; 2219 vc->mEntriesInPvs = entriesInPvs; 2220 2220 2221 vc->mPvsSizeValid = true; 2221 2222 } … … 3198 3199 { 3199 3200 pvs = root->GetPvs(); 3200 SetScalarPvsSize(root, pvs.GetSize());3201 UpdateScalarPvsSize(root, pvs.CountPvs(), pvs.GetSize()); 3201 3202 3202 3203 return; … … 3253 3254 } 3254 3255 3255 // set new pvs size3256 SetScalarPvsSize(interior, pvs.GetSize());3256 // set correct pvs size for interior 3257 UpdateScalarPvsSize(interior, pvs.CountPvs(), pvs.GetSize()); 3257 3258 3258 3259 #else … … 4081 4082 { 4082 4083 pvs = root->GetPvs(); 4083 SetScalarPvsSize(root, root->GetPvs().CountPvs());4084 UpdateScalarPvsSize(root, pvs.CountPvs(), pvs.GetSize()); 4084 4085 4085 4086 return; … … 4138 4139 4139 4140 // set new pvs size 4140 SetScalarPvsSize(interior, pvs.GetSize());4141 UpdateScalarPvsSize(interior, pvs.CountPvs(), pvs.GetSize()); 4141 4142 4142 4143 … … 5121 5122 // terminate traversal 5122 5123 if (root->IsLeaf()) 5123 { 5124 { 5125 // we assume that pvs is explicitly stored in leaves 5124 5126 pvs = root->GetPvs(); 5125 SetScalarPvsSize(root, root->GetPvs().GetSize());5127 UpdateScalarPvsSize(root, pvs.CountPvs(), pvs.GetSize()); 5126 5128 5127 5129 return; … … 5179 5181 5180 5182 // set new pvs size 5181 SetScalarPvsSize(interior, pvs.GetSize());5183 UpdateScalarPvsSize(interior, pvs.CountPvs(), pvs.GetSize()); 5182 5184 5183 5185 … … 5797 5799 if (!mStoreKdPvs) 5798 5800 { 5799 viewcell-> GetPvs().AddSample(ray.mTerminationObject, ray.mPdf);5801 viewcell->AddPvsSample(ray.mTerminationObject, ray.mPdf, ray.mRelativePvsContribution); 5800 5802 } 5801 5803 else … … 5803 5805 /// get current leaf the point 5804 5806 KdLeaf *leaf = mOspTree->GetLeaf(ray.mTermination); 5805 5806 5807 KdIntersectable *entry = mOspTree->GetOrCreateKdIntersectable(leaf); 5807 5808 5808 viewcell-> GetPvs().AddSample(entry, ray.mPdf);5809 viewcell->AddPvsSample(entry, ray.mPdf, ray.mRelativePvsContribution); 5809 5810 } 5810 5811 } … … 5812 5813 #if COUNT_ORIGIN_OBJECTS 5813 5814 if (ray.mOriginObject) 5814 viewcell-> GetPvs().AddSample(ray.mOriginObject, ray.mPdf);5815 viewcell->AddPvsSample(ray.mOriginObject, ray.mPdf, ray.mPvsContribution); 5815 5816 #endif 5816 5817 } -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r1159 r1160 412 412 of the hierarchy. 413 413 */ 414 void SetScalarPvsSize(ViewCell *vc, const int pvsSize) const;414 void UpdateScalarPvsSize(ViewCell *vc, const int pvsSize, const int entriesInPvs) const; 415 415 416 416 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r1149 r1160 842 842 843 843 // 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()); 845 846 846 847 … … 982 983 983 984 // 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()); 985 987 986 988 mBspStats.contributingSamples += conSamp; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1155 r1160 609 609 610 610 // 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()); 612 613 613 614 mVspStats.contributingSamples += conSamp; … … 723 724 724 725 // 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()); 726 728 727 729 mVspStats.contributingSamples += conSamp;
Note: See TracChangeset
for help on using the changeset viewer.