Changeset 931 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 05/08/06 18:57:11 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r904 r931 15 15 #include "VssPreprocessor.h" 16 16 #include "RssPreprocessor.h" 17 #include "BoundingBoxConverter.h" 18 17 19 18 20 namespace GtpVisibilityPreprocessor { … … 1858 1860 1859 1861 1860 bool ViewCellsManager::ExportViewCells(const string filename, const bool exportPvs )1862 bool ViewCellsManager::ExportViewCells(const string filename, const bool exportPvs, const ObjectContainer &objects) 1861 1863 { 1862 1864 return false; … … 1956 1958 IndexedBoundingBoxContainer &boxes) const 1957 1959 { 1958 // HACK: needed only for lower_bound algorithm to find the1959 // intersected objects1960 1961 1960 Vector3 bmin, bmax; 1962 1961 int id; … … 2021 2020 } 2022 2021 2022 2023 float ViewCellsManager::GetFilterWidth() 2024 { 2025 return mFilterWidth; 2026 } 2027 2028 2029 float ViewCellsManager::GetAbsFilterWidth() 2030 { 2031 return Magnitude(mViewSpaceBox.Size()) * mFilterWidth; 2032 } 2033 2034 2035 bool ViewCellsManager::ExportBoundingBoxes(ofstream &xmlstream, 2036 const ObjectContainer &objects) const 2037 { 2038 //-- export the view cells and the pvs 2039 xmlstream << "<BoundingBoxes>" << endl; 2040 2041 ObjectContainer::const_iterator oit, oit_end = objects.end(); 2042 2043 for (oit = objects.begin(); oit != oit_end; ++ oit) 2044 { 2045 MeshInstance *mi = dynamic_cast<MeshInstance *>(*oit); 2046 const AxisAlignedBox3 box = mi->GetBox(); 2047 2048 //-- the bounding boxes 2049 xmlstream << "<BoundingBox" << " id=\"" << mi->GetId() << "\"" 2050 << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\"" 2051 << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl; 2052 } 2053 2054 xmlstream << "</BoundingBoxes>" << endl; 2055 2056 return true; 2057 } 2058 2059 2023 2060 /**********************************************************************/ 2024 /* BspViewCellsManager implementation*/2061 /* BspViewCellsManager implementation */ 2025 2062 /**********************************************************************/ 2026 2063 … … 2282 2319 char filename[100]; 2283 2320 environment->GetStringValue("ViewCells.filename", filename); 2284 ExportViewCells(filename, mExportPvs );2321 ExportViewCells(filename, mExportPvs, objects); 2285 2322 } 2286 2323 2287 2324 // export bounding boxes 2288 if ( mExportBboxesForPvs)2325 if (0 && mExportBboxesForPvs) 2289 2326 { 2290 2327 char filename[100]; … … 2729 2766 2730 2767 2731 bool BspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs )2768 bool BspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs, const ObjectContainer &objects) 2732 2769 { 2733 2770 cout << "exporting view cells to xml ... "; … … 3974 4011 char filename[100]; 3975 4012 environment->GetStringValue("ViewCells.filename", filename); 3976 ExportViewCells(filename, mExportPvs );4013 ExportViewCells(filename, mExportPvs, objects); 3977 4014 } 3978 4015 … … 4687 4724 4688 4725 ViewCellsManager *ViewCellsManager::LoadViewCells(const string filename, 4689 ObjectContainer *objects) 4726 ObjectContainer *objects, 4727 BoundingBoxConverter *bconverter) 4690 4728 { 4691 4729 ViewCellsParser parser; … … 4695 4733 Debug << "vc filename: " << filename << endl; 4696 4734 4697 if (parser.ParseFile(filename, &vm, objects)) 4735 //BoundingBoxConverter bconverter; 4736 4737 if (parser.ParseFile(filename, &vm, objects, bconverter)) 4698 4738 { 4699 4739 //vm->PrepareLoadedViewCells(); … … 4719 4759 4720 4760 4721 4722 bool VspBspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs) 4761 bool VspBspViewCellsManager::ExportViewCells(const string filename, 4762 const bool exportPvs, 4763 const ObjectContainer &objects) 4723 4764 { 4724 4765 cout << "exporting view cells to xml ... "; … … 4737 4778 << " max=\"" << mViewSpaceBox.Max().x << " " << mViewSpaceBox.Max().y << " " << mViewSpaceBox.Max().z << "\" />" << endl; 4738 4779 4739 4780 ExportBoundingBoxes(stream, objects); 4740 4781 4741 4782 //-- the type of the view cells hierarchy … … 4750 4791 4751 4792 4752 //-- export the hierarchy4793 //-- export the spatial hierarchy 4753 4794 stream << "<Hierarchy>" << endl; 4754 4795 mVspBspTree->Export(stream);
Note: See TracChangeset
for help on using the changeset viewer.