Ignore:
Timestamp:
02/04/06 21:36:40 (18 years ago)
Author:
mattausch
Message:

implemented some code for merge history loading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp

    r589 r590  
    1717#include "ViewCellsManager.h" 
    1818#include "Beam.h" 
     19 
    1920 
    2021//-- static members 
     
    17411742void VspBspTree::CollapseViewCells() 
    17421743{ 
     1744// TODO 
     1745#if VC_HISTORY 
    17431746        stack<BspNode *> nodeStack; 
    17441747 
     
    17621765         
    17631766                                ViewCellContainer leaves; 
    1764                                 mViewCellsManager->GetViewCellsTree()->CollectLeaves(viewCell, leaves); 
     1767                                mViewCellsTree->CollectLeaves(viewCell, leaves); 
    17651768 
    17661769                                ViewCellContainer::const_iterator it, it_end = leaves.end(); 
     
    17881791 
    17891792        Debug << "invalid leaves: " << mBspStats.invalidLeaves << endl; 
     1793#endif 
    17901794} 
    17911795 
     
    18551859                        if (!onlyValid || node->TreeValid()) 
    18561860                        { 
    1857                                 ViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
    1858                          
     1861                                ViewCell *viewCell =  
     1862                                        mViewCellsTree->GetActiveViewCell(dynamic_cast<BspLeaf *>(node)->GetViewCell()); 
     1863                                                 
    18591864                                if (!onlyUnmailed || !viewCell->Mailed())  
    18601865                                { 
     
    18721877                } 
    18731878        } 
     1879 
    18741880} 
    18751881 
     
    20582064{ 
    20592065        ViewCellContainer leaves; 
    2060         mViewCellsManager->GetViewCellsTree()->CollectLeaves(vc, leaves); 
     2066         
     2067        mViewCellsTree->CollectLeaves(vc, leaves); 
    20612068 
    20622069        ViewCellContainer::const_iterator it, it_end = leaves.end(); 
     
    20652072        { 
    20662073                BspLeaf *l = dynamic_cast<BspViewCell *>(*it)->mLeaf; 
     2074                 
    20672075                ConstructGeometry(l, vcGeom); 
    20682076        } 
     
    24332441                        BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
    24342442 
    2435                         if (!leaf->GetViewCell()->Mailed()) 
    2436                         { 
    2437                                 viewcells.push_back(leaf->GetViewCell()); 
    2438                                 leaf->GetViewCell()->Mail(); 
     2443                        ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 
     2444                        if (!viewCell->Mailed()) 
     2445                        { 
     2446                                viewcells.push_back(viewCell); 
     2447                                viewCell->Mail(); 
    24392448                                ++ hits; 
    24402449                        } 
     
    24972506BspNode *VspBspTree::CollapseTree(BspNode *node, int &collapsed) 
    24982507{ 
     2508// TODO 
     2509#if VC_HISTORY 
    24992510        if (node->IsLeaf()) 
    25002511                return node; 
     
    25302541                } 
    25312542        } 
    2532  
     2543#endif 
    25332544        return node; 
    25342545} 
     
    25512562void VspBspTree::RepairViewCellsLeafLists() 
    25522563{ 
     2564// TODO 
     2565#if VC_HISTORY 
    25532566        // list not valid anymore => clear 
    25542567        stack<BspNode *> nodeStack; 
     
    25672580 
    25682581                        BspViewCell *viewCell = leaf->GetViewCell(); 
    2569         // TODO 
    2570 #if VC_HISTORY 
     2582 
    25712583                        if (!viewCell->Mailed()) 
    25722584                        { 
     
    25762588         
    25772589                        viewCell->mLeaves.push_back(leaf); 
     2590 
     2591                } 
     2592                else 
     2593                { 
     2594                        BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     2595 
     2596                        nodeStack.push(interior->GetFront()); 
     2597                        nodeStack.push(interior->GetBack()); 
     2598                } 
     2599        } 
    25782600// TODO 
    25792601#endif 
    2580                 } 
    2581                 else 
    2582                 { 
    2583                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
    2584  
    2585                         nodeStack.push(interior->GetFront()); 
    2586                         nodeStack.push(interior->GetBack()); 
    2587                 } 
    2588         } 
    25892602} 
    25902603 
     
    29292942        { 
    29302943                BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
    2931                          
     2944                ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 
     2945 
    29322946                int id = -1; 
    2933                 if (leaf->GetViewCell() != mOutOfBoundsCell) 
    2934                         id = leaf->GetViewCell()->GetId(); 
     2947                if (viewCell != mOutOfBoundsCell) 
     2948                        id = viewCell->GetId(); 
    29352949 
    29362950                stream << "<Leaf viewCellId=\"" << id << "\" />" << endl; 
Note: See TracChangeset for help on using the changeset viewer.