Changeset 651 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
- Timestamp:
- 02/18/06 18:02:12 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r650 r651 1262 1262 1263 1263 int totalPvs; 1264 float totalRenderCost, float avgRenderCost, floatexpectedCost;1264 float totalRenderCost, avgRenderCost, expectedCost; 1265 1265 1266 1266 float deviation = 0; … … 1270 1270 ofstream stats; 1271 1271 stats.open("mergeStats.log"); 1272 1273 Debug << "here343" << endl;1274 1272 1275 1273 stats … … 1347 1345 1348 1346 1349 /*float ViewCellsTree::ComputeVolume(ViewCell *vc) 1347 #if 0 1348 float ViewCellsTree::ComputeVolume(ViewCell *vc) 1350 1349 { 1351 1350 if (vc->IsLeaf()) … … 1369 1368 return volume; 1370 1369 } 1371 } */1372 1370 } 1371 #endif 1373 1372 1374 1373 void ViewCellsTree::SetRoot(ViewCell *root) … … 1621 1620 1622 1621 1623 void ViewCellsTree::Propagate UpPvs(ViewCell *vc)1622 void ViewCellsTree::PropagatePvs(ViewCell *vc) 1624 1623 { 1625 1624 while (vc->GetParent()) … … 1627 1626 vc->GetParent()->GetPvs().Merge(vc->GetPvs()); 1628 1627 vc = vc->GetParent(); 1628 } 1629 1630 if (vc->IsLeaf()) 1631 return; 1632 1633 stack<ViewCell *> tstack; 1634 1635 tstack.push(vc); 1636 1637 while (!tstack.empty()) 1638 { 1639 ViewCell *viewCell = tstack.top(); 1640 tstack.pop(); 1641 1642 if (viewCell != vc) 1643 { 1644 viewCell->GetPvs().Merge(vc->GetPvs()); 1645 } 1646 1647 if (!viewCell->IsLeaf()) 1648 { 1649 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(viewCell); 1650 ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 1651 1652 for (it = interior->mChildren.begin(); it != it_end; ++ it) 1653 { 1654 tstack.push(*it); 1655 } 1656 } 1629 1657 } 1630 1658 } … … 1727 1755 1728 1756 1757 void ViewCellsTree::CreateUniqueViewCellsIds() 1758 { 1759 stack<ViewCell *> tstack; 1760 1761 int currentId = 0; 1762 1763 tstack.push(mRoot); 1764 1765 while (!tstack.empty()) 1766 { 1767 ViewCell *vc = tstack.top(); 1768 tstack.pop(); 1769 1770 vc->SetId(currentId ++); 1771 1772 if (!vc->IsLeaf()) 1773 { 1774 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 1775 ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 1776 for (it = interior->mChildren.begin(); it != it_end; ++ it) 1777 { 1778 tstack.push(*it); 1779 } 1780 } 1781 } 1782 } 1783 1784 1729 1785 void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ofstream &stream) 1730 1786 { 1731 1787 ObjectPvsMap::iterator it, it_end = viewCell->GetPvs().mEntries.end(); 1732 1733 if (0) // test with empty pvs1734 for (it = viewCell->GetPvs().mEntries.begin(); it != it_end; ++ it)1735 {1736 stream << (*it).first->GetId() << " ";1737 }1738 1739 stream << "\" />" << endl;1740 1788 1741 1789 if (viewCell->IsLeaf()) … … 1746 1794 stream << "mergecost=\"" << viewCell->GetMergeCost() << "\" "; 1747 1795 stream << "pvs=\""; 1748 stream << "</Leaf>" << endl; 1796 if (0)// test with empty pvs 1797 for (it = viewCell->GetPvs().mEntries.begin(); it != it_end; ++ it) 1798 { 1799 stream << (*it).first->GetId() << " "; 1800 } 1801 1802 1803 stream << "\" />" << endl; 1804 //stream << " </Leaf>" << endl; 1749 1805 } 1750 1806 else … … 1757 1813 stream << "mergecost=\"" << viewCell->GetMergeCost() << "\" "; 1758 1814 stream << "pvs=\""; 1815 1816 if (0)// test with empty pvs 1817 for (it = viewCell->GetPvs().mEntries.begin(); it != it_end; ++ it) 1818 { 1819 stream << (*it).first->GetId() << " "; 1820 } 1821 1822 stream << "\" >" << endl; 1759 1823 1760 1824 ViewCellContainer::const_iterator it, it_end = interior->mChildren.end();
Note: See TracChangeset
for help on using the changeset viewer.