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/ViewCellsParser.cpp

    r580 r590  
    2828#include "VspBspTree.h" 
    2929#include "ViewCellBsp.h" 
     30#include "VspKdTree.h" 
    3031#include "ViewCellsManager.h" 
    3132 
     
    9899{ 
    99100        // go one up in the tree 
    100         if (mCurrentNode->GetParent()) 
     101        if (mCurrentBspNode->GetParent()) 
    101102        {       cout << "]"; 
    102                 mCurrentNode = mCurrentNode->GetParent(); 
     103                mCurrentBspNode = mCurrentBspNode->GetParent(); 
    103104        } 
    104105} 
     
    213214        vector<int> objIndices; 
    214215   
    215         ViewCell *viewCell = mViewCellsManager->GenerateViewCell(); 
     216//hack!! 
     217         
     218        ViewCell *viewCell = new ViewCellInterior();//mViewCellsManager->GenerateViewCell(); 
     219        viewCell->mIsActive = true; 
     220 
    216221        mViewCells.push_back(viewCell); 
    217  
     222         
    218223        for (int i = 0; i < len; ++ i)  
    219224        { 
     
    316321{ 
    317322        BspLeaf * leaf =  
    318                 new BspLeaf(dynamic_cast<BspInterior *>(mCurrentNode), NULL); 
    319  
    320         if (mCurrentNode) // replace front or (if not NULL) back child 
    321         { 
    322                 dynamic_cast<BspInterior *>(mCurrentNode)->ReplaceChildLink(NULL, leaf); 
     323                new BspLeaf(dynamic_cast<BspInterior *>(mCurrentBspNode), NULL); 
     324 
     325        if (mCurrentBspNode) // replace front or (if not NULL) back child 
     326        { 
     327                dynamic_cast<BspInterior *>(mCurrentBspNode)->ReplaceChildLink(NULL, leaf); 
    323328        } 
    324329        else 
     
    353358        } 
    354359 
     360         
    355361        if (viewCellId >= 0) // valid view cell 
    356362        { 
    357363                // TODO: get view cell with specified id 
    358                 BspViewCell dummyVc; 
     364                ViewCellInterior dummyVc; 
    359365                dummyVc.SetId(viewCellId); 
    360366 
     
    362368                        lower_bound(mViewCells.begin(), mViewCells.end(), &dummyVc, vlt); 
    363369                         
    364                 BspViewCell *viewCell = dynamic_cast<BspViewCell *>(*vit); 
     370                ViewCellInterior *viewCell = dynamic_cast<ViewCellInterior *>(*vit); 
     371 
     372                // giant hack!! 
     373                BspViewCell *l = dynamic_cast<BspViewCell *>(mViewCellsManager->GenerateViewCell()); 
     374                viewCell->SetupChildLink(l); 
    365375 
    366376                if (viewCell->GetId() == viewCellId) 
    367377                { 
    368                         leaf->SetViewCell(viewCell); 
     378                        leaf->SetViewCell(l); 
     379                        l->mLeaf = leaf; 
    369380                } 
    370381                else 
     
    405416        BspInterior* interior = new BspInterior(plane); 
    406417         
    407         if (mCurrentNode) // replace NULL child of parent with current node 
    408         { 
    409                 BspInterior *current = dynamic_cast<BspInterior *>(mCurrentNode); 
     418        if (mCurrentBspNode) // replace NULL child of parent with current node 
     419        { 
     420                BspInterior *current = dynamic_cast<BspInterior *>(mCurrentBspNode); 
    410421 
    411422                current->ReplaceChildLink(NULL, interior); 
     
    424435        } 
    425436 
    426         mCurrentNode = interior; 
     437        mCurrentBspNode = interior; 
    427438} 
    428439 
     
    436447 
    437448                mBspTree = new BspTree(); 
    438                 mCurrentNode = mBspTree->GetRoot(); 
     449                mBspTree->mBox = mViewSpaceBox; 
     450                mCurrentBspNode = mBspTree->GetRoot(); 
    439451 
    440452                mViewCellsManager = new BspViewCellsManager(mBspTree); 
     
    445457 
    446458                mVspBspTree = new VspBspTree(); 
    447                 mCurrentNode = mVspBspTree->GetRoot(); 
     459                mCurrentBspNode = mVspBspTree->GetRoot(); 
    448460 
    449461                mViewCellsManager = new VspBspViewCellsManager(mVspBspTree); 
    450462 
     463                mVspBspTree->mBox = mViewSpaceBox; 
    451464                Debug << "creating vsp bsp view cells manager" << endl; 
    452465        } 
    453         /*else if (strcmp(name, "vspKdTree") == 0) 
    454         { 
    455                 mVspKdTree = new VspKdTree();            
    456          
    457                 mViewCellsManager = VspKdViewCellsManager(mVspKdTree); 
    458         }*/ 
     466        else if (strcmp(name, "vspKdTree") == 0) 
     467        { 
     468                // TODO 
     469                mVspKdTree = new VspKdTree();    
     470                mViewCellsManager = new VspKdViewCellsManager(mVspKdTree); 
     471        } 
    459472        else 
    460473        { 
Note: See TracChangeset for help on using the changeset viewer.