Changeset 971
- Timestamp:
- 05/22/06 07:53:18 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 4 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r955 r971 1033 1033 mVisibilityManager->GetVisibilityEnvironment()->GetPreprocessorEnvironment(); 1034 1034 1035 if (!env) 1036 { 1037 std::stringstream d; 1038 d << "here454 error loading view cells: no view cells environment " << endl; 1039 LogManager::getSingleton().logMessage(d.str()); 1040 } 1041 1042 std::stringstream d; 1043 d << "filename999: " << filename.c_str(); 1044 LogManager::getSingleton().logMessage(d.str()); 1045 1035 1046 // load the view cells assigning the found objects to the pvss 1036 1047 mViewCellsManager = … … 1040 1051 { 1041 1052 std::stringstream d; 1042 d << " error loading view cells" << endl;1053 d << "here344 error loading view cells: no view cells manager " << endl; 1043 1054 LogManager::getSingleton().logMessage(d.str()); 1044 1055 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilitySceneManagerDll.cpp
r938 r971 49 49 // load visibility environment 50 50 visEnv = new GtpVisibility::VisibilityEnvironment(); 51 //visEnv->LoadEnvironment("simple.env");52 51 visManager = new GtpVisibility::VisibilityManager(visEnv); 53 52 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/src/VisibilityEnvironment.cpp
r944 r971 9 9 VisibilityEnvironment::VisibilityEnvironment() 10 10 { 11 // load debug stream11 // HACK: loading debug stream should not happen here 12 12 GtpVisibilityPreprocessor::Debug.open("debug.log"); 13 14 13 // load environment 15 14 mEnvironment = new GtpVisibilityPreprocessor::Environment(); … … 22 21 //----------------------------------------------------------------------- 23 22 bool VisibilityEnvironment::LoadEnvironment(string filename) 24 { 25 //-- parse filename into c-style argument list 26 /*char argc = 2; 27 char *argv[2]; 28 argv[0] = ""; 29 30 char fname[200]; 31 sprintf(fname, "%s", filename.c_str()); 32 argv[1] = fname; 33 34 GtpVisibilityPreprocessor::Debug << "loading environment from: " << argv[1] << endl; 35 return GtpVisibilityPreprocessor::environment->Parse(argc, argv, false); 36 */ 23 { 37 24 //-- parse environment 38 25 return mEnvironment->ReadEnvFile(filename.c_str()); -
GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj
r931 r971 183 183 </File> 184 184 <File 185 RelativePath="..\src\GzBinFileInputStream.cpp"> 186 </File> 187 <File 188 RelativePath="..\src\GzBinFileInputStream.h"> 189 </File> 190 <File 191 RelativePath="..\src\GzFileInputSource.cpp"> 192 </File> 193 <File 194 RelativePath="..\src\GzFileInputSource.h"> 195 </File> 196 <File 185 197 RelativePath="..\src\gzstream.cpp"> 186 198 </File> -
GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env
r955 r971 261 261 # filename ../data/vienna/viewcells-large-sel.x3d 262 262 # filename ../scripts/viewcells_vienna.xml 263 filename D:/svn/gametools/GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna-visibility.xml263 filename E:/svn/gametools/GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna-visibility.xml 264 264 } 265 265 -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r938 r971 804 804 bool 805 805 Environment::ReadEnvFile(const char *envFilename) 806 { 806 {Debug << "here222 " << envFilename << endl; 807 807 char buff[MaxStringLength], name[MaxStringLength]; 808 808 char *s, *t; … … 817 817 return false; 818 818 } 819 819 820 820 name[0] = '\0'; 821 821 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r955 r971 1945 1945 } 1946 1946 1947 1947 #if ZIPPED_VIEWCELLS 1948 bool ViewCellsTree::Export(ogzstream &stream, const bool exportPvs) 1949 #else 1948 1950 bool ViewCellsTree::Export(ofstream &stream, const bool exportPvs) 1949 //bool ViewCellsTree::Export(ogzstream &stream, const bool exportPvs) 1951 #endif 1950 1952 { 1951 1953 // export recursivly all view cells from the root … … 1983 1985 } 1984 1986 1985 1986 //void ViewCellsTree::ExportPvs(ViewCell *viewCell, ogzstream &stream) 1987 #if ZIPPED_VIEWCELLS 1988 void ViewCellsTree::ExportPvs(ViewCell *viewCell, ogzstream &stream) 1989 #else 1987 1990 void ViewCellsTree::ExportPvs(ViewCell *viewCell, ofstream &stream) 1991 #endif 1988 1992 { 1989 1993 ObjectPvsMap::iterator it, it_end = viewCell->GetPvs().mEntries.end(); … … 1995 1999 } 1996 2000 1997 2001 #if ZIPPED_VIEWCELLS 2002 void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs) 2003 #else 1998 2004 void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ofstream &stream, const bool exportPvs) 1999 //void ViewCellsTree::ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs) 2005 #endif 2000 2006 { 2001 2007 if (viewCell->IsLeaf()) -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r955 r971 7 7 #include "Statistics.h" 8 8 #include "Material.h" 9 //#include "bzip2stream.hpp"10 9 #include "gzstream.h" 11 10 12 //class ogzstream;13 11 14 12 namespace GtpVisibilityPreprocessor { … … 440 438 /** Exports view cells to file. 441 439 */ 440 #if ZIPPED_VIEWCELLS 441 bool Export(ogzstream &stream, const bool exportPvs = false); 442 #else 442 443 bool Export(ofstream &stream, const bool exportPvs = false); 443 //bool Export(ogzstream &stream, const bool exportPvs = false); 444 #endif 444 445 445 446 /** Export statistics of this view cell tree. … … 545 546 NOTE: should be in exporter!! 546 547 */ 547 void ExportViewCell(ViewCell *viewCell, ofstream &stream, const bool exportPvs); 548 //void ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs); 548 #if ZIPPED_VIEWCELLS 549 void ExportViewCell(ViewCell *viewCell, ogzstream &stream, const bool exportPvs); 550 #else 551 void ExportViewCell(ViewCell *viewCell, ofstream &stream, const bool exportPvs); 552 #endif 549 553 550 554 /** Exports pvs of a view cell. 551 555 */ 556 #if ZIPPED_VIEWCELLS 557 void ExportPvs(ViewCell *viewCell, ogzstream &stream); 558 #else 552 559 void ExportPvs(ViewCell *viewCell, ofstream &stream); 553 //void ExportPvs(ViewCell *viewCell, ogzstream &stream); 554 560 #endif 555 561 556 562 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r955 r971 4715 4715 4716 4716 ViewCellsManager *vm = NULL; 4717 4717 Debug << "here98 " << filename << endl; 4718 4718 if (parser.ParseFile(filename, &vm, objects, bconverter, env)) 4719 4719 { … … 4752 4752 cout << "exporting view cells to xml ... "; 4753 4753 4754 //ogzstream stream(filename.c_str()); 4754 #if ZIPPED_VIEWCELLS 4755 ogzstream stream(filename.c_str()); 4756 cout << "!!!!!!!!!!!!!!!!!!!!!!" << endl; 4757 #else 4755 4758 std::ofstream stream(filename.c_str()); 4759 #endif 4756 4760 4757 4761 // for output we need unique ids for each view cell -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r955 r971 30 30 #include "VspKdTree.h" 31 31 #include "ViewCellsManager.h" 32 #include "GzFileInputSource.h" 32 33 33 34 namespace GtpVisibilityPreprocessor { … … 82 83 , mBoundingBoxConverter(bconverter) 83 84 , mEnvironment(env) 84 { 85 {Debug << "here22" << endl; 85 86 // mObjects = objects; 86 87 } … … 126 127 // go one up in the tree 127 128 if (mCurrentBspNode->GetParent()) 128 { cout<< "]";129 { Debug << "]"; 129 130 mCurrentBspNode = mCurrentBspNode->GetParent(); 130 131 } … … 136 137 // go one up in the tree 137 138 if (mCurrentViewCell->GetParent()) 138 { cout<< "]";139 { Debug << "]"; 139 140 mCurrentViewCell = mCurrentViewCell->GetParent(); 140 141 } … … 195 196 if (element == "Interior") 196 197 { 197 cout<< "[";198 Debug << "["; 198 199 StartBspInterior(attributes); 199 200 } … … 201 202 if (element == "Leaf") 202 203 { 203 cout<< "l";204 Debug << "l"; 204 205 StartBspLeaf(attributes); 205 206 } … … 209 210 void ViewCellsParseHandlers::startElement(const XMLCh* const name, 210 211 AttributeList& attributes) 211 { 212 { Debug << "here722" << endl; 212 213 StrX lname(name); 213 214 string element(lname.LocalForm()); 214 215 215 216 // decides the used view cell hierarchy 216 217 if (element == "ViewCells") 217 218 { 218 cout<< "parsing view cells" << endl;219 Debug << "parsing view cells" << endl; 219 220 mParseViewCells = true; 220 221 } … … 222 223 if (element == "Hierarchy") 223 224 { 224 cout<< "parsing spatial hierarchy" << endl;225 Debug << "parsing spatial hierarchy" << endl; 225 226 mParseViewCells = false; 226 227 StartHierarchy(attributes); … … 230 231 if (element == "ViewSpaceBox") 231 232 { 232 cout<< "v";233 Debug << "v"; 233 234 StartViewSpaceBox(attributes); 234 235 } … … 237 238 if (element == "BoundingBox") 238 239 { 239 cout<< "b";240 Debug << "b"; 240 241 StartBoundingBox(attributes); 241 242 } … … 263 264 if (element == "Interior") 264 265 { 265 cout<< "[";266 Debug << "["; 266 267 StartViewCellInterior(attributes); 267 268 } … … 269 270 if (element == "Leaf") 270 271 { 271 cout<< "l";272 Debug << "l"; 272 273 StartViewCellLeaf(attributes); 273 274 } … … 719 720 } 720 721 721 722 Debug << "here2" << endl; 722 723 // 723 724 // Create a SAX parser object. Then, according to what we were told on … … 754 755 { 755 756 const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis(); 757 #if ZIPPED_VIEWCELLS 758 XMLCh *myFilePath = XMLString::transcode(filename.c_str()); 759 760 GzFileInputSource isource(myFilePath); 761 Debug << "here4" << endl; 762 parser->parse(isource); 763 764 #else 756 765 parser->parse(filename.c_str()); 757 //ogzstream stream; parser->parse(stream); 766 #endif 767 758 768 const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis(); 759 769 duration = endMillis - startMillis; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r955 r971 3844 3844 } 3845 3845 3846 3846 #if ZIPPED_VIEWCELLS 3847 bool VspBspTree::Export(ogzstream &stream) 3848 #else 3847 3849 bool VspBspTree::Export(ofstream &stream) 3848 //bool VspBspTree::Export(ogzstream &stream) 3850 #endif 3849 3851 { 3850 3852 ExportNode(mRoot, stream); … … 3853 3855 } 3854 3856 3855 3857 #if ZIPPED_VIEWCELLS 3858 void VspBspTree::ExportNode(BspNode *node, ogzstream &stream) 3859 #else 3856 3860 void VspBspTree::ExportNode(BspNode *node, ofstream &stream) 3857 //void VspBspTree::ExportNode(BspNode *node, ogzstream &stream) 3861 #endif 3858 3862 { 3859 3863 if (node->IsLeaf()) -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
r955 r971 327 327 /** Writes tree to output stream 328 328 */ 329 //bool Export(ogzstream &stream); 329 #if ZIPPED_VIEWCELLS 330 bool Export(ogzstream &stream); 331 #else 330 332 bool Export(ofstream &stream); 333 #endif 331 334 332 335 /** Casts beam, i.e. a 5D frustum of rays, into tree. … … 696 699 @note: should be implemented as visitor. 697 700 */ 701 #if ZIPPED_VIEWCELLS 702 void ExportNode(BspNode *node, ogzstream &stream); 703 #else 698 704 void ExportNode(BspNode *node, ofstream &stream); 699 //void ExportNode(BspNode *node, ogzstream &stream); 705 #endif 700 706 701 707 /** Returns estimated memory usage of tree. -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
r870 r971 14 14 #include <xercesc/parsers/SAXParser.hpp> 15 15 #include <xercesc/util/OutOfMemoryException.hpp> 16 16 #include <xercesc/util/BinFileInputStream.hpp> 17 17 // --------------------------------------------------------------------------- 18 18 // Includes … … 32 32 namespace GtpVisibilityPreprocessor { 33 33 34 float X3dParser::DEFAULT_VIEWCELL_HEIGHT = 5.0f; 34 35 35 36 // --------------------------------------------------------------------------- … … 537 538 } 538 539 540 /*************************************************************************/ 541 /* X3dParser implementation */ 542 /*******************+*****************************************************/ 543 544 X3dParser::X3dParser(): 545 mViewCellHeight(DEFAULT_VIEWCELL_HEIGHT) 546 {} 539 547 540 548 bool … … 916 924 { 917 925 const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis(); 926 //GzBinFileInputStream str(filename.c_str()); 927 918 928 parser->parse(filename.c_str()); 919 929 const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis(); … … 960 970 } 961 971 962 } 972 973 974 975 } -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h
r863 r971 12 12 { 13 13 public: 14 X3dParser():Parser(), mViewCellHeight(5.0f) {} 14 15 X3dParser(); 15 16 16 17 bool ParseFile(const string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false); … … 19 20 /// height of a loaded view cell 20 21 float mViewCellHeight; 22 23 static float DEFAULT_VIEWCELL_HEIGHT; 21 24 }; 22 25 -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParserXerces.h
r860 r971 20 20 class Material; 21 21 class ViewCellsManager; 22 22 23 23 24 struct ltstr -
GTP/trunk/Lib/Vis/Preprocessing/src/common.h
r865 r971 483 483 } 484 484 485 #endif 486 487 488 489 490 491 492 493 494 495 496 485 // if the view cells should be exported and inported as gzstream 486 #define ZIPPED_VIEWCELLS 1 487 488 #endif 489 490 491 492 493 494 495 496 497 498 499
Note: See TracChangeset
for help on using the changeset viewer.