Changeset 955 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 05/12/06 18:36:52 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env
r944 r955 30 30 detectEmptyViewSpace true 31 31 loadPolygonsAsMeshes false 32 applyVisibilityFilter false 33 applyVisibilitySpatialFilter false 32 34 } 33 35 -
GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna_simple.env
r942 r955 30 30 detectEmptyViewSpace true 31 31 loadPolygonsAsMeshes false 32 applyVisibilityFilter false 33 applyVisibilitySpatialFilter false 32 34 } 33 35 … … 356 358 missTolerance 6 357 359 globalCostMissTolerance 4 358 #minGlobalCostRatio 0.0000001359 minGlobalCostRatio 0.0001360 minGlobalCostRatio 0.0000001 361 #minGlobalCostRatio 0.0001 360 362 maxViewCells 5000 361 363 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r938 r955 13 13 #include <stack> 14 14 15 16 15 17 namespace GtpVisibilityPreprocessor { 18 16 19 17 20 … … 1944 1947 1945 1948 bool ViewCellsTree::Export(ofstream &stream, const bool exportPvs) 1949 //bool ViewCellsTree::Export(ogzstream &stream, const bool exportPvs) 1946 1950 { 1947 1951 // export recursivly all view cells from the root … … 1980 1984 1981 1985 1986 //void ViewCellsTree::ExportPvs(ViewCell *viewCell, ogzstream &stream) 1982 1987 void ViewCellsTree::ExportPvs(ViewCell *viewCell, ofstream &stream) 1983 1988 { … … 1992 1997 1993 1998 void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ofstream &stream, const bool exportPvs) 1999 //void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs) 1994 2000 { 1995 2001 if (viewCell->IsLeaf()) … … 2003 2009 //-- export pvs 2004 2010 if (exportPvs) 2011 { 2005 2012 ExportPvs(viewCell, stream); 2006 2013 } 2014 2007 2015 stream << "\" />" << endl; 2008 2016 //stream << " </Leaf>" << endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r938 r955 7 7 #include "Statistics.h" 8 8 #include "Material.h" 9 //namespace GtpVisibilityPreprocessor { 9 //#include "bzip2stream.hpp" 10 #include "gzstream.h" 11 12 //class ogzstream; 10 13 11 14 namespace GtpVisibilityPreprocessor { … … 25 28 class Environment; 26 29 30 27 31 /** Statistics for a view cell partition. 28 32 */ … … 436 440 /** Exports view cells to file. 437 441 */ 438 bool Export(ofstream &stream, const bool exportPvs = false); 442 bool Export(ofstream &stream, const bool exportPvs = false); 443 //bool Export(ogzstream &stream, const bool exportPvs = false); 439 444 440 445 /** Export statistics of this view cell tree. … … 541 546 */ 542 547 void ExportViewCell(ViewCell *viewCell, ofstream &stream, const bool exportPvs); 548 //void ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs); 543 549 544 550 /** Exports pvs of a view cell. 545 551 */ 546 552 void ExportPvs(ViewCell *viewCell, ofstream &stream); 553 //void ExportPvs(ViewCell *viewCell, ogzstream &stream); 547 554 548 555 -
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 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r944 r955 465 465 /** Exports bounding boxes as xml stream 466 466 */ 467 bool ExportBoundingBoxes(ofstream &xmlstream, const ObjectContainer &objects) const;467 //bool ExportBoundingBoxes(ofstream &xmlstream, const ObjectContainer &objects) const; 468 468 469 469 /** Intersects box with the tree and returns the number of intersected boxes. -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r944 r955 755 755 const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis(); 756 756 parser->parse(filename.c_str()); 757 //ogzstream stream; parser->parse(stream); 757 758 const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis(); 758 759 duration = endMillis - startMillis; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
r938 r955 8 8 #include "Mesh.h" 9 9 #include "BoundingBoxConverter.h" 10 //#include "gzstream.h" 10 11 11 12 namespace GtpVisibilityPreprocessor { … … 179 180 return target; 180 181 } 181 182 182 } 183 183 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r882 r955 3846 3846 3847 3847 bool VspBspTree::Export(ofstream &stream) 3848 //bool VspBspTree::Export(ogzstream &stream) 3848 3849 { 3849 3850 ExportNode(mRoot, stream); … … 3854 3855 3855 3856 void VspBspTree::ExportNode(BspNode *node, ofstream &stream) 3857 //void VspBspTree::ExportNode(BspNode *node, ogzstream &stream) 3856 3858 { 3857 3859 if (node->IsLeaf()) -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
r882 r955 10 10 #include "RayInfo.h" 11 11 #include "ViewCellBsp.h" 12 13 12 14 13 15 namespace GtpVisibilityPreprocessor { … … 325 327 /** Writes tree to output stream 326 328 */ 329 //bool Export(ogzstream &stream); 327 330 bool Export(ofstream &stream); 328 331 … … 691 694 692 695 /** Writes the node to disk 693 @note: should be implemented as visitor 696 @note: should be implemented as visitor. 694 697 */ 695 698 void ExportNode(BspNode *node, ofstream &stream); 699 //void ExportNode(BspNode *node, ogzstream &stream); 696 700 697 701 /** Returns estimated memory usage of tree.
Note: See TracChangeset
for help on using the changeset viewer.