Changeset 1842 for GTP/trunk/Lib/Vis
- Timestamp:
- 12/03/06 20:55:53 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1841 r1842 667 667 { 668 668 cout << "bvh local termination criteria met:" << endl; 669 cout << "objects: " << tData.mNode->mObjects.size() << " " << mTermMinObjects << endl;669 cout << "objects: " << (int)tData.mNode->mObjects.size() << " " << mTermMinObjects << endl; 670 670 } 671 671 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1830 r1842 1780 1780 1781 1781 1782 void HierarchyManager::ComputePvs(const ObjectPvs &pvs, float &rc, int &pvsEntries) 1782 void HierarchyManager::ComputePvs(const ObjectPvs &pvs, 1783 float &rc, 1784 int &pvsEntries) 1783 1785 { 1784 1786 BvhNode::NewMail(); … … 1788 1790 while (pit.HasMoreEntries()) 1789 1791 { 1790 ObjectPvsEntry entry = pit.Next(); 1791 1792 const ObjectPvsEntry &entry = pit.Next(); 1793 1794 if (entry.mObject->Type() != Intersectable::BVH_INTERSECTABLE) 1795 cout << "error " << entry.mObject->Type() << endl; 1796 1797 BvhNode *intersect = dynamic_cast<BvhNode *>(entry.mObject); 1792 1798 BvhNode *activeNode; 1793 BvhNode *intersect = dynamic_cast<BvhNode *>(entry.mObject);1794 1799 1795 1800 // hack for choosing which node to account for 1796 1801 if (intersect->IsLeaf()) 1797 1802 { 1798 activeNode = dynamic_cast<BvhLeaf *>(intersect)->GetActiveNode(); 1803 activeNode = 1804 dynamic_cast<BvhLeaf *>(intersect)->GetActiveNode(); 1799 1805 } 1800 1806 else -
GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.h
r1500 r1842 69 69 friend SimpleRay GetPlaneIntersection(const Plane3 &plane1, const Plane3 &plane2); 70 70 71 friend ostream &operator<<(ostream &s, const Plane3 p) {71 friend ostream &operator<<(ostream &s, const Plane3 &p) { 72 72 s<<p.mNormal<<" "<<p.mD; 73 73 return s; -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r1790 r1842 868 868 869 869 870 //////////// 871 //-- typedefs 872 873 typedef PvsEntry<Intersectable *, PvsData> ObjectPvsEntry; 874 typedef std::vector<ObjectPvsEntry> ObjectPvsEntries; 875 typedef Pvs<ViewCell *, MailablePvsData> ViewCellPvs; 876 typedef PvsIterator<Intersectable *, PvsData> ObjectPvsIterator; 877 878 870 879 class ObjectPvs: public Pvs<Intersectable *, PvsData> 871 880 { … … 876 885 */ 877 886 float EvalPvsCost() const; 887 888 friend ostream &operator<<(ostream &s, const ObjectPvs &p) 889 { 890 ObjectPvsIterator pit = p.GetIterator(); 891 892 while (pit.HasMoreEntries()) 893 { 894 const ObjectPvsEntry &entry = pit.Next(); 895 Intersectable *obj = entry.mObject; 896 897 cout << (int)obj << " "; 898 } 899 900 return s; 901 } 902 878 903 }; 879 904 880 905 881 //////////// 882 //-- typedefs 883 884 typedef PvsEntry<Intersectable *, PvsData> ObjectPvsEntry; 885 typedef std::vector<ObjectPvsEntry> ObjectPvsEntries; 886 typedef Pvs<ViewCell *, MailablePvsData> ViewCellPvs; 887 typedef PvsIterator<Intersectable *, PvsData> ObjectPvsIterator; 906 888 907 } 889 908 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtPreprocessorThread.h
r1613 r1842 2 2 #define __QT_PREPROCESSOR_THREAD_H 3 3 4 4 #ifndef NO_QT 5 5 #include <QThread> 6 6 #include "PreprocessorThread.h" … … 29 29 30 30 } 31 32 31 #endif 32 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r1841 r1842 21 21 Optimization="0" 22 22 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost" 23 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE "23 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NO_QT" 24 24 MinimalRebuild="TRUE" 25 25 BasicRuntimeChecks="3" … … 35 35 Name="VCLinkerTool" 36 36 AdditionalDependencies="xerces-c_2D.lib zdll.lib zziplibd.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib glew32.lib" 37 OutputFile="$(OutDir)/Preprocessor.exe 2"37 OutputFile="$(OutDir)/Preprocessor.exe" 38 38 LinkIncremental="2" 39 39 AdditionalLibraryDirectories="..\include;..\src\GL;"..\lib\$(ConfigurationName)";..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib" … … 79 79 OptimizeForWindowsApplication="TRUE" 80 80 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\MultiLevelRayTracing" 81 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE "81 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NO_QT" 82 82 RuntimeLibrary="2" 83 83 RuntimeTypeInfo="TRUE" -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r1789 r1842 1488 1488 } 1489 1489 1490 /*cout << "***************\nbefore pulling up:\n"; 1491 for (it = interior->mChildren.begin(); it != it_end; ++ it) 1492 { 1493 cout << "vc:\n" << (*it)->GetPvs() << endl; 1494 }*/ 1495 1490 1496 // compress root node 1491 1497 PullUpVisibility(interior); 1498 1499 /*cout << "after pulling up:\n"; 1500 cout << "interior:\n" << interior->GetPvs() << endl; 1501 1502 for (it = interior->mChildren.begin(); it != it_end; ++ it) 1503 { 1504 cout << "vc:\n" << (*it)->GetPvs() << endl; 1505 }*/ 1492 1506 } 1493 1507 } … … 1650 1664 void ViewCellsTree::PullUpVisibility(ViewCellInterior *interior) 1651 1665 { 1652 Intersectable::NewMail((int)interior->mChildren.size()); 1666 const int mail = (int)interior->mChildren.size(); 1667 Intersectable::NewMail(mail); 1653 1668 1654 1669 ViewCellContainer::const_iterator cit, cit_end = interior->mChildren.end(); 1655 1670 1656 1671 // mail all objects in the leaf sets 1657 1672 // we are interested in the objects which are present in all leaves 1658 1673 // => count how often an object is part of a child set … … 1660 1675 { 1661 1676 ViewCell *vc = *cit; 1662 1663 1677 ObjectPvsIterator pit = vc->GetPvs().GetIterator(); 1664 1678 1665 1679 while (pit.HasMoreEntries()) 1666 1680 { 1667 ObjectPvsEntryentry = pit.Next();1681 const ObjectPvsEntry &entry = pit.Next(); 1668 1682 Intersectable *obj = entry.mObject; 1669 1670 if ((cit == interior->mChildren.begin()) && !obj->Mailed()) 1671 { 1672 obj->Mail(); 1673 } 1674 1675 int incm = obj->IncMail(); 1676 } 1677 } 1678 1679 interior->GetPvs().Clear(); 1683 obj->Mail(); 1684 } 1685 } 1686 1687 for (cit = interior->mChildren.begin(); cit != cit_end; ++ cit) 1688 { 1689 ViewCell *vc = *cit; 1690 1691 ObjectPvsIterator pit = vc->GetPvs().GetIterator(); 1692 1693 while (pit.HasMoreEntries()) 1694 { 1695 const ObjectPvsEntry &entry = pit.Next(); 1696 Intersectable *obj = entry.mObject; 1697 1698 obj->IncMail(); 1699 } 1700 } 1701 1702 // reset pvs 1703 interior->GetPvs().Clear(false); 1680 1704 1681 1705 // only the objects which are present in all leaf pvs … … 1692 1716 ObjectPvsEntry entry = pit.Next(); 1693 1717 1694 if (entry.mObject->Mailed( (int)interior->mChildren.size()))1718 if (entry.mObject->Mailed(mail)) 1695 1719 { 1696 1720 interior->GetPvs().AddSample(entry.mObject, entry.mData.mSumPdf); … … 1699 1723 } 1700 1724 1701 // delete all the objects from the leaf sets which were moved to parent pvs 1702 ObjectPvsIterator pit = interior->GetPvs().GetIterator(); 1703 1704 while (pit.HasMoreEntries()) 1705 { 1706 ObjectPvsEntry entry = pit.Next(); 1707 1708 for (cit = interior->mChildren.begin(); cit != cit_end; ++ cit) 1709 { 1710 if (!(*cit)->GetPvs().RemoveSample(entry.mObject, Limits::Infinity)) 1725 // delete entries which are pulled up 1726 // note: could be inefficent, rather gather unmailed pvs and reassign 1727 for (cit = interior->mChildren.begin(); cit != cit_end; ++ cit) 1728 { 1729 ViewCell *vc = *cit; 1730 ObjectPvsIterator pit = vc->GetPvs().GetIterator(); 1731 1732 ObjectPvs newPvs; 1733 1734 while (pit.HasMoreEntries()) 1735 { 1736 const ObjectPvsEntry &entry = pit.Next(); 1737 Intersectable *obj = entry.mObject; 1738 1739 /*if (obj->Mailed(mail)) 1711 1740 { 1712 Debug << "should not come here!" << endl; 1741 vc->GetPvs().RemoveSample(entry.mObject, Limits::Infinity)) 1742 }*/ 1743 if (!obj->Mailed(mail)) 1744 { 1745 newPvs.AddSampleDirty(obj, entry.mData.mSumPdf); 1713 1746 } 1714 1747 } 1748 1749 vc->SetPvs(newPvs); 1715 1750 } 1716 1751 } … … 2465 2500 2466 2501 2502 2467 2503 /**************************************************************************/ 2468 2504 /* MergeCandidate implementation */ -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r1771 r1842 228 228 */ 229 229 bool AddPvsSample(Intersectable *sample, const float pdf, float &contribution); 230 231 /// Rays piercing this view cell.232 //RayContainer mPiercingRays;233 230 234 231 /** if this is a view cell correspending to a leaf in a hierarchy. … … 705 702 const ViewCellsTreeStats &vcStats); 706 703 704 707 705 708 706 ////////////////////////////////////// … … 721 719 /// if merged view cells are refined. 722 720 bool mRefineViewCells; 723 /// weights between variance and render cost increase (must be between zero and one)721 /// weights between variance and render cost increase in the range [0 .. 1]. 724 722 float mRenderCostWeight; 725 723 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1841 r1842 32 32 33 33 // $$JB HACK 34 #define USE_KD_PVS 134 #define USE_KD_PVS 0 35 35 36 36 #define KD_PVS_AREA (1e-5f) … … 4588 4588 { 4589 4589 int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 4590 4591 cout << "number of entries before compress: " << pvsEntries << endl; 4590 4592 Debug << "number of entries before compress: " << pvsEntries << endl; 4591 4593 … … 4593 4595 4594 4596 pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 4597 4595 4598 Debug << "number of entries after compress: " << pvsEntries << endl; 4599 cout << "number of entries after compress: " << pvsEntries << endl; 4596 4600 } 4597 4601 … … 5432 5436 if (!ViewCellsConstructed()) 5433 5437 { 5434 Debug << "post process error: no view cells constructed" << endl;5438 Debug << "post process error: no view cells constructed" << endl; 5435 5439 return 0; 5436 5440 } … … 5502 5506 { 5503 5507 int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 5508 5509 cout << "number of entries before compress: " << pvsEntries << endl; 5504 5510 Debug << "number of entries before compress: " << pvsEntries << endl; 5505 5511 … … 5507 5513 5508 5514 pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 5515 5509 5516 Debug << "number of entries after compress: " << pvsEntries << endl; 5517 cout << "number of entries after compress: " << pvsEntries << endl; 5510 5518 } 5511 5519 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1841 r1842 37 37 #include "GlRenderer.h" 38 38 39 //#if USE_QT39 #ifndef NO_QT 40 40 #include "QtPreprocessorThread.h" 41 41 #include "QtGlRenderer.h" 42 42 #include "QtGlViewer.h" 43 //#endif43 #endif 44 44 45 45 #define USE_EXE_PATH false
Note: See TracChangeset
for help on using the changeset viewer.