Changeset 997 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
- Timestamp:
- 05/31/06 10:04:05 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r971 r997 1661 1661 int pvsSize = 0; 1662 1662 1663 if (vc->IsLeaf())1664 {1665 pvsSize = vc->GetPvs().GetSize();1666 }1667 1668 1669 1663 Intersectable::NewMail(); 1670 1664 1671 1665 ////////////////////////// 1666 // for interiors, pvs can be stored using different methods 1667 1672 1668 switch (mViewCellsStorage) 1673 1669 { 1674 1670 case PVS_IN_LEAVES: //-- store pvs only in leaves 1675 1671 { 1672 // pvs is always stored directly in leaves 1673 if (vc->IsLeaf()) 1674 { 1675 pvsSize = vc->GetPvs().GetSize(); 1676 break; 1677 } 1678 1679 // the stored pvs size is the valid pvs size => just return scalar 1676 1680 if (vc->mPvsSizeValid) 1677 1681 { … … 1680 1684 } 1681 1685 1682 //-- if no valid pvs size stored as a scalar => compute new pvs size1686 //-- if no valid pvs size stored as a scalar => compute new pvs size 1683 1687 ViewCellContainer leaves; 1684 1688 CollectLeaves(vc, leaves); … … 1711 1715 { 1712 1716 //////////////////////// 1713 //-- compressed pvs1717 //-- compressed pvs 1714 1718 1715 1719 if (vc->mPvsSizeValid) 1720 { 1716 1721 return vc->mPvsSize; 1717 1718 // if no pvs size stored: compute 1719 int pvsSize = 0; 1720 ViewCell *root = vc; 1721 1722 // also add pvs from this view cell to root 1723 while (root->GetParent()) 1724 { 1725 root = root->GetParent(); 1726 pvsSize += CountDiffPvs(root); 1727 } 1728 1729 stack<ViewCell *> tstack; 1730 tstack.push(vc); 1731 1732 while (!tstack.empty()) 1733 { 1734 vc = tstack.top(); 1735 tstack.pop(); 1736 1737 pvsSize += CountDiffPvs(vc); 1738 1739 if (!vc->IsLeaf()) 1740 { 1741 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 1742 1743 ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 1744 1745 for (it = interior->mChildren.begin(); it != it_end; ++ it) 1722 } 1723 1724 // if no pvs size stored, compute new one 1725 int pvsSize = 0; 1726 ViewCell *root = vc; 1727 1728 // also add pvs from this view cell to root 1729 while (root->GetParent()) 1746 1730 { 1747 tstack.push(*it); 1748 } 1749 } 1750 } 1731 root = root->GetParent(); 1732 pvsSize += CountDiffPvs(root); 1733 } 1734 1735 stack<ViewCell *> tstack; 1736 tstack.push(vc); 1737 1738 while (!tstack.empty()) 1739 { 1740 vc = tstack.top(); 1741 tstack.pop(); 1742 1743 pvsSize += CountDiffPvs(vc); 1744 1745 if (!vc->IsLeaf()) 1746 { 1747 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 1748 1749 ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 1750 1751 for (it = interior->mChildren.begin(); it != it_end; ++ it) 1752 { 1753 tstack.push(*it); 1754 } 1755 } 1756 } 1751 1757 break; 1752 1758 } 1753 1759 case PVS_IN_INTERIORS: 1754 default:Debug << "in interiors: " << vc->mPvsSize << " $$ " << vc->GetPvs().GetSize() << endl; 1760 default: 1761 Debug << "in interiors: " << vc->mPvsSize << " $$ " << vc->GetPvs().GetSize() << endl; 1755 1762 pvsSize = vc->GetPvs().GetSize(); 1756 1763 }
Note: See TracChangeset
for help on using the changeset viewer.