Changeset 309 for trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp
- Timestamp:
- 10/05/05 14:14:35 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/main.cpp
r305 r309 34 34 p->KdTreeStatistics(cout); 35 35 36 #ifdef TEST_BSP_VIEWCELLS37 environment->GetStringValue("Scene.viewcells", buff);38 36 39 string vcFilename(buff); 37 if (p->mViewCellsType == Preprocessor::BSP_VIEW_CELLS) 38 { 39 // if BSP tree construction method needs predefined view cells 40 if (BspTree::sConstructionMethod == BspTree::VIEW_CELLS) 41 { 42 environment->GetStringValue("Scene.viewcells", buff); 43 44 string vcFilename(buff); 45 46 if (vcFilename != "") 47 p->LoadViewCells(vcFilename); 48 else 49 p->GenerateViewCells(); 40 50 41 // if BSP tree construction method needs predefined view cells 42 if (BspTree::sConstructionMethod == BspTree::VIEW_CELLS) 43 { 44 if (vcFilename != "") 45 p->LoadViewCells(vcFilename); 46 else 47 p->GenerateViewCells(); 51 Debug << "Viewcells loaded / generated. Number of view cells: " << (int)p->mViewCells.size() << endl; 52 } 53 54 p->BuildBspTree(); 55 p->BspTreeStatistics(Debug); 56 p->Export("vc_bsptree2.x3d", false, false, true); 57 58 #if 0 59 //-- export the complementary view cells 60 // i.e., the view cells not associated with leafs in the tree. 61 Exporter *exporter = Exporter::GetExporter("viewcells_compl.x3d"); 48 62 49 Debug << "Viewcells loaded / generated. Number of view cells: " << (int)p->mViewCells.size() << endl; 50 } 63 ViewCellContainer::iterator vc_compl_it; 64 ViewCellContainer vc_compl(p->mViewCells.size() + X3dExporter::foundViewCells.size()); 65 66 sort(p->mViewCells.begin(), p->mViewCells.end()); 51 67 52 p->BuildBspTree(); 53 p->BspTreeStatistics(Debug); 54 p->Export("vc_bsptree2.x3d", false, false, true); 68 vc_compl_it = set_difference(p->mViewCells.begin(), p->mViewCells.end(), 69 X3dExporter::foundViewCells.begin(), X3dExporter::foundViewCells.end(), vc_compl.begin()); 55 70 56 #if 0 57 //-- export the complementary view cells 58 // i.e., the view cells not associated with leafs in the tree. 59 Exporter *exporter = Exporter::GetExporter("viewcells_compl.x3d"); 60 61 ViewCellContainer::iterator vc_compl_it; 62 ViewCellContainer vc_compl(p->mViewCells.size() + X3dExporter::foundViewCells.size()); 63 64 sort(p->mViewCells.begin(), p->mViewCells.end()); 65 vc_compl_it = set_difference(p->mViewCells.begin(), p->mViewCells.end(), 66 X3dExporter::foundViewCells.begin(), X3dExporter::foundViewCells.end(), 67 vc_compl.begin()); 68 vc_compl.erase(vc_compl_it, vc_compl.end()); 71 vc_compl.erase(vc_compl_it, vc_compl.end()); 69 72 70 73 71 if (exporter) 72 { 73 Debug << "Exporting complementary view cells" << endl; 74 exporter->ExportViewCells(&vc_compl); // export view cells 75 delete exporter; 74 if (exporter) 75 { 76 Debug << "Exporting complementary view cells" << endl; 77 exporter->ExportViewCells(&vc_compl); // export view cells 78 delete exporter; 79 } 80 #endif 76 81 } 77 #endif78 79 #endif80 82 81 83 // p->mSceneGraph->Export("soda.x3d");
Note: See TracChangeset
for help on using the changeset viewer.