Ignore:
Timestamp:
05/31/06 10:04:05 (18 years ago)
Author:
mattausch
Message:

fixed bug for histogram
improved samplerenderer
todo: difference detectempty true / false

File:
1 edited

Legend:

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

    r971 r997  
    16611661        int pvsSize = 0; 
    16621662 
    1663         if (vc->IsLeaf()) 
    1664         { 
    1665                 pvsSize = vc->GetPvs().GetSize(); 
    1666         } 
    1667          
    1668  
    16691663        Intersectable::NewMail(); 
    16701664 
    16711665        ////////////////////////// 
     1666        // for interiors, pvs can be stored using different methods 
     1667 
    16721668        switch (mViewCellsStorage) 
    16731669        { 
    16741670        case PVS_IN_LEAVES: //-- store pvs only in leaves 
    16751671                {                        
     1672                        // pvs is always stored directly in leaves 
     1673                        if (vc->IsLeaf()) 
     1674                        { 
     1675                                pvsSize = vc->GetPvs().GetSize(); 
     1676                                break; 
     1677                        } 
     1678         
     1679                        // the stored pvs size is the valid pvs size => just return scalar 
    16761680                        if (vc->mPvsSizeValid) 
    16771681                        { 
     
    16801684                        } 
    16811685         
    1682                         //-- if no valid pvs size stored as a scalar=> compute new pvs size 
     1686                        //-- if no valid pvs size stored as a scalar => compute new pvs size 
    16831687                        ViewCellContainer leaves; 
    16841688                        CollectLeaves(vc, leaves); 
     
    17111715                { 
    17121716                        //////////////////////// 
    1713         //-- compressed pvs 
     1717                        //-- compressed pvs 
    17141718 
    17151719                        if (vc->mPvsSizeValid) 
     1720                        { 
    17161721                                return vc->mPvsSize; 
    1717  
    1718                         // if no pvs size stored: compute 
    1719         int pvsSize = 0; 
    1720         ViewCell *root = vc; 
    1721          
    1722         // also add pvs from this view cell to root 
    1723         while (root->GetParent()) 
    1724         { 
    1725                 root = root->GetParent(); 
    1726                 pvsSize += CountDiffPvs(root); 
    1727         } 
    1728  
    1729         stack<ViewCell *> tstack; 
    1730         tstack.push(vc); 
    1731  
    1732         while (!tstack.empty()) 
    1733         { 
    1734                 vc = tstack.top(); 
    1735                 tstack.pop(); 
    1736  
    1737                 pvsSize += CountDiffPvs(vc); 
    1738  
    1739                 if (!vc->IsLeaf()) 
    1740                 { 
    1741                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
    1742  
    1743                         ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    1744  
    1745                         for (it = interior->mChildren.begin(); it != it_end; ++ it) 
     1722                        } 
     1723 
     1724                        // if no pvs size stored, compute new one 
     1725                        int pvsSize = 0; 
     1726                        ViewCell *root = vc; 
     1727         
     1728                        // also add pvs from this view cell to root 
     1729                        while (root->GetParent()) 
    17461730                        { 
    1747                                 tstack.push(*it); 
    1748                         }                
    1749                 } 
    1750         } 
     1731                                root = root->GetParent(); 
     1732                                pvsSize += CountDiffPvs(root); 
     1733                        } 
     1734 
     1735                        stack<ViewCell *> tstack; 
     1736                        tstack.push(vc); 
     1737 
     1738                        while (!tstack.empty()) 
     1739                        { 
     1740                                vc = tstack.top(); 
     1741                                tstack.pop(); 
     1742         
     1743                                pvsSize += CountDiffPvs(vc); 
     1744 
     1745                                if (!vc->IsLeaf()) 
     1746                                { 
     1747                                        ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1748 
     1749                                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     1750 
     1751                                        for (it = interior->mChildren.begin(); it != it_end; ++ it) 
     1752                                        { 
     1753                                                tstack.push(*it); 
     1754                                        }                
     1755                                } 
     1756                        } 
    17511757                        break; 
    17521758                } 
    17531759        case PVS_IN_INTERIORS: 
    1754         default:Debug << "in interiors: " << vc->mPvsSize << " $$ " << vc->GetPvs().GetSize() << endl; 
     1760        default: 
     1761                Debug << "in interiors: " << vc->mPvsSize << " $$ " << vc->GetPvs().GetSize() << endl; 
    17551762                pvsSize = vc->GetPvs().GetSize();                
    17561763        } 
Note: See TracChangeset for help on using the changeset viewer.