Changeset 1745 for GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
- Timestamp:
- 11/13/06 23:41:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1744 r1745 737 737 738 738 if (sc->IsDirty()) 739 c out << "*******************************error!" << endl;739 cerr << "Error: Should never come here!" << endl; 740 740 741 741 if (!success) // split was not taken 742 742 { 743 cout << "x";744 743 return false; 745 744 } … … 988 987 if ((steps >= maxSteps) || ((priority < threshold) && !(steps < minSteps))) 989 988 { 990 cout << "\n**************** breaking on " << priority 991 << " smaller than " << threshold << endl; 989 cout << "\nbreaking on " << priority << " smaller than " << threshold << endl; 992 990 break; 993 991 } … … 1831 1829 1832 1830 1831 void HierarchyManager::ComputePvs(const ObjectPvs &pvs, float &rc, int &pvsEntries) 1832 { 1833 BvhNode::NewMail(); 1834 1835 ObjectPvsIterator pit = pvs.GetIterator(); 1836 1837 while (pit.HasMoreEntries()) 1838 { 1839 ObjectPvsEntry entry = pit.Next(); 1840 1841 BvhIntersectable *intersect = dynamic_cast<BvhIntersectable *>(entry.mObject); 1842 1843 BvhLeaf *leaf = intersect->GetItem(); 1844 BvhNode *activeNode = leaf->GetActiveNode(); 1845 1846 if (!activeNode->Mailed()) 1847 { 1848 activeNode->Mail(); 1849 1850 ObjectContainer objects; 1851 activeNode->CollectObjects(objects); 1852 1853 ++ pvsEntries; 1854 rc += mBvHierarchy->EvalAbsCost(objects); 1855 //cout << " pvs: " << mBvHierarchy->EvalAbsCost(leaf->mObjects); 1856 } 1857 } 1858 } 1859 1860 1833 1861 int HierarchyManager::ExtractStatistics(const int maxSplits, 1834 1862 const float maxMemoryCost, … … 1837 1865 int &pvsEntries, 1838 1866 int &viewSpaceSplits, 1839 int &objectSpaceSplits) 1867 int &objectSpaceSplits, 1868 const bool useFilter) 1840 1869 { 1841 1870 ViewCellContainer viewCells; … … 1858 1887 renderCost = 0.0f; 1859 1888 1860 //BvhNode::NewMail();1861 //int dummy = 0;1862 1889 for (vit = viewCells.begin(); vit != vit_end; ++ vit) 1863 1890 { 1864 1891 float rc = 0; 1865 1892 ViewCell *vc = *vit; 1893 1866 1894 ObjectPvs pvs; 1867 1895 mVspTree->mViewCellsTree->GetPvs(vc, pvs); 1868 //dummy+=pvs.GetSize(); 1869 BvhNode::NewMail(); 1870 1871 // hack: should not be done here 1872 ObjectPvsIterator pit = pvs.GetIterator(); 1873 1874 while (pit.HasMoreEntries()) 1875 { 1876 ObjectPvsEntry entry = pit.Next(); 1877 1878 BvhIntersectable *intersect = dynamic_cast<BvhIntersectable *>(entry.mObject); 1879 1880 BvhLeaf *leaf = intersect->GetItem(); 1881 BvhNode *activeNode = leaf->GetActiveNode(); 1882 1883 if (!activeNode->Mailed()) 1884 { 1885 activeNode->Mail(); 1886 1887 ObjectContainer objects; 1888 activeNode->CollectObjects(objects); 1889 1890 ++ pvsEntries; 1891 rc += mBvHierarchy->EvalAbsCost(objects); 1892 //cout << " pvs: " << mBvHierarchy->EvalAbsCost(leaf->mObjects); 1893 } 1894 } 1896 1897 if (useFilter) 1898 { 1899 ObjectPvs filteredPvs; 1900 mVspTree->mViewCellsManager->ApplyFilter2(vc, false, 1.0f, filteredPvs); 1901 ComputePvs(filteredPvs, rc, pvsEntries); 1902 } 1903 else 1904 { 1905 ComputePvs(pvs, rc, pvsEntries); 1906 } 1895 1907 1896 1908 rc *= vc->GetVolume(); … … 2082 2094 2083 2095 void HierarchyManager::EvaluateSubdivision2(ofstream &splitsStats, 2084 const int splitsStepSize) 2096 const int splitsStepSize, 2097 const bool useFilter) 2085 2098 { 2086 2099 HierarchySubdivisionStats subStats; … … 2096 2109 subStats.mEntriesInPvs, 2097 2110 subStats.mViewSpaceSplits, 2098 subStats.mObjectSpaceSplits); 2111 subStats.mObjectSpaceSplits, 2112 useFilter); 2099 2113 2100 2114 … … 2123 2137 cout << subStats.mNumSplits << " "; 2124 2138 } 2139 2125 2140 cout << endl; 2126 2141 }
Note: See TracChangeset
for help on using the changeset viewer.