Ignore:
Timestamp:
09/08/05 18:45:51 (19 years ago)
Author:
mattausch
Message:

added viewcell loader

File:
1 edited

Legend:

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

    r260 r261  
    77#include "Environment.h" 
    88 
    9    
    10 bool 
    11 Preprocessor::LoadViewcells(const string filename) 
     9 
     10Preprocessor::~Preprocessor() 
    1211{ 
    13    
    14   return true; 
     12  // delete view cells 
     13  while (!mViewCells.empty()) 
     14  { 
     15          DEL_PTR(mViewCells.back()); 
     16          mViewCells.pop_back(); 
     17  } 
     18 
     19  // delete psp tree 
     20  DEL_PTR(mBspTree); 
    1521} 
    1622 
    1723bool 
    18 Preprocessor::GenerateViewcells() 
     24Preprocessor::LoadViewCells(const string filename) 
     25{ 
     26        X3dParser *parser = new X3dParser; 
     27 
     28        delete parser; 
     29 
     30        bool result = parser->ParseFile(filename, mViewCells); 
     31 
     32        if (result) 
     33        { 
     34                Exporter *exporter = Exporter::GetExporter(filename); 
     35 
     36                if (exporter)  
     37                        exporter->ExportViewCells(&mViewCells); 
     38 
     39                GenerateViewCells(); 
     40        } 
     41        return result; 
     42} 
     43 
     44bool 
     45Preprocessor::GenerateViewCells() 
    1946{ 
    2047        return BuildBspTree(); 
     
    3865  bool result = parser->ParseFile(filename, &mSceneGraph->mRoot); 
    3966   
     67  delete parser; 
     68 
    4069  return result; 
    4170} 
     
    90119        { 
    91120        case BspTree::VIEWCELLS: 
    92  
    93                 mViewcells.clear(); 
     121                // derive view cells from the scene objects 
     122                //ViewCell::DeriveViewCells(objects, mViewCells, maxViewCells); 
    94123                 
    95                 // derive viewcells from the scene objects 
    96                 ViewCell::DeriveViewCells(objects, mViewcells, maxViewCells); 
    97                  
    98                 mBspTree->Construct(mViewcells); 
     124                mBspTree->Construct(mViewCells); 
    99125                break; 
    100126        case BspTree::SCENE_GEOMETRY: 
    101                 mBspTree->Construct(objects); 
     127                CLEAR_CONTAINER(mViewCells); 
     128                mBspTree->Construct(objects, &mViewCells); 
     129                break; 
     130        case BspTree::RAYS: 
     131                CLEAR_CONTAINER(mViewCells); 
     132                mBspTree->Construct(objects, &mViewCells); 
    102133                break; 
    103134        default: 
Note: See TracChangeset for help on using the changeset viewer.