Ignore:
Timestamp:
05/18/08 00:30:13 (16 years ago)
Author:
mattausch
Message:

fixed several problems

File:
1 edited

Legend:

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

    r2681 r2686  
    5959 
    6060 
     61static string GetViewPointsListName(const string &filename) 
     62{ 
     63        string viewCellPointsFile; 
     64 
     65        char buff[200]; 
     66        Environment::GetSingleton()->GetStringValue("ViewCells.randomViewPointsList", buff); 
     67 
     68        string vpList(buff); 
     69 
     70        if (vpList == "") 
     71        { 
     72                // if not specified, take file that has same prefix as scene file 
     73                if (strstr(filename.c_str(), ".obj")) 
     74                        viewCellPointsFile = ReplaceSuffix(filename, ".obj", ".vc"); 
     75                else if (strstr(filename.c_str(), ".dat")) 
     76                        viewCellPointsFile = ReplaceSuffix(filename, ".dat", ".vc"); 
     77                else if (strstr(filename.c_str(), ".x3d")) 
     78                        viewCellPointsFile = ReplaceSuffix(filename, ".x3d", ".vc"); 
     79        } 
     80        else 
     81        { 
     82                viewCellPointsFile = vpList; 
     83        } 
     84 
     85        return viewCellPointsFile; 
     86} 
     87 
    6188 
    6289void Cleanup() 
     
    240267                cout << "view cells successfully loaded" << endl; 
    241268 
    242         string viewCellPointsFile; 
    243  
    244         if (strstr(filename.c_str(), ".obj")) 
    245                 viewCellPointsFile = ReplaceSuffix(filename, ".obj", ".vc"); 
    246         else if (strstr(filename.c_str(), ".dat")) 
    247                 viewCellPointsFile = ReplaceSuffix(filename, ".dat", ".vc"); 
    248         else if (strstr(filename.c_str(), ".x3d")) 
    249                 viewCellPointsFile = ReplaceSuffix(filename, ".x3d", ".vc"); 
     269 
     270        const string viewCellPointsFile = GetViewPointsListName(filename); 
    250271 
    251272        bool importRandomViewCells; 
    252         Environment::GetSingleton()->GetBoolValue("ViewCells.importRandomViewCells", 
    253                 importRandomViewCells); 
     273        Environment::GetSingleton()->GetBoolValue("ViewCells.importRandomViewCells", importRandomViewCells); 
    254274 
    255275        if (importRandomViewCells) 
    256276        { 
    257                 cout << "importing random view cells" << endl; 
     277                cout << "importing random view points" << endl; 
     278 
    258279                if (preprocessor->mViewCellsManager->ImportViewCellsList(viewCellPointsFile)) 
    259280                        cout << "successfully loaded " << viewCellPointsFile << endl; 
    260281                else 
    261                         cerr << "error: file << " << viewCellPointsFile << " not found, generating random view points!" << endl; 
     282                        cerr << "error: file << " << viewCellPointsFile << " not found" << endl; 
    262283        } 
    263284 
     
    369390                        //rendererWidget->SetWindowTitle("Global Visualization"); 
    370391 
    371                         if (1) // not working with vbo 
     392                        if (0 && !rendererWidget->GetUseVbos()) // viewer not working with vbo 
    372393                        { 
    373394                                cout << "starting the qt viewer" << endl; 
Note: See TracChangeset for help on using the changeset viewer.