Changeset 955 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 05/12/06 18:36:52 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r944 r955 18 18 19 19 20 21 20 22 namespace GtpVisibilityPreprocessor { 21 23 … … 508 510 PostProcess(preprocessor->mObjects, postProcessSamples); 509 511 510 cout << "time needed for 512 cout << "time needed for post processing (merge) step: " 511 513 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 512 514 513 Debug << "time needed for 515 Debug << "time needed for post processing (merge) step: " 514 516 << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl; 515 517 … … 2037 2039 2038 2040 2039 bool ViewCellsManager::ExportBoundingBoxes(ofstream &xmlstream,2040 const ObjectContainer &objects) const2041 {2042 //-- export the view cells and the pvs2043 xmlstream << "<BoundingBoxes>" << endl;2044 2045 ObjectContainer::const_iterator oit, oit_end = objects.end();2046 2047 for (oit = objects.begin(); oit != oit_end; ++ oit)2048 {2049 MeshInstance *mi = dynamic_cast<MeshInstance *>(*oit);2050 const AxisAlignedBox3 box = mi->GetBox();2051 2052 //-- the bounding boxes2053 xmlstream << "<BoundingBox" << " id=\"" << mi->GetId() << "\""2054 << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\""2055 << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl;2056 }2057 2058 xmlstream << "</BoundingBoxes>" << endl;2059 2060 return true;2061 }2062 2063 2064 2041 /**********************************************************************/ 2065 2042 /* BspViewCellsManager implementation */ … … 2772 2749 bool BspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs, const ObjectContainer &objects) 2773 2750 { 2751 #if STILL_HAS_TODO 2774 2752 cout << "exporting view cells to xml ... "; 2775 2753 std::ofstream stream; … … 2809 2787 2810 2788 cout << "finished" << endl; 2811 2789 #endif 2812 2790 return true; 2813 2791 } … … 4773 4751 { 4774 4752 cout << "exporting view cells to xml ... "; 4775 std::ofstream stream; 4753 4754 //ogzstream stream(filename.c_str()); 4755 std::ofstream stream(filename.c_str()); 4776 4756 4777 4757 // for output we need unique ids for each view cell 4778 4758 CreateUniqueViewCellIds(); 4779 4759 4780 stream.open(filename.c_str());4781 4760 stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"<<endl; 4782 4761 stream << "<Visibility_Solution>" << endl; … … 4787 4766 << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl; 4788 4767 4789 ExportBoundingBoxes(stream, objects); 4790 4791 //-- the type of the view cells hierarchy 4792 stream << "<Hierarchy name=\"vspBspTree\" />" << endl; 4768 4769 //-- export bounding boxes 4770 stream << "<BoundingBoxes>" << endl; 4771 4772 ObjectContainer::const_iterator oit, oit_end = objects.end(); 4773 4774 for (oit = objects.begin(); oit != oit_end; ++ oit) 4775 { 4776 MeshInstance *mi = dynamic_cast<MeshInstance *>(*oit); 4777 const AxisAlignedBox3 box = mi->GetBox(); 4778 4779 //-- the bounding boxes 4780 stream << "<BoundingBox" << " id=\"" << mi->GetId() << "\"" 4781 << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\"" 4782 << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl; 4783 } 4784 4785 stream << "</BoundingBoxes>" << endl; 4786 4793 4787 4794 4788 //-- export the view cells and the pvs 4795 4789 const int numViewCells = mCurrentViewCellsStats.viewCells; 4796 4790 4797 stream << "<ViewCells number=\"" << numViewCells << "\" />" << endl;4791 stream << "<ViewCells number=\"" << numViewCells << "\" >" << endl; 4798 4792 4799 4793 mViewCellsTree->Export(stream, exportPvs); … … 4803 4797 4804 4798 //-- export the spatial hierarchy 4805 stream << "<Hierarchy>" << endl; 4799 4800 // the type of the view cells hierarchy 4801 stream << "<Hierarchy name=\"vspBspTree\" />" << endl; 4806 4802 mVspBspTree->Export(stream); 4807 4803 stream << endl << "</Hierarchy>" << endl; … … 4810 4806 4811 4807 stream << "</Visibility_Solution>" << endl; 4808 4809 4812 4810 stream.close(); 4813 4814 4811 cout << "finished" << endl; 4815 4812
Note: See TracChangeset
for help on using the changeset viewer.