Changeset 1707 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 11/01/06 23:20:53 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1705 r1707 1077 1077 1078 1078 /// Returns index of the best view cells of the neighborhood 1079 int GetBestViewCellIdx(ViewCell *root, const ViewCellContainer &neighborhood)1079 static int GetBestViewCellIdx(ViewCell *root, const ViewCellContainer &neighborhood) 1080 1080 { 1081 1081 int bestViewCellIdx = 0; … … 1237 1237 { 1238 1238 1239 if ((vc->GetPvs(). CountObjectsInPvs() > maxPvsSize) ||1240 (vc->GetPvs(). CountObjectsInPvs() < minPvsSize))1239 if ((vc->GetPvs().EvalPvsCost() > maxPvsSize) || 1240 (vc->GetPvs().EvalPvsCost() < minPvsSize)) 1241 1241 { 1242 1242 return false; … … 1510 1510 { 1511 1511 ViewCell *vc = *it; 1512 totalRenderCost += vc->GetPvs(). CountObjectsInPvs() * vc->GetVolume();1513 totalPvs += (int)vc->GetPvs(). CountObjectsInPvs();1512 totalRenderCost += vc->GetPvs().EvalPvsCost() * vc->GetVolume(); 1513 totalPvs += (int)vc->GetPvs().EvalPvsCost(); 1514 1514 } 1515 1515 … … 1530 1530 ViewCell *vc = *it; 1531 1531 1532 float renderCost = vc->GetPvs(). CountObjectsInPvs() * vc->GetVolume();1532 float renderCost = vc->GetPvs().EvalPvsCost() * vc->GetVolume(); 1533 1533 float dev; 1534 1534 1535 1535 if (1) 1536 dev = fabs(avgRenderCost - (float)vc->GetPvs(). CountObjectsInPvs());1536 dev = fabs(avgRenderCost - (float)vc->GetPvs().EvalPvsCost()); 1537 1537 else 1538 1538 dev = fabs(expectedRenderCost - renderCost); … … 1643 1643 1644 1644 // update pvs size 1645 UpdateScalarPvsSize(vc, vc->GetPvs(). CountObjectsInPvs(), vc->GetPvs().GetSize());1645 UpdateScalarPvsSize(vc, vc->GetPvs().EvalPvsCost(), vc->GetPvs().GetSize()); 1646 1646 1647 1647 return vc; … … 2155 2155 2156 2156 2157 void ViewCellsManager::SetViewCellActive(ViewCell *vc) const 2158 { 2159 ViewCellContainer leaves; 2160 // sets the pointers to the currently active view cells 2161 mViewCellsTree->CollectLeaves(vc, leaves); 2162 2163 ViewCellContainer::const_iterator lit, lit_end = leaves.end(); 2164 for (lit = leaves.begin(); lit != lit_end; ++ lit) 2165 { 2166 dynamic_cast<ViewCellLeaf *>(*lit)->SetActiveViewCell(vc); 2167 } 2168 } 2169 2170 2157 2171 void ViewCellsManager::SetViewCellsActive() 2158 2172 { 2159 // collect leaf view cells and set the pointers to the currently2160 // active view cells2173 // collect leaf view cells and set the pointers to 2174 // the currently active view cells 2161 2175 ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 2162 2176 2163 2177 for (it = mViewCells.begin(); it != it_end; ++ it) 2164 2178 { 2165 ViewCellContainer leaves; 2166 mViewCellsTree->CollectLeaves(*it, leaves); 2167 2168 ViewCellContainer::const_iterator lit, lit_end = leaves.end(); 2169 for (lit = mViewCells.begin(); lit != lit_end; ++ lit) 2170 { 2171 dynamic_cast<ViewCellLeaf *>(*lit)->SetActiveViewCell(*it); 2172 } 2179 SetViewCellActive(*it); 2173 2180 } 2174 2181 } … … 2570 2577 // we assume that pvs is explicitly stored in leaves 2571 2578 pvs = root->GetPvs(); 2572 UpdateScalarPvsSize(root, pvs. CountObjectsInPvs(), pvs.GetSize());2579 UpdateScalarPvsSize(root, pvs.EvalPvsCost(), pvs.GetSize()); 2573 2580 2574 2581 return; … … 2637 2644 2638 2645 // set new pvs size 2639 UpdateScalarPvsSize(interior, pvs. CountObjectsInPvs(), pvs.GetSize());2646 UpdateScalarPvsSize(interior, pvs.EvalPvsCost(), pvs.GetSize()); 2640 2647 2641 2648 #else … … 5720 5727 { 5721 5728 ViewCell *vc = *vit; 5722 int pvs = vc->GetPvs(). CountObjectsInPvs();5729 int pvs = vc->GetPvs().EvalPvsCost(); 5723 5730 float vol = vc->GetVolume(); 5724 5731 rc += pvs * vol;
Note: See TracChangeset
for help on using the changeset viewer.