Changeset 2342 for GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
- Timestamp:
- 05/02/07 17:28:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2307 r2342 229 229 230 230 231 bool Preprocessor::ExportBinaryObj(const string filename, SceneGraphNode *root)231 bool Preprocessor::ExportBinaryObj(const string &filename, SceneGraphNode *root) 232 232 { 233 233 ogzstream samplesOut(filename.c_str()); … … 266 266 267 267 268 bool Preprocessor::ExportObj(const string filename, const ObjectContainer &objects)268 bool Preprocessor::ExportObj(const string &filename, const ObjectContainer &objects) 269 269 { 270 270 ofstream samplesOut(filename.c_str()); … … 320 320 } 321 321 322 static string ReplaceSuffix( stringfilename, string a, string b)322 static string ReplaceSuffix(const string &filename, string a, string b) 323 323 { 324 324 string result = filename; … … 381 381 382 382 bool 383 Preprocessor::LoadScene(const string filename)383 Preprocessor::LoadScene(const string &filename) 384 384 { 385 385 // use leaf nodes of the original spatial hierarchy as occludees … … 533 533 534 534 bool 535 Preprocessor::ExportPreprocessedData(const string filename)535 Preprocessor::ExportPreprocessedData(const string &filename) 536 536 { 537 537 mViewCellsManager->ExportViewCells(filename, true, mObjects); … … 605 605 606 606 bool 607 Preprocessor::Export( const string filename,607 Preprocessor::Export( const string &filename, 608 608 const bool scene, 609 609 const bool kdtree … … 813 813 814 814 815 bool Preprocessor::LoadKdTree(const string filename)815 bool Preprocessor::LoadKdTree(const string &filename) 816 816 { 817 817 mKdTree = new KdTree(); … … 821 821 822 822 823 bool Preprocessor::ExportKdTree(const string filename)823 bool Preprocessor::ExportKdTree(const string &filename) 824 824 { 825 825 return mKdTree->ExportBinTree(filename.c_str()); … … 1034 1034 1035 1035 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; 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; 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 1043 1075 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 1079 bool Preprocessor::InitRayCast(const string &externKdTree, 1080 const string &internKdTree) 1081 1081 { 1082 1082 // always try to load the kd tree
Note: See TracChangeset
for help on using the changeset viewer.