Changeset 1900 for GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
- Timestamp:
- 12/15/06 23:40:27 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
r1891 r1900 365 365 366 366 RssTreeNode::RayInfo info(*ri); 367 367 if (!EpsilonEqualV3(info.GetOrigin(), info.GetTermination(), Limits::Small)) { 368 368 369 // first construct a leaf that will get subdivide 369 370 RssTreeLeaf *leaf = (RssTreeLeaf *) GetRoot(info.GetSourceObject()); 371 370 372 371 373 leaf->AddRay(info); … … 389 391 leaf->dirBBox.Include(dVec); 390 392 dirBBox.Include(dVec); 393 } 391 394 } 392 395 … … 1456 1459 if (stat.rayRefs > mMaxRays) { 1457 1460 Debug<<"Prunning rays..."<<endl<<flush; 1458 PruneRays( mMaxRays);1461 PruneRays(0.8f*mMaxRays); 1459 1462 Debug<<"done."<<endl<<flush; 1460 1463 // UpdateTreeStatistics(); 1461 1464 } 1462 1463 1465 } 1464 1466 … … 1553 1555 RssTree::AddRay(RssTreeNode::RayInfo &info) 1554 1556 { 1557 if (EpsilonEqualV3(info.GetOrigin(), info.GetTermination(), Limits::Small)) 1558 return; 1555 1559 1556 1560 stack<RayTraversalData> tstack; … … 1561 1565 RayTraversalData data; 1562 1566 1567 1563 1568 while (!tstack.empty()) { 1564 1569 data = tstack.top(); … … 1807 1812 RssTree::UpdateTreeStatistics() 1808 1813 { 1814 for (int i=0; i < mRoots.size(); i++) 1815 UpdateImportance(mRoots[i]); 1816 1817 #if 0 1809 1818 stack<RssTreeNode *> tstack; 1810 1819 … … 1819 1828 int leaves = 0; 1820 1829 1821 for (int i=0; i < mRoots.size(); i++)1822 UpdateImportance(mRoots[i]);1823 1830 1824 1831 PushRoots(tstack); 1825 1832 1826 1833 while (!tstack.empty()) { 1827 1834 RssTreeNode *node = tstack.top(); … … 1871 1878 stat.avgWeightedRayContribution = sumWeightedRayContribution/(float)sumRays; 1872 1879 stat.rayRefs = (int)sumRays; 1880 #endif 1873 1881 1874 1882 } … … 2822 2830 float c1 = weight*ray->mPvsContribution; 2823 2831 float c2 = weight*ray->mRelativePvsContribution; 2832 2824 2833 sumContributions += c1; 2825 2834 if (c1 > maxContribution) … … 2832 2841 sumRelContributions += c2; 2833 2842 if (c2 > maxRelContribution) 2834 2835 2843 maxRelContribution = c2; 2844 2836 2845 //sumWeights += weight; 2837 2846 sumWeights += 1.0f; … … 2864 2873 leaf->mImportance = 2865 2874 pow(((weightAbsContributions*sumContributions + 2866 (1.0f - weightAbsContributions)*sumRelContributions)/sumWeights), 3);2867 #else 2875 (1.0f - weightAbsContributions)*sumRelContributions)/sumWeights), 1.0f); 2876 #else 1 2868 2877 leaf->mImportance = 2869 2878 (weightAbsContributions*maxContribution +
Note: See TracChangeset
for help on using the changeset viewer.