Ignore:
Timestamp:
10/05/05 02:19:15 (19 years ago)
Author:
mattausch
Message:

bsp tree view cells sampling possible

File:
1 edited

Legend:

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

    r304 r308  
    1616Preprocessor::~Preprocessor() 
    1717{ 
    18   CLEAR_CONTAINER(mViewCells); 
    19   DEL_PTR(mBspTree); 
    20   DEL_PTR(mKdTree); 
    21   DEL_PTR(mRootViewCell); 
     18        DeleteViewCells(); 
     19                 
     20        DEL_PTR(mBspTree); 
     21        DEL_PTR(mKdTree); 
     22        DEL_PTR(mRootViewCell); 
    2223} 
    2324 
     
    2627{ 
    2728        return X3dParser().ParseFile(filename, mViewCells); 
     29} 
     30 
     31void Preprocessor::DeleteViewCells() 
     32{ 
     33        for (int i = 0; i < mViewCells.size(); ++ i) 
     34                delete mViewCells[i]->GetMesh(); 
     35 
     36        CLEAR_CONTAINER(mViewCells); 
    2837} 
    2938 
     
    9099        DEL_PTR(mBspTree); 
    91100        DEL_PTR(mRootViewCell); 
    92         mRootViewCell = new ViewCell(); 
     101        mRootViewCell = new ViewCell(NULL); 
    93102        mBspTree = new BspTree(mRootViewCell); 
    94103 
    95104        ObjectContainer objects; 
    96105        RayContainer rays; 
    97 ViewCellContainer dummy; 
     106 
    98107        switch (BspTree::sConstructionMethod) 
    99108        { 
     
    102111                break; 
    103112        case BspTree::SCENE_GEOMETRY: 
    104                 CLEAR_CONTAINER(mViewCells); // we generate new view cells 
     113                DeleteViewCells(); // we generate new view cells 
    105114                mSceneGraph->CollectObjects(&objects); 
    106115                mBspTree->Construct(objects, &mViewCells); 
    107116                break; 
    108117        case BspTree::RAYS: 
    109                 CLEAR_CONTAINER(mViewCells); // we generate new view cells       
     118                DeleteViewCells(); // we generate new view cells         
    110119                mBspTree->Construct(rays, &mViewCells); 
    111120                break; 
Note: See TracChangeset for help on using the changeset viewer.