Ignore:
Timestamp:
03/20/06 00:11:27 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r708 r710  
    560560                mMergeQueue.pop(); 
    561561         
    562                 // both view cells equal 
     562                // both view cells equal because of previous merges 
    563563                // NOTE: do I really still need this? probably cannot happen!! 
    564564                if (mc.mLeftViewCell == mc.mRightViewCell) 
     
    579579                        totalRenderCost += renderCostIncr; 
    580580                        mDeviation += mc.GetDeviationIncr(); 
    581                          
    582                          
    583                         // merge the view cells of leaf1 and leaf2 
     581 
     582                                                 
     583                        //-- merge the view cells of leaf1 and leaf2 
    584584                        int pvsDiff; 
    585585                        ViewCellInterior *mergedVc =  
    586586                                MergeViewCells(mc.mLeftViewCell, mc.mRightViewCell, pvsDiff); 
    587  
     587                         
    588588 
    589589                        // total render cost and deviation has changed 
     
    641641                 
    642642                ViewCellInterior *root = mViewCellsManager->MergeViewCells(activeViewCells); 
     643         
     644                ViewCellContainer::const_iterator it, it_end = root->mChildren.end(); 
     645 
     646                for (it = root->mChildren.begin(); it != it_end; ++ it) 
     647                        (*it)->SetParent(root); 
     648         
    643649                root->SetMergeCost(totalRenderCost); 
    644650                // $$JB keep this 0 temporarilly 
     
    647653                mRoot = root; 
    648654        } 
    649         else if ((int)activeViewCells.size() == 1) 
     655        // normal case 
     656        else if (!activeViewCells.empty()) 
    650657        { 
    651658                Debug << "setting root of the merge history" << endl; 
    652659                mRoot = activeViewCells[0]; 
     660                Debug << "rootvc volume: " << mRoot->GetVolume() << endl; 
    653661        } 
    654662         
     
    742750 
    743751                // all merged view cells have been found 
    744                 if (i >= viewCells.size())  
     752                if (i >= (int)viewCells.size())  
    745753                        break; 
    746754 
    747                 // already merged view cell, put it to end of vector 
     755                // already merged this view cell, put it to end of vector 
    748756                if (viewCells[i]->GetParent()) 
    749757                        swap(viewCells[i], viewCells.back()); 
    750758                 
    751                 viewCells[i ++]->Mail(); 
     759                // mail view cell as it has not been merged 
     760                viewCells[i]->Mail(); 
     761 
     762                // increase loop counter 
     763                ++ i; 
    752764        } 
    753765 
     
    847859        if (!vc) return NULL; 
    848860 
     861        l->SetParent(vc); 
     862        r->SetParent(vc); 
     863 
    849864        // set new size of view cell 
    850865        if (mUseAreaForPvs) 
     866        { 
    851867                vc->SetArea(l->GetArea() + l->GetArea()); 
     868        } 
    852869        else 
    853870        { 
    854871                vc->SetVolume(r->GetVolume() + l->GetVolume()); 
    855872        } 
     873 
     874         
    856875        // important so other merge candidates sharing this view cell 
    857876        // are notified that the merge cost must be updated!! 
     
    957976        return shuffledViewCells; 
    958977} 
    959  
    960  
    961978 
    962979 
Note: See TracChangeset for help on using the changeset viewer.