Ignore:
Timestamp:
05/02/07 17:28:26 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2307 r2342  
    229229 
    230230 
    231 bool Preprocessor::ExportBinaryObj(const string filename, SceneGraphNode *root) 
     231bool Preprocessor::ExportBinaryObj(const string &filename, SceneGraphNode *root) 
    232232{ 
    233233        ogzstream samplesOut(filename.c_str()); 
     
    266266 
    267267 
    268 bool Preprocessor::ExportObj(const string filename, const ObjectContainer &objects) 
     268bool Preprocessor::ExportObj(const string &filename, const ObjectContainer &objects) 
    269269{ 
    270270        ofstream samplesOut(filename.c_str()); 
     
    320320} 
    321321 
    322 static string ReplaceSuffix(string filename, string a, string b) 
     322static string ReplaceSuffix(const string &filename, string a, string b) 
    323323{ 
    324324        string result = filename; 
     
    381381 
    382382bool 
    383 Preprocessor::LoadScene(const string filename) 
     383Preprocessor::LoadScene(const string &filename) 
    384384{ 
    385385    // use leaf nodes of the original spatial hierarchy as occludees 
     
    533533 
    534534bool 
    535 Preprocessor::ExportPreprocessedData(const string filename) 
     535Preprocessor::ExportPreprocessedData(const string &filename) 
    536536{ 
    537537        mViewCellsManager->ExportViewCells(filename, true, mObjects); 
     
    605605 
    606606bool 
    607 Preprocessor::Export( const string filename, 
     607Preprocessor::Export( const string &filename, 
    608608                                          const bool scene, 
    609609                                          const bool kdtree 
     
    813813 
    814814 
    815 bool Preprocessor::LoadKdTree(const string filename) 
     815bool Preprocessor::LoadKdTree(const string &filename) 
    816816{ 
    817817        mKdTree = new KdTree(); 
     
    821821 
    822822 
    823 bool Preprocessor::ExportKdTree(const string filename) 
     823bool Preprocessor::ExportKdTree(const string &filename) 
    824824{ 
    825825        return mKdTree->ExportBinTree(filename.c_str()); 
     
    10341034 
    10351035 
    1036 bool Preprocessor::LoadInternKdTree( const string internKdTree) 
    1037 { 
    1038   bool mUseKdTree = true; 
    1039    
    1040   if (!mUseKdTree) { 
    1041         // create just a dummy KdTree 
    1042         mKdTree = new KdTree; 
     1036bool Preprocessor::LoadInternKdTree(const string &internKdTree) 
     1037{ 
     1038        bool mUseKdTree = true; 
     1039 
     1040        if (!mUseKdTree) { 
     1041                // create just a dummy KdTree 
     1042                mKdTree = new KdTree; 
     1043                return true; 
     1044        } 
     1045 
     1046        // always try to load the kd tree 
     1047        cout << "loading kd tree file " << internKdTree << " ... " << endl; 
     1048 
     1049        if (!LoadKdTree(internKdTree)) { 
     1050                cout << "error loading kd tree with filename "  
     1051                        << internKdTree << ", rebuilding it instead ... " << endl; 
     1052                // build new kd tree from scene geometry 
     1053                BuildKdTree(); 
     1054 
     1055                // export kd tree? 
     1056                const long startTime = GetTime(); 
     1057                cout << "exporting kd tree ... "; 
     1058 
     1059                if (!ExportKdTree(internKdTree)) 
     1060                { 
     1061                        cout << " error exporting kd tree with filename "  
     1062                                << internKdTree << endl; 
     1063                } 
     1064                else 
     1065                { 
     1066                        cout << "finished in "  
     1067                                << TimeDiff(startTime, GetTime()) * 1e-3  
     1068                                << " secs" << endl; 
     1069                } 
     1070        } 
     1071 
     1072        KdTreeStatistics(cout); 
     1073        cout << mKdTree->GetBox() << endl; 
     1074 
    10431075        return true; 
    1044   } 
    1045    
    1046   // always try to load the kd tree 
    1047   cout << "loading kd tree file " << internKdTree << " ... " << endl; 
    1048    
    1049   if (!LoadKdTree(internKdTree)) { 
    1050         cout << "error loading kd tree with filename "  
    1051                  << internKdTree << ", rebuilding it instead ... " << endl; 
    1052         // build new kd tree from scene geometry 
    1053         BuildKdTree(); 
    1054          
    1055         // export kd tree? 
    1056         const long startTime = GetTime(); 
    1057         cout << "exporting kd tree ... "; 
    1058          
    1059         if (!ExportKdTree(internKdTree)) 
    1060           { 
    1061                 cout << " error exporting kd tree with filename "  
    1062                          << internKdTree << endl; 
    1063           } 
    1064         else 
    1065           { 
    1066                 cout << "finished in "  
    1067                          << TimeDiff(startTime, GetTime()) * 1e-3  
    1068                          << " secs" << endl; 
    1069           } 
    1070   } 
    1071    
    1072   KdTreeStatistics(cout); 
    1073   cout << mKdTree->GetBox() << endl; 
    1074    
    1075   return true; 
    1076 } 
    1077  
    1078  
    1079 bool Preprocessor::InitRayCast(const string externKdTree,  
    1080                                                            const string internKdTree) 
     1076} 
     1077 
     1078 
     1079bool Preprocessor::InitRayCast(const string &externKdTree,  
     1080                                                           const string &internKdTree) 
    10811081{ 
    10821082        // always try to load the kd tree 
Note: See TracChangeset for help on using the changeset viewer.