- Timestamp:
- 02/17/06 20:41:22 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/default.env
r649 r650 331 331 missTolerance 6 332 332 333 maxViewCells 100 00334 333 maxViewCells 100 334 335 335 # used for pvs criterium 336 336 ct_div_ci 0.0 … … 354 354 BspTree { 355 355 Construction { 356 samples 50000 0356 samples 50000 357 357 epsilon 0.005 358 358 } … … 420 420 minProbability 0.00001 421 421 maxRayContribution 9999 422 maxViewCells 100 00422 maxViewCells 100 423 423 424 424 # used for pvs criterium -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r649 r650 249 249 250 250 251 void ViewCellInterior::SetupChildLink(ViewCell * l)252 { 253 mChildren.push_back( l);254 l->mParent = this;251 void ViewCellInterior::SetupChildLink(ViewCell *vc) 252 { 253 mChildren.push_back(vc); 254 vc->mParent = this; 255 255 } 256 256 … … 333 333 334 334 MergeCandidate::sRenderCostWeight = mRenderCostWeight; 335 336 mStats.open("mergeStats.log");337 335 } 338 336 … … 473 471 474 472 // frequency stats are updated 475 const int statsOut = 1;473 const int statsOut = 500; 476 474 477 475 // passes are needed for statistics, because we don't want to record … … 493 491 494 492 cout << "actual merge starts now ... " << endl; 495 496 mStats << "#Pass\n" << pass << endl497 << "#Merged\n" << mergeStats.merged << endl498 << "#ViewCells\n" << realNumActiveViewCells << endl499 << "#RenderCostIncrease\n" << 0 << endl500 << "#TotalRenderCost\n" << totalRenderCost << endl501 << "#CurrentPvs\n" << 0 << endl502 << "#ExpectedCost\n" << realExpectedCost << endl503 << "#AvgRenderCost\n" << realAvgRenderCost << endl504 << "#Deviation\n" << mDeviation << endl505 << "#TotalPvs\n" << totalPvs << endl506 << "#PvsSizeDecrease\n0" << endl507 << "#Volume\n0" << endl508 //<< "#Siblings\n" << mergeStats.siblings << endl509 << endl;510 493 511 494 //-- use priority queue to merge leaf pairs … … 604 587 mergedVc->SetCost(realExpectedCost); 605 588 606 if (((mergeStats.merged % statsOut) == 0) || 607 (realNumActiveViewCells == mMergeMinViewCells)) 608 { 589 if ((mergeStats.merged % statsOut) == 0) 609 590 cout << "merged " << mergeStats.merged << " view cells" << endl; 610 591 611 mStats612 << "#Pass\n" << pass << endl613 << "#Merged\n" << mergeStats.merged << endl614 << "#ViewCells\n" << realNumActiveViewCells << endl615 << "#RenderCostIncrease\n" << renderCostIncr << endl616 << "#TotalRenderCost\n" << totalRenderCost << endl617 << "#CurrentPvs\n" << mergedVc->GetPvs().GetSize() << endl618 << "#ExpectedCost\n" << realExpectedCost << endl619 << "#AvgRenderCost\n" << realAvgRenderCost << endl620 << "#Deviation\n" << mDeviation << endl621 << "#TotalPvs\n" << totalPvs << endl622 << "#PvsSizeDecrease\n" << -pvsDiff << endl623 << "#Volume\n" << mergedVc->GetVolume() << endl624 << endl;625 626 }627 592 } 628 593 else … … 663 628 // $$JB keep this 0 temporarilly 664 629 root->SetCost(0.0f); 665 666 mStats667 << "#Pass\n" << pass << endl668 << "#Merged\n" << mergeStats.merged << endl669 << "#ViewCells\n" << realNumActiveViewCells << endl670 << "#RenderCostIncrease\n" << 0 << endl // TODO671 << "#TotalRenderCost\n" << totalRenderCost << endl672 << "#CurrentPvs\n" << root->GetPvs().GetSize() << endl673 << "#ExpectedCost\n" << realExpectedCost << endl674 << "#AvgRenderCost\n" << realAvgRenderCost << endl675 << "#Deviation\n" << mDeviation << endl676 << "#TotalPvs\n" << totalPvs << endl677 << "#PvsSizeDecrease\n" << 0 << endl // TODO678 << "#Volume\n" << root->GetVolume() << endl679 << endl;680 630 681 631 mRoot = root; … … 705 655 mergeStats.mergeTime = TimeDiff(startTime, GetTime()); 706 656 mergeStats.Stop(); 707 708 657 Debug << mergeStats << endl << endl; 709 658 … … 1302 1251 1303 1252 1253 void ViewCellsTree::ExportStats() 1254 { 1255 TraversalQueue tqueue; 1256 1257 tqueue.push(mRoot); 1258 int numViewCells = 1; 1259 1260 const AxisAlignedBox3 box = mViewCellsManager->GetViewSpaceBox(); 1261 const float vol = box.GetVolume(); 1262 1263 int totalPvs; 1264 float totalRenderCost, float avgRenderCost, float expectedCost; 1265 1266 float deviation = 0; 1267 totalPvs = (int)mRoot->GetPvs().GetSize(); 1268 totalRenderCost = avgRenderCost = expectedCost = (float)mRoot->GetPvs().GetSize(); 1269 1270 ofstream stats; 1271 stats.open("mergeStats.log"); 1272 1273 Debug << "here343" << endl; 1274 1275 stats 1276 << "#Pass\n" << 0 << endl 1277 //<< "#Merged\n" << mergeStats.merged << endl 1278 << "#ViewCells\n" << numViewCells << endl 1279 << "#RenderCostDecrease\n" << 0 << endl // TODO 1280 << "#TotalRenderCost\n" << totalRenderCost << endl 1281 << "#CurrentPvs\n" << mRoot->GetPvs().GetSize() << endl 1282 << "#ExpectedCost\n" << expectedCost << endl 1283 << "#AvgRenderCost\n" << avgRenderCost << endl 1284 << "#Deviation\n" << deviation << endl 1285 << "#TotalPvs\n" << totalPvs << endl 1286 << "#PvsSizeDecrease\n" << 0 << endl // TODO 1287 << "#Volume\n" << mRoot->GetVolume() << endl 1288 << endl; 1289 1290 1291 while (!tqueue.empty()) 1292 { 1293 ViewCell *vc = tqueue.top(); 1294 tqueue.pop(); 1295 1296 if (!vc->IsLeaf()) 1297 { 1298 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 1299 1300 const int parentPvs = interior->GetPvs().GetSize(); 1301 const float parentCost = (float)parentPvs * interior->GetVolume(); 1302 float childCost = 0; 1303 int childPvs = 0; 1304 1305 -- numViewCells; 1306 1307 ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 1308 1309 for (it = interior->mChildren.begin(); it != it_end; ++ it) 1310 { 1311 childCost += (float)(*it)->GetPvs().GetSize() * (*it)->GetVolume(); 1312 childPvs += (*it)->GetPvs().GetSize(); 1313 1314 tqueue.push(*it); 1315 ++ numViewCells; 1316 } 1317 1318 1319 const float costDecr = (parentCost - childCost) / vol; 1320 1321 totalRenderCost -= costDecr; 1322 totalPvs += childPvs - parentPvs; 1323 1324 expectedCost = totalRenderCost / (float)numViewCells; 1325 avgRenderCost = (float)totalPvs / (float)numViewCells; 1326 1327 stats 1328 << "#Pass\n" << 0 << endl 1329 //<< "#Merged\n" << mergeStats.merged << endl 1330 << "#ViewCells\n" << numViewCells << endl 1331 << "#RenderCostDecrease\n" << costDecr << endl // TODO 1332 << "#TotalRenderCost\n" << totalRenderCost << endl 1333 << "#CurrentPvs\n" << vc->GetPvs().GetSize() << endl 1334 << "#ExpectedCost\n" << expectedCost << endl 1335 << "#AvgRenderCost\n" << avgRenderCost << endl 1336 << "#Deviation\n" << deviation << endl 1337 << "#TotalPvs\n" << totalPvs << endl 1338 << "#PvsSizeDecrease\n" << childPvs - parentPvs << endl // TODO 1339 << "#Volume\n" << vc->GetVolume() << endl 1340 << endl; 1341 1342 } 1343 } 1344 1345 stats.close(); 1346 } 1347 1348 1349 /*float ViewCellsTree::ComputeVolume(ViewCell *vc) 1350 { 1351 if (vc->IsLeaf()) 1352 { 1353 return vc->GetVolume(); 1354 } 1355 else 1356 { 1357 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 1358 1359 ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 1360 1361 float volume = 0; 1362 1363 for (it = interior->mChildren.begin(); it != it_end; ++ it) 1364 { 1365 volume += ComputeVolume(*it); 1366 } 1367 1368 interior->SetVolume(volume); 1369 return volume; 1370 } 1371 }*/ 1372 1373 1374 void ViewCellsTree::SetRoot(ViewCell *root) 1375 { 1376 mRoot = root; 1377 } 1378 1304 1379 void ViewCellsTree::CollectBestViewCellSet(ViewCellContainer &viewCells, 1305 1380 const int numViewCells) … … 1311 1386 { 1312 1387 ViewCell *vc = tqueue.top(); 1313 1388 tqueue.pop(); 1389 1314 1390 // save the view cells if it is a leaf or if enough view cells have already been traversed 1315 1391 // because of the priority queue, this will be the optimal set of v 1316 if (vc->IsLeaf() || ((viewCells.size() + tqueue.size() ) >= numViewCells))1392 if (vc->IsLeaf() || ((viewCells.size() + tqueue.size() + 1) >= numViewCells)) 1317 1393 { 1318 1394 // todo: should be done with a function taking the active flag and some … … 1333 1409 } 1334 1410 } 1335 1336 tqueue.pop();1337 1411 } 1338 1412 } … … 1411 1485 1412 1486 1413 void ViewCellsTree::ExportStats()1414 {1415 1416 }1417 1418 1487 void ViewCellsTree::GetPvs(ViewCell *vc, ObjectPvs &pvs) const 1419 1488 { … … 1562 1631 1563 1632 1564 void 1565 ViewCellsTree::AssignRandomColors() 1633 void ViewCellsTree::AssignRandomColors() 1566 1634 { 1567 1635 TraversalQueue tqueue; … … 1571 1639 { 1572 1640 ViewCell *vc = tqueue.top(); 1573 1641 tqueue.pop(); 1642 1574 1643 // save the view cells if it is a leaf or if enough view cells have already been traversed 1575 1644 // because of the priority queue, this will be the optimal set of v … … 1593 1662 1594 1663 } 1595 1596 tqueue.pop(); 1664 1597 1665 } 1598 1666 } … … 1606 1674 while (!tqueue.empty()) { 1607 1675 ViewCell *vc = tqueue.top(); 1608 1676 tqueue.pop(); 1609 1677 // save the view cells if it is a leaf or if enough view cells have already been traversed 1610 1678 // because of the priority queue, this will be the optimal set of v … … 1620 1688 1621 1689 } 1622 1623 tqueue.pop();1624 1690 } 1625 1691 } -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r649 r650 361 361 void ExportStats(); 362 362 363 /** Sets root of hierarchy. 364 */ 365 void SetRoot(ViewCell *root); 366 367 //float ComputeVolume(ViewCell *vc); 368 363 369 protected: 364 370 … … 480 486 /// maximal cost ratio for the merge 481 487 float mMergeMaxCostRatio; 482 483 ofstream mStats;484 488 485 489 typedef priority_queue<MergeCandidate> MergeQueue; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r649 r650 53 53 {} 54 54 55 55 56 BspNode::BspNode(BspInterior *parent): 56 57 mParent(parent), mTreeValid(true) … … 217 218 mUseAreaForPvs(false), 218 219 mGenerateViewCells(true), 219 mTimeStamp( 0)220 mTimeStamp(1) 220 221 { 221 222 Randomize(); // initialise random generator for heuristics … … 1182 1183 backData.mNode = interior->GetBack(); 1183 1184 1184 interior->mTimeStamp = leaf->mTimeStamp; 1185 frontData.mNode->mTimeStamp = mTimeStamp; 1186 backData.mNode->mTimeStamp = mTimeStamp ++; 1187 1188 Debug << "time stamp: " << mTimeStamp << endl; 1185 interior->mTimeStamp = mTimeStamp ++; 1186 1189 1187 //DEL_PTR(leaf); 1190 1188 return interior; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r649 r650 1142 1142 1143 1143 //-- merge view cells 1144 int merged;1145 1146 1144 cout << "starting post processing using " << mPostProcessSamples << " samples ... "; 1147 1145 long startTime = GetTime(); … … 1153 1151 { 1154 1152 Debug << "constructing visibility based merge tree" << endl; 1155 m erged = mViewCellsTree->ConstructMergeTree(rays, objects);1153 mViewCellsTree->ConstructMergeTree(rays, objects); 1156 1154 } 1157 1155 else … … 1159 1157 Debug << "constructing spatial merge tree" << endl; 1160 1158 // create spatial merge hierarchy 1161 merged = ConstructSpatialMergeTree(); 1162 } 1159 mViewCellsTree->SetRoot(ConstructSpatialMergeTree(mBspTree->GetRoot())); 1160 } 1161 1162 mViewCellsTree->ExportStats(); 1163 1163 1164 1164 //-- stats and visualizations 1165 1165 cout << "finished" << endl; 1166 cout << "merged " << merged << "view cells in "1166 cout << "merged view cells in " 1167 1167 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 1168 1168 1169 Debug << "Postprocessing: Merged " << merged << "view cells in "1169 Debug << "Postprocessing: Merged view cells in " 1170 1170 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl << endl; 1171 1171 … … 1240 1240 } 1241 1241 1242 return merged;1242 return 0; 1243 1243 } 1244 1244 … … 1682 1682 1683 1683 1684 int BspViewCellsManager::ConstructSpatialMergeTree() 1685 { 1686 TraversalQueue tQueue; 1687 1688 tQueue.push(TraversalData(mBspTree->GetRoot(), NULL)); 1689 1690 int merged = 0; 1691 1692 int numViewCells = (int)mViewCells.size(); 1693 1694 float var = 0; 1695 float dev = 0; 1696 int totalPvs = 0; 1697 float totalRenderCost = 0; 1698 float avgRenderCost = 0; 1699 float expCost = 0; 1700 1701 //-- compute statistics values of initial view cells 1702 EvaluateRenderStatistics(totalRenderCost, 1703 expCost, 1704 dev, 1705 var, 1706 totalPvs, 1707 avgRenderCost); 1708 1709 Debug/*mStats*/ << "#Pass\n" << 0 << endl 1710 << "#Merged\n" << merged << endl 1711 << "#ViewCells\n" << numViewCells << endl 1712 << "#RenderCostIncrease\n" << 0 << endl 1713 << "#TotalRenderCost\n" << totalRenderCost << endl 1714 << "#CurrentPvs\n" << 0 << endl 1715 << "#ExpectedCost\n" << expCost << endl 1716 << "#AvgRenderCost\n" << avgRenderCost << endl 1717 << "#Deviation\n" << dev << endl 1718 << "#TotalPvs\n" << totalPvs << endl 1719 << "#PvsSizeDecrease\n0" << endl 1720 << "#Volume\n0" << endl 1721 //<< "#Siblings\n" << mergeStats.siblings << endl 1722 << endl; 1723 1724 1725 while (!tQueue.empty()) 1726 { 1727 TraversalData tData = tQueue.top(); 1728 tQueue.pop(); 1729 1730 if (tData.mNode->IsLeaf()) 1731 { 1732 ViewCell *viewCell = dynamic_cast<BspLeaf *>(tData.mNode)->GetViewCell(); 1733 viewCell->SetMergeCost((float)tData.mNode->mTimeStamp); 1734 1735 Debug << "leaf time stamp: " << tData.mNode->mTimeStamp << endl; 1736 1737 if (tData.mParentViewCell) 1738 { 1739 tData.mParentViewCell->SetupChildLink(viewCell); 1740 // propagate up pvs: could be redone as propagepvs, which propagates pvs up and down 1741 mViewCellsTree->PropagateUpPvs(viewCell); 1742 } 1743 } 1744 else 1745 { 1746 BspInterior *interior = dynamic_cast<BspInterior *>(tData.mNode); 1747 ViewCellInterior *viewCellInterior = new ViewCellInterior(); 1748 1749 ++ merged; 1750 -- numViewCells; 1751 1752 avgRenderCost = totalPvs / numViewCells; 1753 1754 Debug//mStats 1755 << "#Pass\n" << 0 << endl 1756 << "#Merged\n" << merged << endl 1757 << "#ViewCells\n" << numViewCells << endl 1758 << "#RenderCostIncrease\n" << 0 << endl 1759 << "#TotalRenderCost\n" << totalRenderCost << endl 1760 << "#CurrentPvs\n" << 0 << endl 1761 << "#ExpectedCost\n" << 0 << endl 1762 << "#AvgRenderCost\n" << avgRenderCost << endl 1763 << "#Deviation\n" << dev << endl 1764 << "#TotalPvs\n" << totalPvs << endl 1765 << "#PvsSizeDecrease\n" << 0 << endl 1766 << "#Volume\n" << 0 << endl 1767 << endl; 1768 1769 Debug << "interior time stamp: " << tData.mNode->mTimeStamp << endl; 1770 1771 viewCellInterior->SetMergeCost((float)tData.mNode->mTimeStamp); 1772 1773 1774 tQueue.push(TraversalData(interior->GetBack(), viewCellInterior)); 1775 tQueue.push(TraversalData(interior->GetFront(), viewCellInterior)); 1776 1777 if (tData.mParentViewCell) 1778 tData.mParentViewCell->SetupChildLink(viewCellInterior); 1779 } 1780 } 1781 1782 return merged; 1783 } 1684 ViewCell *BspViewCellsManager::ConstructSpatialMergeTree(BspNode *root) 1685 { 1686 if (root->IsLeaf()) 1687 { 1688 ViewCell *viewCell = dynamic_cast<BspLeaf *>(root)->GetViewCell(); 1689 1690 viewCell->SetMergeCost(0.0f); 1691 1692 return viewCell; 1693 } 1694 1695 BspInterior *interior = dynamic_cast<BspInterior *>(root); 1696 ViewCellInterior *viewCellInterior = new ViewCellInterior(); 1697 1698 float mergeCost = 1.0f / (float)root->mTimeStamp; 1699 //Debug << "timestamp: " << root->mTimeStamp; 1700 //Debug << "merge cost: " << mergeCost << endl; 1701 1702 viewCellInterior->SetMergeCost(mergeCost); 1703 1704 float volume = 0; 1705 1706 BspNode *front = interior->GetFront(); 1707 BspNode *back = interior->GetBack(); 1708 1709 // recursivly compute child hierarchies 1710 ViewCell *backVc = ConstructSpatialMergeTree(back); 1711 ViewCell *frontVc = ConstructSpatialMergeTree(front); 1712 1713 viewCellInterior->SetupChildLink(frontVc); 1714 viewCellInterior->SetupChildLink(backVc); 1715 1716 1717 viewCellInterior->GetPvs().Merge(backVc->GetPvs()); 1718 viewCellInterior->GetPvs().Merge(frontVc->GetPvs()); 1719 1720 volume += backVc->GetVolume(); 1721 volume += frontVc->GetVolume(); 1722 1723 viewCellInterior->SetVolume(volume); 1724 1725 return viewCellInterior; 1726 } 1727 1784 1728 1785 1729 /************************************************************************/ … … 2635 2579 Debug << ss << endl; 2636 2580 2637 //-- merge or subdivide view cells 2638 int merged = 0; 2581 //-- merge view cells 2582 2583 cout << "starting merge using " << mPostProcessSamples << " samples ... " << endl; 2584 long startTime = GetTime(); 2585 2586 2639 2587 if (mMergeViewCells) 2640 2588 { 2641 cout << "starting merge using " << mPostProcessSamples << " samples ... " << endl; 2642 long startTime = GetTime(); 2643 2644 2589 Debug << "merging view cells" << endl; 2645 2590 // TODO: should be done BEFORE the ray casting 2646 merged = mViewCellsTree->ConstructMergeTree(rays, objects); 2647 2648 //-- stats and visualizations 2649 cout << "finished merging" << endl; 2650 cout << "merged " << merged << " view cells in " 2651 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 2652 2653 Debug << "Postprocessing: Merged " << merged << " view cells in " 2654 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl << endl; 2655 } 2591 mViewCellsTree->ConstructMergeTree(rays, objects); 2592 } 2593 else 2594 { 2595 Debug << "spatial merge" << endl; 2596 mViewCellsTree->SetRoot(ConstructSpatialMergeTree(mVspBspTree->GetRoot())); 2597 } 2598 2599 mViewCellsTree->ExportStats(); 2600 2601 //-- stats and visualizations 2602 cout << "finished merging" << endl; 2603 cout << "merged view cells in " 2604 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 2605 2606 Debug << "Postprocessing: Merged view cells in " 2607 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl << endl; 2608 2656 2609 2657 2610 int savedColorCode = mColorCode; … … 2908 2861 2909 2862 2910 int VspBspViewCellsManager::ConstructSpatialMergeTree() 2911 { 2912 TraversalQueue tQueue; 2913 tQueue.push(TraversalData(mVspBspTree->GetRoot(), NULL)); 2914 2915 int merged = 0; 2916 2917 while (!tQueue.empty()) 2918 { 2919 TraversalData tData = tQueue.top(); 2920 tQueue.pop(); 2921 2922 if (tData.mNode->IsLeaf()) 2923 { 2924 ViewCell *viewCell = dynamic_cast<BspLeaf *>(tData.mNode)->GetViewCell(); 2925 2926 if (tData.mParentViewCell) 2927 { 2928 tData.mParentViewCell->SetupChildLink(viewCell); 2929 // probagate up pvs 2930 mViewCellsTree->PropagateUpPvs(viewCell); 2931 } 2932 } 2933 else 2934 { 2935 BspInterior *interior = dynamic_cast<BspInterior *>(tData.mNode); 2936 ViewCellInterior *viewCellInterior = new ViewCellInterior(); 2937 ++ merged; 2938 2939 tQueue.push(TraversalData(interior->GetBack(), viewCellInterior)); 2940 tQueue.push(TraversalData(interior->GetFront(), viewCellInterior)); 2941 2942 if (tData.mParentViewCell) 2943 tData.mParentViewCell->SetupChildLink(viewCellInterior); 2944 } 2945 } 2946 return merged; 2863 ViewCell *VspBspViewCellsManager::ConstructSpatialMergeTree(BspNode *root) 2864 { 2865 if (root->IsLeaf()) 2866 { 2867 ViewCell *viewCell = dynamic_cast<BspLeaf *>(root)->GetViewCell(); 2868 2869 viewCell->SetMergeCost(0.0f); 2870 2871 return viewCell; 2872 } 2873 2874 BspInterior *interior = dynamic_cast<BspInterior *>(root); 2875 ViewCellInterior *viewCellInterior = new ViewCellInterior(); 2876 2877 float mergeCost = 1.0f / (float)root->mTimeStamp; 2878 //Debug << "timestamp: " << root->mTimeStamp; 2879 //Debug << "merge cost: " << mergeCost << endl; 2880 2881 viewCellInterior->SetMergeCost(mergeCost); 2882 2883 float volume = 0; 2884 2885 BspNode *front = interior->GetFront(); 2886 BspNode *back = interior->GetBack(); 2887 2888 // recursivly compute child hierarchies 2889 ViewCell *backVc = ConstructSpatialMergeTree(back); 2890 ViewCell *frontVc = ConstructSpatialMergeTree(front); 2891 2892 viewCellInterior->SetupChildLink(frontVc); 2893 viewCellInterior->SetupChildLink(backVc); 2894 2895 2896 viewCellInterior->GetPvs().Merge(backVc->GetPvs()); 2897 viewCellInterior->GetPvs().Merge(frontVc->GetPvs()); 2898 2899 volume += backVc->GetVolume(); 2900 volume += frontVc->GetVolume(); 2901 2902 viewCellInterior->SetVolume(volume); 2903 2904 return viewCellInterior; 2947 2905 } 2948 2906 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r649 r650 352 352 void CollectViewCells(const int n); 353 353 354 355 virtual int ConstructSpatialMergeTree() { return 0;};356 357 354 virtual bool EqualToSpatialNode(ViewCell *viewCell) const { return false;} 358 355 … … 529 526 bool ExportViewCells(const string filename); 530 527 531 int ConstructSpatialMergeTree();528 ViewCell *ConstructSpatialMergeTree(BspNode *root); 532 529 533 530 … … 815 812 void PrepareLoadedViewCells(); 816 813 817 int ConstructSpatialMergeTree();814 ViewCell *ConstructSpatialMergeTree(BspNode *root); 818 815 819 816 /// the view space partition BSP tree. -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r648 r650 71 71 mRenderCostWeight(0.5), 72 72 mUseRandomAxis(false), 73 mTimeStamp( 0)73 mTimeStamp(1) 74 74 { 75 75 bool randomize = false; … … 575 575 << "#RenderCostDecrease\n" << -costDecr << endl 576 576 << "#TotalRenderCost\n" << mTotalCost << endl 577 << "#AvgRenderCost\n" << mTotalPvsSize /mBspStats.Leaves() << endl;577 << "#AvgRenderCost\n" << (float)mTotalPvsSize / (float)mBspStats.Leaves() << endl; 578 578 } 579 579 … … 766 766 backData.mNode = interior->GetBack(); 767 767 768 frontData.mNode->mTimeStamp = mTimeStamp; 769 backData.mNode->mTimeStamp = mTimeStamp ++; 768 interior->mTimeStamp = mTimeStamp ++; 769 //frontData.mNode->mTimeStamp = ++ mTimeStamp; 770 //backData.mNode->mTimeStamp = mTimeStamp; 770 771 771 772 //DEL_PTR(leaf); … … 2966 2967 // the same leaves must not be part of two merge candidates 2967 2968 leaf->Mail(); 2969 2968 2970 vector<BspLeaf *> neighbors; 2969 FindNeighbors(leaf, neighbors, true); 2970 //FindApproximateNeighbors(leaf, neighbors, true); 2971 if (0) 2972 FindNeighbors(leaf, neighbors, true); 2973 else 2974 FindApproximateNeighbors(leaf, neighbors, true); 2971 2975 vector<BspLeaf *>::const_iterator nit, nit_end = neighbors.end(); 2972 2976
Note: See TracChangeset
for help on using the changeset viewer.