Changeset 871 for GTP/trunk/Lib
- Timestamp:
- 05/02/06 11:14:52 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r863 r871 1673 1673 "true"); 1674 1674 1675 RegisterOption("Preprocessor.exportVisibility", 1676 optBool, 1677 "preprocessor_export_visibility", 1678 "true"); 1679 1680 RegisterOption("Preprocessor.visibilityFile", 1681 optString, 1682 "preprocessor_visibility_file=", 1683 "visibility.xml"); 1684 1685 RegisterOption("Preprocessor.applyVisibilityFilter", 1686 optBool, 1687 "preprocessor_apply_filter", 1688 "true"); 1689 1690 1675 1691 1676 1692 /**************************************************************************************/ -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r863 r871 841 841 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 842 842 843 ViewCell *viewcell ;843 ViewCell *viewcell = NULL; 844 844 845 845 PrVs prvs; 846 846 847 if (!useFilter) 847 if (!useFilter) { 848 848 viewcell = mViewCellsManager->GetViewCell(mViewPoint); 849 else {849 } else { 850 850 // mViewCellsManager->SetMaxFilterSize(1); 851 851 mViewCellsManager->GetPrVS(mViewPoint, prvs); -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r859 r871 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: út 2 5. IV 12:50:3820063 # Generated by qmake (2.00a) (Qt 4.1.2) on: út 2. V 11:07:44 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r870 r871 127 127 environment->GetBoolValue("Preprocessor.computeVisibility", mComputeVisibility); 128 128 environment->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace); 129 129 environment->GetBoolValue("Preprocessor.exportVisibility", mExportVisibility ); 130 131 char buffer[256]; 132 environment->GetStringValue("Preprocessor.visibilityFile", buffer); 133 mVisibilityFileName = buffer; 134 environment->GetBoolValue("Preprocessor.visibilityFile", mApplyVisibilityFilter ); 135 130 136 Debug << "detect empty view space=" << mDetectEmptyViewSpace << endl; 131 137 Debug << "load polygons as meshes: " << mLoadPolygonsAsMeshes << endl; … … 255 261 Preprocessor::ExportPreprocessedData(const string filename) 256 262 { 257 return false; 258 } 263 264 mViewCellsManager->ExportViewCells(filename, 265 true); 266 267 return true; 268 } 269 270 bool 271 Preprocessor::PostProcessVisibility() 272 { 273 274 if (mApplyVisibilityFilter) { 275 cout<<"Applying visibility filter..."; 276 mViewCellsManager->ApplyFilter(mKdTree, 277 0.05f, 278 0.05f); 279 cout<<"done."; 280 } 281 282 // export the preprocessed information to a file 283 if (mExportVisibility) 284 ExportPreprocessedData(mVisibilityFileName); 285 286 return true; 287 } 288 259 289 260 290 bool -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r860 r871 69 69 */ 70 70 virtual bool ComputeVisibility() = 0; 71 71 72 /** Post Process the computed visibility. By default applys the visibility filter 73 (if specified in the environment and export the preprocessed data */ 74 virtual bool PostProcessVisibility(); 75 72 76 /** View cells are either loaded or prepared for generation, according to the chosen environment 73 77 object. Important evironment options are, e.g, the view cell type. … … 163 167 bool mComputeVisibility; 164 168 169 bool mExportVisibility; 170 string mVisibilityFileName; 171 172 bool mApplyVisibilityFilter; 173 165 174 GlRendererBuffer *GetRenderer() { return renderer;} 166 175 -
GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.cpp
r863 r871 26 26 mPreprocessor->ComputeVisibility(); 27 27 // mPreprocessor->ExportPreprocessedData("scene.vis"); 28 mPreprocessor->PostProcessVisibility(); 28 29 } 29 30 -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r863 r871 512 512 SimpleRayContainer rays; 513 513 514 cout<<"Generating initial rays..."<<endl; 514 cout<<"Generating initial rays..."<<endl<<flush; 515 515 516 GenerateRays(mInitialSamples/4, SPATIAL_BOX_BASED_DISTRIBUTION, rays); 516 517 GenerateRays(mInitialSamples/4, OBJECT_BASED_DISTRIBUTION, rays); … … 518 519 GenerateRays(mInitialSamples/4, OBJECT_DIRECTION_BASED_DISTRIBUTION, rays); 519 520 520 cout<<"Casting initial rays..."<<endl ;521 cout<<"Casting initial rays..."<<endl<<flush; 521 522 CastRays(rays, mVssRays); 522 523 … … 546 547 if (mUseViewcells) { 547 548 548 cout<<"Computing sample contributions..."<<endl ;549 cout<<"Computing sample contributions..."<<endl<<flush; 549 550 // evaluate contributions of the intitial rays 550 551 mViewCellsManager->ComputeSampleContributions(mVssRays, true, false); 551 cout<<"done.\n" ;552 cout<<"done.\n"<<flush; 552 553 553 554 mStats << … … 802 803 803 804 804 cout<<"Applying visibility filter..."; 805 mViewCellsManager->ApplyFilter(mKdTree, 806 0.05f, 807 0.05f); 808 cout<<"done."; 805 // mViewCellsManager->ExportViewCells("visibility.xml", 806 // true); 807 809 808 810 809 return true; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r870 r871 1856 1856 1857 1857 1858 bool ViewCellsManager::ExportViewCells(const string filename )1858 bool ViewCellsManager::ExportViewCells(const string filename, const bool exportPvs) 1859 1859 { 1860 1860 return false; … … 2272 2272 char filename[100]; 2273 2273 environment->GetStringValue("ViewCells.filename", filename); 2274 ExportViewCells(filename );2274 ExportViewCells(filename, mExportPvs); 2275 2275 } 2276 2276 … … 2719 2719 2720 2720 2721 bool BspViewCellsManager::ExportViewCells(const string filename )2721 bool BspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs) 2722 2722 { 2723 2723 cout << "exporting view cells to xml ... "; … … 2745 2745 stream << "<ViewCells>" << endl; 2746 2746 2747 mViewCellsTree->Export(stream, mExportPvs);2747 mViewCellsTree->Export(stream, exportPvs); 2748 2748 2749 2749 stream << "</ViewCells>" << endl; … … 3964 3964 char filename[100]; 3965 3965 environment->GetStringValue("ViewCells.filename", filename); 3966 ExportViewCells(filename );3966 ExportViewCells(filename, mExportPvs); 3967 3967 } 3968 3968 … … 4710 4710 4711 4711 4712 bool VspBspViewCellsManager::ExportViewCells(const string filename )4712 bool VspBspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs) 4713 4713 { 4714 4714 cout << "exporting view cells to xml ... "; … … 4735 4735 stream << "<ViewCells>" << endl; 4736 4736 4737 mViewCellsTree->Export(stream, mExportPvs);4737 mViewCellsTree->Export(stream, exportPvs); 4738 4738 4739 4739 stream << "</ViewCells>" << endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r870 r871 307 307 /** Writes view cells to disc. 308 308 */ 309 virtual bool ExportViewCells(const string filename );309 virtual bool ExportViewCells(const string filename, const bool exportPvs); 310 310 311 311 /** Casts beam to collect view cells. … … 435 435 bool LoadBoundingBoxes(const string filename, IndexedBoundingBoxContainer &boxes) const; 436 436 437 bool GetExportPvs() const { 438 return mExportPvs; 439 } 437 440 438 441 /** Loads view cells from file. The view cells manager is created with … … 678 681 void Finalize(ViewCell *viewCell, const bool createMesh); 679 682 680 bool ExportViewCells(const string filename );683 bool ExportViewCells(const string filename, const bool exportPvs); 681 684 682 685 /** Constructs merge hierarchy which corresponds to the spatial hierarchy. … … 886 889 void CreateMesh(ViewCell *vc); 887 890 888 bool ExportViewCells(const string filename );891 bool ExportViewCells(const string filename, const bool exportPvs); 889 892 890 893 int CastBeam(Beam &beam); -
GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
r863 r871 627 627 VssRayContainer dummies; 628 628 mViewCellsManager->Visualize(mObjects, dummies); 629 mViewCellsManager->ExportViewCells("test.xml" );629 mViewCellsManager->ExportViewCells("test.xml", mViewCellsManager->GetExportPvs()); 630 630 } 631 631 -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r859 r871 9 9 # filename vienna.x3d 10 10 # filename ../data/vienna/vienna-simple.x3d 11 #filename ../data/vienna/vienna-buildings.x3d11 filename ../data/vienna/vienna-buildings.x3d 12 12 #filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-plane.x3d;../data/vienna/vienna-roads.x3d 13 13 # filename ../data/vienna/viewcells-25-sel.x3d 14 filename ../data/atlanta/atlanta2.x3d14 #filename ../data/atlanta/atlanta2.x3d 15 15 #filename ../data/soda/soda.dat 16 16 #filename ../data/soda/soda5.dat … … 89 89 90 90 RssPreprocessor { 91 samplesPerPass 100000091 samplesPerPass 500000 92 92 initialSamples 1000000 93 vssSamples 100000093 vssSamples 2000000 94 94 vssSamplesPerPass 1000000 95 95 useImportanceSampling false … … 274 274 # filename ../scripts/viewcells_atlanta.xml 275 275 # filename ../data/soda/soda5-viewcells2.xml 276 filename ../data/atlanta/viewcells_atlanta3.xml277 #filename ../data/vienna/viewcells_vienna.xml276 # filename ../data/atlanta/viewcells_atlanta3.xml 277 filename ../data/vienna/viewcells_vienna.xml 278 278 # filename ../data/PowerPlant/power_plant_viewcells_all3.xml 279 279 } -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r863 r871 63 63 else 64 64 if (preprocessorType == "render") 65 ;//p = new RenderSampler();65 p = new RenderSampler(); 66 66 else { 67 67 cerr<<"Unknown preprocessor type"<<endl;
Note: See TracChangeset
for help on using the changeset viewer.