Changeset 729 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
- Timestamp:
- 04/06/06 18:37:31 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r728 r729 69 69 } 70 70 71 71 /// Fast computation of merged pvs size 72 72 int ComputeMergedPvsSize(const ObjectPvs &pvs1, const ObjectPvs &pvs2) 73 73 { 74 // add first pvs 74 75 int pvs = pvs1.GetSize(); 75 76 76 // compute new pvs size77 77 ObjectPvsMap::const_iterator it, it_end = pvs1.mEntries.end(); 78 78 79 79 Intersectable::NewMail(); 80 80 81 // mail all objects in first pvs 81 82 for (it = pvs1.mEntries.begin(); it != it_end; ++ it) 82 83 { … … 86 87 it_end = pvs2.mEntries.end(); 87 88 89 // look if they are in second pvs 88 90 for (it = pvs2.mEntries.begin(); it != it_end; ++ it) 89 91 { … … 94 96 95 97 return pvs; 98 } 99 100 // computet render cost of merge 101 float ViewCellsTree::ComputeMergedPvsCost(const ObjectPvs &pvs1, const ObjectPvs &pvs2) const 102 { 103 float renderCost = 0; 104 105 // compute new pvs size 106 ObjectPvsMap::const_iterator it, it_end = pvs1.mEntries.end(); 107 108 Intersectable::NewMail(); 109 110 // first mail all objects in first pvs 111 for (it = pvs1.mEntries.begin(); it != it_end; ++ it) 112 { 113 Intersectable *obj = (*it).first; 114 115 obj->Mail(); 116 renderCost += mViewCellsManager->EvalRenderCost(obj); 117 } 118 119 it_end = pvs2.mEntries.end(); 120 121 122 for (it = pvs2.mEntries.begin(); it != it_end; ++ it) 123 { 124 Intersectable *obj = (*it).first; 125 126 // test if object already considered 127 if (!obj->Mailed()) 128 { 129 renderCost += mViewCellsManager->EvalRenderCost(obj); 130 } 131 } 132 133 return renderCost; 96 134 } 97 135 … … 1212 1250 { 1213 1251 //-- compute pvs difference 1214 const int newPvs = 1252 const float newPvs = 1253 #if 0 1215 1254 ComputeMergedPvsSize(mc.mLeftViewCell->GetPvs(), 1216 1255 mc.mRightViewCell->GetPvs()); 1217 1218 const float newPenalty = 1219 EvalPvsPenalty(newPvs, 1220 mViewCellsManager->GetMinPvsSize(), 1221 mViewCellsManager->GetMaxPvsSize()); 1256 #else 1257 ComputeMergedPvsCost(mc.mLeftViewCell->GetPvs(), 1258 mc.mRightViewCell->GetPvs()); 1259 #endif 1260 1261 const float newPenalty = EvalPvsPenalty(newPvs, 1262 mViewCellsManager->GetMinPvsSize(), 1263 mViewCellsManager->GetMaxPvsSize()); 1222 1264 1223 1265 ViewCell *vc1 = mc.mLeftViewCell;
Note: See TracChangeset
for help on using the changeset viewer.