Changeset 1166


Ignore:
Timestamp:
07/27/06 20:34:55 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/BoostPreprocessorThread.cpp

    r1153 r1166  
    2525        Camera camera; 
    2626 
    27         cout << "here79\n";  
    2827        if (0) 
    2928        { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h

    r1143 r1166  
    9595                return a->mCounter > b->mCounter; 
    9696        } 
     97 
     98        static string GetTypeName(Intersectable *obj) 
     99        { 
     100                switch(obj->Type()) 
     101                { 
     102                case MESH_INSTANCE: 
     103                        return "mesh_instance\n"; 
     104                 
     105                case TRANSFORMED_MESH_INSTANCE: 
     106                        return "transformed_mesh_instance\n"; 
     107                         
     108                case SPHERE: 
     109                        return "sphere\n"; 
     110 
     111                case VIEW_CELL: 
     112                        return "view cell\n"; 
     113                 
     114                case OGRE_MESH_INSTANCE: 
     115                        return "ogre_mesh_instance\n"; 
     116 
     117                case KD_INTERSECTABLE: 
     118                        return "kd_intersectable\n"; 
     119 
     120                default: 
     121                        return "unknown\n"; 
     122                } 
     123        } 
    97124}; 
    98125 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r1146 r1166  
    2424        Vector3 normal; 
    2525           
    26         const int i = RandomValue(0, mPreprocessor.mObjects.size() - 1); 
     26        const int i = RandomValue(0, (int)mPreprocessor.mObjects.size() - 1); 
    2727 
    2828        Intersectable *object = mPreprocessor.mObjects[i]; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp

    r1002 r1166  
    152152} 
    153153 
     154 
     155void SceneGraph::ExportScene(const string filename) 
     156{ 
     157        // export binary version of mesh 
    154158} 
     159 
     160void SceneGraph::LoadScene(const string filename) 
     161{ 
     162        //  load binary version of mesh 
     163} 
     164 
     165} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h

    r1002 r1166  
    4444  AxisAlignedBox3 GetBox() const { return mRoot->mBox; } 
    4545   
     46  /** Exports binary version of the scene. 
     47  */ 
     48  void ExportScene(const string filename); 
     49 
     50  /** Loads binary version of the scene. 
     51  */ 
     52  void LoadScene(const string filename); 
     53 
    4654protected: 
    4755}; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp

    r1161 r1166  
    14261426 
    14271427 
     1428void ViewCellsTree::UpdateStats(ofstream &stats, 
     1429                                                                const int pass, 
     1430                                                                const int viewCells, 
     1431                                                                const float renderCostDecrease, 
     1432                                                                const float totalRenderCost, 
     1433                                                                const int currentPvs, 
     1434                                                                const float expectedCost, 
     1435                                                                const float avgRenderCost, 
     1436                                                                const float deviation, 
     1437                                                                const int totalPvs, 
     1438                                                                const int entriesInPvs, 
     1439                                                                const int pvsSizeDecr, 
     1440                                                                const float volume) 
     1441{ 
     1442         stats << "#Pass\n" << pass << endl 
     1443                //<< "#Merged\n" << mergeStats.merged << endl  
     1444                << "#ViewCells\n" << viewCells << endl  
     1445        << "#RenderCostDecrease\n" << renderCostDecrease << endl // TODO 
     1446                << "#TotalRenderCost\n" << totalRenderCost << endl 
     1447                << "#CurrentPvs\n" << currentPvs << endl 
     1448                << "#ExpectedCost\n" << expectedCost << endl 
     1449                << "#AvgRenderCost\n" << avgRenderCost << endl 
     1450                << "#Deviation\n" << deviation << endl 
     1451                << "#TotalPvs\n" << totalPvs << endl 
     1452                << "#TotalEntriesInPvs\n" << entriesInPvs << endl 
     1453                << "#PvsSizeDecrease\n" << pvsSizeDecr << endl // TODO 
     1454                << "#Volume\n" << volume << endl 
     1455                << endl; 
     1456} 
     1457 
    14281458void ViewCellsTree::ExportStats(const string &mergeStats) 
    14291459{ 
     
    14441474        */ 
    14451475 
    1446         int totalPvs; 
    14471476        float totalRenderCost, avgRenderCost, expectedCost; 
    14481477 
    14491478        float deviation = 0; 
    1450         totalPvs = rootPvs; 
     1479        int totalPvs = rootPvs; 
     1480        int entriesInPvs = rootEntries; 
     1481 
    14511482        totalRenderCost = avgRenderCost = expectedCost = (float)rootPvs; 
    14521483 
     
    14551486 
    14561487        //-- first view cell 
    1457         stats  
    1458                 << "#Pass\n" << 0 << endl 
    1459                 //<< "#Merged\n" << mergeStats.merged << endl  
    1460                 << "#ViewCells\n" << numViewCells << endl  
    1461         << "#RenderCostDecrease\n" << 0 << endl // TODO 
    1462                 << "#TotalRenderCost\n" << totalRenderCost << endl 
    1463                 << "#CurrentPvs\n" << rootPvs << endl 
    1464                 << "#CurrentEntries\n" << rootEntries << endl 
    1465                 << "#ExpectedCost\n" << expectedCost << endl 
    1466                 << "#AvgRenderCost\n" << avgRenderCost << endl 
    1467                 << "#Deviation\n" << deviation << endl 
    1468                 << "#TotalPvs\n" << totalPvs << endl 
    1469                 << "#PvsSizeDecrease\n" << 0 << endl // TODO 
    1470                 << "#Volume\n" << mRoot->GetVolume() << endl 
    1471                 << endl; 
     1488        UpdateStats(stats, 
     1489                                0, numViewCells, 0, totalRenderCost,  
     1490                                rootPvs, expectedCost, avgRenderCost, deviation, 
     1491                                totalPvs, entriesInPvs, 0, mRoot->GetVolume()); 
     1492                 
    14721493 
    14731494        //-- go through tree in the order of render cost decrease 
     
    14841505                {        
    14851506                        ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
    1486                          
     1507 
    14871508                        const int parentPvs = GetPvsSize(interior); 
    1488                         const float parentCost = (float)parentPvs * interior->GetVolume(); 
     1509                        const int parentPvsEntries = GetPvsEntries(interior); 
     1510            const float parentCost = (float)parentPvs * interior->GetVolume(); 
     1511 
    14891512                        float childCost = 0; 
    14901513                        int childPvs = 0; 
     1514                        int childPvsEntries = 0; 
    14911515 
    14921516                        -- numViewCells; 
     
    14961520                        for (it = interior->mChildren.begin(); it != it_end; ++ it) 
    14971521                        { 
    1498                                 const int pvsSize = GetPvsSize(*it); 
    1499                                 childCost += (float) pvsSize * (*it)->GetVolume(); 
     1522                                ViewCell *vc = *it; 
     1523                                const int pvsSize = GetPvsSize(vc); 
     1524                                const int pvsEntries = GetPvsEntries(vc); 
     1525 
     1526                                childCost += (float) pvsSize * vc->GetVolume(); 
    15001527                                childPvs += pvsSize; 
    1501  
    1502                                 tqueue.push(*it); 
     1528                                childPvsEntries += pvsEntries; 
     1529 
     1530                                tqueue.push(vc); 
    15031531                                ++ numViewCells; 
    15041532                        } 
     
    15091537                        totalRenderCost -= costDecr; 
    15101538                        totalPvs += childPvs - parentPvs; 
    1511                          
     1539                        entriesInPvs += childPvsEntries - parentPvsEntries; 
     1540 
    15121541                        expectedCost = totalRenderCost / (float)numViewCells; 
    15131542                        avgRenderCost = (float)totalPvs / (float)numViewCells; 
    15141543 
    1515                         stats  
    1516                                 << "#Pass\n" << 0 << endl 
    1517                                 //<< "#Merged\n" << mergeStats.merged << endl  
    1518                                 << "#ViewCells\n" << numViewCells << endl  
    1519                                 << "#RenderCostDecrease\n" << costDecr << endl // TODO 
    1520                                 << "#TotalRenderCost\n" << totalRenderCost << endl 
    1521                                 << "#CurrentPvs\n" << parentPvs << endl 
    1522                                 << "#ExpectedCost\n" << expectedCost << endl 
    1523                                 << "#AvgRenderCost\n" << avgRenderCost << endl 
    1524                                 << "#Deviation\n" << deviation << endl 
    1525                                 << "#TotalPvs\n" << totalPvs << endl 
    1526                                 << "#PvsSizeDecrease\n" << childPvs - parentPvs << endl // TODO 
    1527                                 << "#Volume\n" << vc->GetVolume() << endl 
    1528                                 << endl; 
     1544                        UpdateStats(stats, 
     1545                                                0, numViewCells, costDecr, totalRenderCost, 
     1546                                                parentPvs, expectedCost, avgRenderCost, deviation, 
     1547                        totalPvs, entriesInPvs, childPvs - parentPvs, 
     1548                                                vc->GetVolume()); 
    15291549 
    15301550                } 
     
    16351655} 
    16361656 
    1637 // TODO matt: implement for different storing methods 
     1657// TODO matt: implement this function for different storing methods 
    16381658void ViewCellsTree::GetPvs(ViewCell *vc, ObjectPvs &pvs) const 
    16391659{ 
     
    16861706 
    16871707 
     1708int ViewCellsTree::GetPvsSizeForLeafStorage(ViewCell *vc) const 
     1709{ 
     1710        int pvsSize = 0; 
     1711 
     1712        // pvs is always stored directly in leaves 
     1713        if (vc->IsLeaf()) 
     1714        { 
     1715                pvsSize = vc->GetPvs().CountPvs(); 
     1716                //int pvsSize1 = vc->GetPvs().GetSize(); 
     1717                //Debug << "entries num: " << pvsSize1 << " size: "" << pvsSize << endl; 
     1718        } 
     1719        else // interior node 
     1720        { 
     1721                // interior nodes: pvs is either stored as a scalar or 
     1722                // has to be reconstructed from the leaves 
     1723 
     1724                // the stored pvs size is the valid pvs size => just return scalar 
     1725                if (vc->mPvsSizeValid) 
     1726                { 
     1727                        pvsSize = vc->mPvsSize; 
     1728                } 
     1729                 
     1730                // if no valid pvs size stored as a scalar =>  
     1731                // compute current pvs size of interior from it's leaf nodes 
     1732                ViewCellContainer leaves; 
     1733                CollectLeaves(vc, leaves); 
     1734 
     1735                ViewCellContainer::const_iterator it, it_end = leaves.end(); 
     1736 
     1737                Intersectable::NewMail(); 
     1738 
     1739                // sum different intersectables 
     1740                for (it = leaves.begin(); it != it_end; ++ it) 
     1741                { 
     1742                        pvsSize = GetPvsSizeForLeafStorage(*it); 
     1743                } 
     1744        } 
     1745 
     1746        return pvsSize; 
     1747} 
     1748 
     1749 
     1750int ViewCellsTree::GetEntriesInPvsForLeafStorage(ViewCell *vc) const 
     1751{ 
     1752        int pvsSize = 0; 
     1753 
     1754        // pvs is always stored directly in leaves 
     1755        if (vc->IsLeaf()) 
     1756        { 
     1757                pvsSize = vc->GetPvs().GetSize(); 
     1758        } 
     1759        else // interior node 
     1760        { 
     1761                // interior nodes: pvs is either stored as a scalar or 
     1762                // has to be reconstructed from the leaves 
     1763 
     1764                // the stored pvs size is the valid pvs size => just return scalar 
     1765                if (vc->mPvsSizeValid) 
     1766                { 
     1767                        pvsSize = vc->mEntriesInPvs; 
     1768                } 
     1769                 
     1770                // if no valid pvs size stored as a scalar =>  
     1771                // compute current pvs size of interior from it's leaf nodes 
     1772                ViewCellContainer leaves; 
     1773                CollectLeaves(vc, leaves); 
     1774 
     1775                ViewCellContainer::const_iterator it, it_end = leaves.end(); 
     1776 
     1777                Intersectable::NewMail(); 
     1778 
     1779                // sum different intersectables 
     1780                for (it = leaves.begin(); it != it_end; ++ it) 
     1781                { 
     1782                        pvsSize = GetEntriesInPvsForLeafStorage(*it); 
     1783                } 
     1784        } 
     1785 
     1786        return pvsSize; 
     1787} 
     1788 
     1789 
     1790int ViewCellsTree::GetPvsSizeForCompressedStorage(ViewCell *vc) const 
     1791{ 
     1792        int pvsSize = 0; 
     1793 
     1794        //-- compressed pvs 
     1795 
     1796        // the stored pvs size is the valid pvs size => just return scalar 
     1797        if (vc->mPvsSizeValid) 
     1798        { 
     1799                pvsSize = vc->mPvsSize; 
     1800        } 
     1801 
     1802        // if no pvs size stored, compute new one 
     1803        ViewCell *root = vc; 
     1804         
     1805        // also add pvs from this view cell to root 
     1806        while (root->GetParent()) 
     1807        { 
     1808                root = root->GetParent(); 
     1809         
     1810                // matt: bug! must evaluate kd pvss also 
     1811                pvsSize += CountDiffPvs(root); 
     1812        } 
     1813 
     1814        stack<ViewCell *> tstack; 
     1815        tstack.push(vc); 
     1816 
     1817        while (!tstack.empty()) 
     1818        { 
     1819                vc = tstack.top(); 
     1820                tstack.pop(); 
     1821                // matt: bug! must evaluate kd pvss also 
     1822                pvsSize += CountDiffPvs(vc); 
     1823 
     1824                if (!vc->IsLeaf()) 
     1825                { 
     1826                        ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1827 
     1828                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     1829 
     1830                        for (it = interior->mChildren.begin(); it != it_end; ++ it) 
     1831                        { 
     1832                                tstack.push(*it); 
     1833                        }                
     1834                } 
     1835        } 
     1836 
     1837        return pvsSize; 
     1838} 
     1839 
     1840 
     1841int ViewCellsTree::GetEntriesInPvsForCompressedStorage(ViewCell *vc) const 
     1842{ 
     1843        int pvsSize = 0; 
     1844 
     1845        //-- compressed pvs 
     1846 
     1847        // the stored pvs size is the valid pvs size => just return scalar 
     1848        if (vc->mPvsSizeValid) 
     1849        { 
     1850                pvsSize = vc->mEntriesInPvs; 
     1851        } 
     1852 
     1853        // if no pvs size stored, compute new one 
     1854        ViewCell *root = vc; 
     1855         
     1856        // also add pvs from this view cell to root 
     1857        while (root->GetParent()) 
     1858        { 
     1859                root = root->GetParent(); 
     1860                // count the pvs entries different from the already found ones   
     1861                pvsSize += CountDiffPvs(root); 
     1862        } 
     1863 
     1864        stack<ViewCell *> tstack; 
     1865        tstack.push(vc); 
     1866 
     1867        while (!tstack.empty()) 
     1868        { 
     1869                vc = tstack.top(); 
     1870                tstack.pop(); 
     1871         
     1872                // count the pvs entries different from the already found ones   
     1873                pvsSize += CountDiffPvs(vc); 
     1874 
     1875                if (!vc->IsLeaf()) 
     1876                { 
     1877                        ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1878 
     1879                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     1880 
     1881                        for (it = interior->mChildren.begin(); it != it_end; ++ it) 
     1882                        { 
     1883                                tstack.push(*it); 
     1884                        }                
     1885                } 
     1886        } 
     1887 
     1888        return pvsSize; 
     1889} 
     1890 
     1891 
    16881892int ViewCellsTree::GetPvsSize(ViewCell *vc) const 
    16891893{ 
     
    17001904        case PVS_IN_LEAVES: //-- store pvs only in leaves 
    17011905                {                        
    1702                         // pvs is always stored directly in leaves 
    1703                         if (vc->IsLeaf()) 
    1704                         { 
    1705                                 pvsSize = vc->GetPvs().CountPvs(); 
    1706                         } 
    1707                         else // interior node 
    1708                         { 
    1709                                 // interior nodes: pvs is either stored as a scalar or 
    1710                                 // has to be reconstructed from the leaves 
    1711  
    1712                                 // the stored pvs size is the valid pvs size => just return scalar 
    1713                                 if (vc->mPvsSizeValid) 
    1714                                 { 
    1715                                         pvsSize = vc->mPvsSize; 
    1716                                         break; 
    1717                                 } 
    1718                  
    1719                                 //-- if no valid pvs size stored as a scalar =>  
    1720                                 //-- compute current pvs size of interior from it's leaf nodes 
    1721                                 ViewCellContainer leaves; 
    1722                                 CollectLeaves(vc, leaves); 
    1723  
    1724                                 ViewCellContainer::const_iterator it, it_end = leaves.end(); 
    1725  
    1726                                 Intersectable::NewMail(); 
    1727  
    1728                                 // sum different intersectables 
    1729                                 for (it = leaves.begin(); it != it_end; ++ it) 
    1730                                 { 
    1731                                         ObjectPvsMap::iterator oit, oit_end = (*it)->GetPvs().mEntries.end(); 
    1732  
    1733                                         // mail all from first pvs 
    1734                                         for (oit = (*it)->GetPvs().mEntries.begin(); oit != oit_end; ++ oit) 
    1735                                         { 
    1736                                                 Intersectable *intersect = (*oit).first; 
    1737  
    1738                                                 if (!intersect->Mailed()) 
    1739                                                 { 
    1740                                                         ++ pvsSize; 
    1741                                                         intersect->Mail();                                       
    1742                                                 } 
    1743                                         } 
    1744                                 } 
    1745  
    1746                                 break; 
    1747                         } 
     1906                        pvsSize = GetPvsSizeForLeafStorage(vc);                  
     1907                        break; 
    17481908                } 
    17491909        case COMPRESSED: 
    17501910                { 
    1751                         //////////////////////// 
    1752                         //-- compressed pvs 
    1753  
    1754                         // the stored pvs size is the valid pvs size => just return scalar 
    1755                         if (vc->mPvsSizeValid) 
    1756                         { 
    1757                                 pvsSize = vc->mPvsSize; 
    1758                                 break; 
    1759                         } 
    1760  
    1761                         // if no pvs size stored, compute new one 
    1762                         int pvsSize = 0; 
    1763                         ViewCell *root = vc; 
    1764          
    1765                         // also add pvs from this view cell to root 
    1766                         while (root->GetParent()) 
    1767                         { 
    1768                                 root = root->GetParent(); 
    1769                                 // matt: bug! must evaluate kd pvss also 
    1770                                 pvsSize += CountDiffPvs(root); 
    1771                         } 
    1772  
    1773                         stack<ViewCell *> tstack; 
    1774                         tstack.push(vc); 
    1775  
    1776                         while (!tstack.empty()) 
    1777                         { 
    1778                                 vc = tstack.top(); 
    1779                                 tstack.pop(); 
    1780          
    1781                                 pvsSize += CountDiffPvs(vc); 
    1782  
    1783                                 if (!vc->IsLeaf()) 
    1784                                 { 
    1785                                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
    1786  
    1787                                         ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    1788  
    1789                                         for (it = interior->mChildren.begin(); it != it_end; ++ it) 
    1790                                         { 
    1791                                                 tstack.push(*it); 
    1792                                         }                
    1793                                 } 
    1794                         } 
     1911                        pvsSize = GetPvsSizeForCompressedStorage(vc); 
    17951912                        break; 
    17961913                } 
     
    18201937        case PVS_IN_LEAVES: //-- store pvs only in leaves 
    18211938                {                        
    1822                         // pvs is always stored directly in leaves 
    1823                         if (vc->IsLeaf()) 
    1824                         { 
    1825                                 pvsSize = vc->GetPvs().GetSize(); 
    1826                         } 
    1827                         else // interior node 
    1828                         { 
    1829                                 // interior nodes: pvs is either stored as a scalar or 
    1830                                 // has to be reconstructed from the leaves 
    1831  
    1832                                 // the stored pvs size is the valid pvs size => just return scalar 
    1833                                 if (vc->mPvsSizeValid) 
    1834                                 { 
    1835                                         pvsSize = vc->mPvsSize; 
    1836                                         break; 
    1837                                 } 
    1838                  
    1839                                 // if no valid pvs size stored as a scalar =>  
    1840                                 // compute current pvs size of interior from it's leaf nodes 
    1841                                 ViewCellContainer leaves; 
    1842                                 CollectLeaves(vc, leaves); 
    1843  
    1844                                 ViewCellContainer::const_iterator it, it_end = leaves.end(); 
    1845  
    1846                                 Intersectable::NewMail(); 
    1847  
    1848                                 // sum different intersectables 
    1849                                 for (it = leaves.begin(); it != it_end; ++ it) 
    1850                                 { 
    1851                                         ObjectPvsMap::iterator oit, oit_end = (*it)->GetPvs().mEntries.end(); 
    1852  
    1853                                         // mail all from first pvs 
    1854                                         for (oit = (*it)->GetPvs().mEntries.begin(); oit != oit_end; ++ oit) 
    1855                                         { 
    1856                                                 Intersectable *intersect = (*oit).first; 
    1857  
    1858                                                 if (!intersect->Mailed()) 
    1859                                                 { 
    1860                                                         ++ pvsSize; 
    1861                                                         intersect->Mail();                                       
    1862                                                 } 
    1863                                         } 
    1864                                 } 
    1865  
    1866                                 break; 
    1867                         } 
     1939                        pvsSize = GetEntriesInPvsForLeafStorage(vc); 
     1940                        break; 
    18681941                } 
    18691942        case COMPRESSED: 
    18701943                { 
    1871                         //////////////////////// 
    1872                         //-- compressed pvs 
    1873  
    1874                         // the stored pvs size is the valid pvs size => just return scalar 
    1875                         if (vc->mPvsSizeValid) 
    1876                         { 
    1877                                 pvsSize = vc->mPvsSize; 
    1878                                 break; 
    1879                         } 
    1880  
    1881                         // if no pvs size stored, compute new one 
    1882                         int pvsSize = 0; 
    1883                         ViewCell *root = vc; 
    1884          
    1885                         // also add pvs from this view cell to root 
    1886                         while (root->GetParent()) 
    1887                         { 
    1888                                 root = root->GetParent(); 
    1889                                 pvsSize += CountDiffPvs(root); 
    1890                         } 
    1891  
    1892                         stack<ViewCell *> tstack; 
    1893                         tstack.push(vc); 
    1894  
    1895                         while (!tstack.empty()) 
    1896                         { 
    1897                                 vc = tstack.top(); 
    1898                                 tstack.pop(); 
    1899          
    1900                                 pvsSize += CountDiffPvs(vc); 
    1901  
    1902                                 if (!vc->IsLeaf()) 
    1903                                 { 
    1904                                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
    1905  
    1906                                         ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    1907  
    1908                                         for (it = interior->mChildren.begin(); it != it_end; ++ it) 
    1909                                         { 
    1910                                                 tstack.push(*it); 
    1911                                         }                
    1912                                 } 
    1913                         } 
     1944                        pvsSize = GetEntriesInPvsForCompressedStorage(vc); 
    19141945                        break; 
    19151946                } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h

    r1161 r1166  
    619619#endif 
    620620 
     621        int GetEntriesInPvsForCompressedStorage(ViewCell *vc) const; 
     622        int GetPvsSizeForCompressedStorage(ViewCell *vc) const; 
     623        int GetPvsSizeForLeafStorage(ViewCell *vc) const; 
     624        int GetEntriesInPvsForLeafStorage(ViewCell *vc) const; 
     625 
     626        void UpdateStats( 
     627                ofstream &stats, 
     628                const int pass, 
     629                const int viewCells, 
     630                const float renderCostDecrease, 
     631                const float totalRenderCost, 
     632                const int currentPvs, 
     633                const float expectedCost, 
     634                const float avgRenderCost, 
     635                const float deviation, 
     636                const int totalPvs, 
     637                const int entriesInPvs, 
     638                const int pvsSizeDecr, 
     639                const float volume); 
    621640 
    622641        /// if the view cell tree hold compressed pvs 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1161 r1166  
    2121 
    2222// should not count origin object for sampling because it disturbs heuristics 
    23 #define COUNT_ORIGIN_OBJECTS 0 
     23#define SAMPLE_ORIGIN_OBJECTS 0 
    2424 
    2525namespace GtpVisibilityPreprocessor { 
     
    18981898                        // made in one direction!!! 
    18991899                        // the other contributions of this sample will be counted for the oposite ray! 
    1900 #if COUNT_ORIGIN_OBJECTS 
     1900#if SAMPLE_ORIGIN_OBJECTS 
    19011901                        if (ray.mOriginObject &&  
    19021902                                viewcell->GetPvs().GetSampleContribution(ray.mOriginObject, 
     
    19271927                                        viewcell->GetPvs().AddSample(ray.mTerminationObject, ray.mPdf); 
    19281928                                }                                
    1929 #if COUNT_ORIGIN_OBJECTS 
     1929#if SAMPLE_ORIGIN_OBJECTS 
    19301930                                 if (ray.mOriginObject) 
    19311931                                 { 
     
    58095809                        // made in one direction!!! 
    58105810                        // the other contributions of this sample will be counted for the oposite ray! 
    5811 #if COUNT_ORIGIN_OBJECTS 
     5811#if SAMPLE_ORIGIN_OBJECTS 
    58125812                        if (ray.mOriginObject &&  
    58135813                                viewcell->GetPvs().GetSampleContribution(ray.mOriginObject, 
     
    58505850                                } 
    58515851                                 
    5852 #if COUNT_ORIGIN_OBJECTS 
     5852#if SAMPLE_ORIGIN_OBJECTS 
    58535853                                 if (ray.mOriginObject) 
    58545854                                         viewcell->AddPvsSample(ray.mOriginObject, ray.mPdf, ray.mPvsContribution); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp

    r1141 r1166  
    177177        case Intersectable::KD_INTERSECTABLE: 
    178178                ExportKdIntersectable(*(dynamic_cast<KdIntersectable *>(object))); 
     179                break; 
    179180        default: 
    180                 cerr << "Sorry the export for object not yet defined" << endl; 
     181                cerr << "Sorry the export for object type " << Intersectable::GetTypeName(object) << " is not available yet" << endl; 
    181182                break; 
    182183        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp

    r1160 r1166  
    813813         
    814814        //Debug << "f: " << frontData.mRays->size() << " b: " << backData.mRays->size() << "d: " << tData.mRays->size() << endl; 
     815 
    815816        //-- compute pvs 
    816817        frontData.mPvs = ComputePvsSize(*frontData.mRays); 
     
    843844#ifdef _DEBUG 
    844845        Debug << interior << endl; 
    845 #endif 
     846#endif+ 
    846847 
    847848 
     
    11571158                // add objects without the objects which are in several kd leaves 
    11581159                pvsSize += (int)(leaf->mObjects.size() - leaf->mMultipleObjects.size()); 
    1159                 //Debug << "here11 " << (int)leaf->mObjects.size() << " " << leaf->mMultipleObjects.size() << endl; 
     1160                //Debug << "adding " << (int)leaf->mObjects.size() << " " << leaf->mMultipleObjects.size() << endl; 
    11601161        } 
    11611162        else 
     
    32293230                                                                           int &objectsBack) 
    32303231{ 
     3232        RayInfoContainer usedRays; 
     3233int mMaxTests = 5000; 
     3234        if (mMaxTests < (int)tData.mRays->size()) 
     3235        { 
     3236                GetRayInfoSets(*tData.mRays, mMaxTests, usedRays); 
     3237        } 
     3238        else 
     3239        { 
     3240                usedRays = *tData.mRays; 
     3241        } 
     3242 
    32313243        // go through the lists, count the number of objects left and right 
    32323244        // and evaluate the following cost funcion: 
     
    32533265        int vcr = numViewCells; 
    32543266   
    3255         const int totalPvs = tData.mNode->mObjects.size(); 
     3267        /// this is kind of a reverse pvs 
     3268        const int totalPvs = (int)tData.mNode->mObjects.size(); 
    32563269         
    32573270        int pvsl = 0; 
  • GTP/trunk/Lib/Vis/QtRenderer/QtGlRenderer.cpp

    r1151 r1166  
    13591359 
    13601360         
    1361         int currentPos = mViewCellsManager->GetViewCells().size(); 
    1362         float currentCost=-1; 
     1361        int currentPos = (int)mViewCellsManager->GetViewCells().size(); 
     1362        float currentCost= -1; 
    13631363 
    13641364        if (currentPos < costFunction.size()) 
  • GTP/trunk/Lib/Vis/QtRenderer/QtRenderer.vcproj

    r1163 r1166  
    2020                                Name="VCCLCompilerTool" 
    2121                                Optimization="0" 
    22                                 AdditionalIncludeDirectories="..\Preprocessing\src;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\..\..\..\..\NonGTP\Zlib\include;&quot;$(CG_INC_PATH)&quot;" 
     22                                AdditionalIncludeDirectories="&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\Preprocessing\src;..\..\..\..\..\NonGTP\Zlib\include;&quot;$(CG_INC_PATH)&quot;" 
    2323                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;QTRENDERER_EXPORTS" 
    2424                                MinimalRebuild="TRUE" 
     
    2828                                WarningLevel="3" 
    2929                                Detect64BitPortabilityProblems="TRUE" 
    30                                 DebugInformationFormat="3"/> 
     30                                DebugInformationFormat="4"/> 
    3131                        <Tool 
    3232                                Name="VCCustomBuildTool"/> 
    3333                        <Tool 
    3434                                Name="VCLinkerTool" 
    35                                 AdditionalDependencies="Preprocessor.lib qtmain.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib QtCore4.lib QtOpenGL4.lib xerces-c_2.lib glew32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib" 
    36                                 OutputFile="$(OutDir)/QtGlRenderer.dll" 
    37                                 LinkIncremental="1" 
     35                                AdditionalDependencies="Preprocessor.lib qtmain.lib QtGui4d.lib Qt3Support4d.lib QAxContainerd.lib QtCore4d.lib QtOpenGL4.lib xerces-c_2.lib glew32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib" 
     36                                OutputFile="$(OutDir)/QtRenderer.dll" 
     37                                LinkIncremental="2" 
    3838                                AdditionalLibraryDirectories="&quot;$(QTDIR)\lib&quot;;..\..\..\..\..\NonGTP\Zlib\lib;&quot;$(CG_LIB_PATH)&quot;;&quot;..\Preprocessing\lib\$(ConfigurationName)&quot;;..\Preprocessing\src\GL;..\..\..\..\..\NonGTP\Xerces\xercesc\lib" 
    3939                                GenerateDebugInformation="TRUE" 
    40                                 ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb" 
     40                                ProgramDatabaseFile="$(OutDir)/QtRenderer.pdb" 
    4141                                SubSystem="2" 
    4242                                ImportLibrary="$(OutDir)/QtRenderer.lib" 
Note: See TracChangeset for help on using the changeset viewer.