- Timestamp:
- 10/18/05 17:45:36 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Pvs.h
r312 r341 36 36 int Compress() {return 0;} 37 37 int GetSize() {return (int)mEntries.size();} 38 bool Empty() {return mEntries.size() == 0;} 39 void Merge(const Pvs<T> &a); 38 40 39 41 PvsData<T> *Find(T sample); … … 46 48 }; 47 49 50 template <typename T> 51 void Pvs<T>::Merge(const Pvs<T> &a) 52 { 53 std::map<T, PvsData<T>, LtSample<T> >::iterator it, it_end = mEntries.end(); 54 55 for (it = mEntries.begin(); it != mEntries.end(); ++ it) 56 { 57 // TODO 58 } 59 } 48 60 49 61 template <typename T> -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r340 r341 57 57 58 58 ObjectContainer objects; 59 59 int prunedCells = 0; 60 60 switch (BspTree::sConstructionMethod) 61 61 { … … 69 69 mSceneGraph->CollectObjects(&objects); 70 70 mBspTree->Construct(objects); 71 Debug << "collecting view cells" << endl;71 72 72 mBspTree->CollectViewCells(mViewCells); 73 73 break; … … 76 76 mBspTree->SetGenerateViewCells(true); 77 77 mBspTree->Construct(mSampleRays); 78 Debug << "collecting view cells" << endl; 78 // prunedCells = mBspTree->MergeViewCells(); 79 79 80 mBspTree->CollectViewCells(mViewCells); 81 82 // Debug << "Collected " << (int)mViewCells.size() << " cells (" << prunedCells << " pruned)" << endl; 80 83 break; 81 84 default: -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r339 r341 1579 1579 } 1580 1580 } 1581 1581 /* 1582 1582 int BspTree::MergeViewCells() 1583 1583 { 1584 int prunedCells = 0; 1585 1584 1586 stack<BspNode *> nodeStack; 1587 stack<BspLeaf *> leafStack; 1588 1585 1589 nodeStack.push(mRoot); 1586 1590 1587 1591 ViewCell::NewMail(); 1588 1592 1593 // collect leaves 1589 1594 while (!nodeStack.empty()) 1590 1595 { 1591 1596 BspNode *node = nodeStack.top(); 1597 1592 1598 nodeStack.pop(); 1593 1599 1594 if (node->IsLeaf()) 1595 { 1596 } 1597 else 1598 { 1599 BspInterior *interior = dynamic_cast<BspInterior *>(node); 1600 1601 nodeStack.push(interior->mFront); 1602 nodeStack.push(interior->mBack); 1603 } 1604 } 1600 if (node->IsLeaf()) 1601 { 1602 //if (!leafStack.empty() && leafStack.top()->mParent() == node->mParent) 1603 leafStack.push(dynamic_cast<BspLeaf *>(node)); 1604 1605 } 1606 else 1607 { 1608 nodeStack.push_back(node->mFront); 1609 nodeStack.push_back(node->mFront); 1610 } 1611 1612 while (!leafStack.empty()) 1613 { 1614 BspLeaf *leaf = leafStack.top(); 1615 leafStack.pop(); 1616 } 1617 1618 1605 1619 return 0; 1606 } 1607 1620 }*/ 1621 /* 1622 BspLeaf *BspTree::MergeNodes(BspInterior *interior) 1623 { 1624 BspNode *frontLeaf = MergeNodes(interior->mFront); 1625 BspNode *backLeaf = MergeNodes(interior->mBack); 1626 1627 if (frontLeaf->IsLeaf() && backLeaf->IsLeaf()) 1628 { 1629 if (!MergeNecessary(frontLeaf, backLeaf)) 1630 return interior; 1631 1632 DEL_PTR(frontLeaf->mViewCell); 1633 DEL_PTR(interior->mFront); 1634 1635 DEL_PTR(backLeaf->mViewCell); 1636 DEL_PTR(interior->mBack); 1637 1638 BspLeaf *leaf = new BspLeaf(viewCell); 1639 1640 // replace a link from node's parent 1641 if (!interior->IsRoot()) 1642 { 1643 parent->ReplaceChildLink(interior, leaf); 1644 interior->SetParent(parent); 1645 } 1646 else // new root 1647 { 1648 mRoot = leaf; 1649 } 1650 1651 return leaf; 1652 } 1653 1654 return interior; 1655 } 1656 */ 1608 1657 void BspTree::SetGenerateViewCells(int generateViewCells) 1609 1658 { -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r338 r341 348 348 int CastRay(Ray &ray); 349 349 350 /** Merges view cells based on some criteria (e.g., empty view cells or 351 view cells which have a very similar PVS can be merged to one larger 352 view cell farther up in the BSP tree. 350 /** Merges view cells based on some criteria 351 E.g., empty view cells can pe purged, view cells which have 352 a very similar PVS can be merged to one larger view cell farther up 353 in the BSP tree. 353 354 @returns the number of merged view cells 354 355 */ 355 int MergeViewCells();356 //int MergeViewCells(); 356 357 357 358 /** Set to true if new view cells shall be generated in each leaf.
Note: See TracChangeset
for help on using the changeset viewer.