- Timestamp:
- 01/01/06 06:25:55 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r486 r487 21 21 mTotalArea(0.0f) 22 22 { 23 mSceneBox.Initialize(); 23 24 ParseEnvironment(); 24 25 } … … 30 31 mVisualizationSamples(0) 31 32 { 33 mSceneBox.Initialize(); 32 34 ParseEnvironment(); 33 35 } … … 81 83 82 84 85 bool ViewCellsManager::GetViewPoint(Vector3 &viewPoint) const 86 { 87 viewPoint = mSceneBox.GetRandomPoint(); 88 89 return true; 90 } 91 92 83 93 void ViewCellsManager::ComputeSampleContributions(const VssRayContainer &rays) 84 94 { … … 88 98 89 99 VssRayContainer::const_iterator it, it_end = rays.end(); 90 int i = 0; 100 91 101 for (it = rays.begin(); it != it_end; ++ it) 92 { Debug << "here " << i ++ << endl;102 { 93 103 ComputeSampleContributions(*(*it)); 94 Debug << "**" << endl;95 104 } 96 105 } … … 104 113 105 114 for (it = mViewCells.begin(); it != it_end; ++ it) 115 { 106 116 (*it)->UpdateViewCellsStats(mViewCellsStats); 117 } 107 118 } 108 119 … … 295 306 296 307 308 void ViewCellsManager::SetViewSpaceBox(const AxisAlignedBox3 &box) 309 { 310 mSceneBox = box; 311 } 312 313 297 314 void ViewCellsManager::ResetViewCells() 298 315 { … … 432 449 433 450 int BspViewCellsManager::Construct(const ObjectContainer &objects, 434 const VssRayContainer &rays, 435 AxisAlignedBox3 *sceneBbox) 451 const VssRayContainer &rays) 436 452 { 437 453 // if view cells were already constructed … … 1024 1040 1025 1041 int KdViewCellsManager::Construct(const ObjectContainer &objects, 1026 const VssRayContainer &rays, 1027 AxisAlignedBox3 *sceneBbox) 1042 const VssRayContainer &rays) 1028 1043 { 1029 1044 // if view cells already constructed … … 1309 1324 1310 1325 int VspKdViewCellsManager::Construct(const ObjectContainer &objects, 1311 const VssRayContainer &rays, 1312 AxisAlignedBox3 *sceneBbox) 1326 const VssRayContainer &rays) 1313 1327 { 1314 1328 // if view cells already constructed … … 1327 1341 << (int)constructionRays.size() << " samples" << endl; 1328 1342 1329 mVspKdTree->Construct(constructionRays, sceneBbox);1343 mVspKdTree->Construct(constructionRays, &mSceneBox); 1330 1344 Debug << mVspKdTree->GetStatistics() << endl; 1331 1345 … … 1684 1698 1685 1699 int VspBspViewCellsManager::Construct(const ObjectContainer &objects, 1686 const VssRayContainer &rays, 1687 AxisAlignedBox3 *sceneBbox) 1700 const VssRayContainer &rays) 1688 1701 { 1689 1702 // if view cells were already constructed … … 1697 1710 1698 1711 GetRaySets(rays, mConstructionSamples, constructionRays, &savedRays); 1699 1712 1700 1713 Debug << "construction rays: " << (int)savedRays.size() << endl; 1701 1714 Debug << "saved rays: " << (int)constructionRays.size() << endl; 1702 1715 1703 mVspBspTree->Construct(constructionRays, sceneBbox); 1716 mVspBspTree->Construct(constructionRays, &mSceneBox); 1717 1704 1718 Debug << mVspBspTree->GetStatistics() << endl; 1705 1706 1719 ResetViewCells(); 1707 1720 … … 1932 1945 1933 1946 1947 bool VspBspViewCellsManager::GetViewPoint(Vector3 &viewPoint) const 1948 { 1949 if (!ViewCellsConstructed()) 1950 return ViewCellsManager::GetViewPoint(viewPoint); 1951 1952 const int limit = 10; 1953 1954 for (int i = 0; i < limit; ++ i) 1955 { 1956 viewPoint = mSceneBox.GetRandomPoint(); 1957 if (mVspBspTree->ViewPointValid(viewPoint)) 1958 return true; 1959 } 1960 1961 return false; 1962 } 1963 1934 1964 void VspBspViewCellsManager::ExportSplits(const ObjectContainer &objects, 1935 1965 const VssRayContainer &rays)
Note: See TracChangeset
for help on using the changeset viewer.