Changeset 975 for GTP/trunk/Lib/Vis/Preprocessing/src
- Timestamp:
- 05/22/06 18:32:12 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r971 r975 804 804 bool 805 805 Environment::ReadEnvFile(const char *envFilename) 806 { Debug << "here222 " << envFilename << endl;806 { 807 807 char buff[MaxStringLength], name[MaxStringLength]; 808 808 char *s, *t; -
GTP/trunk/Lib/Vis/Preprocessing/src/GzBinFileInputStream.cpp
r971 r975 66 66 67 67 #include "GzBinFileInputStream.h" 68 #include "common.h" 68 69 69 70 XERCES_CPP_NAMESPACE_BEGIN … … 74 75 GzBinFileInputStream::GzBinFileInputStream(const XMLCh* const fileName 75 76 , MemoryManager* const manager) : 76 77 //fSource(0) , 78 fMemoryManager(manager)77 //fSource(0) , 78 fMemoryManager(manager), 79 mCurrentPos(0) 79 80 { 80 81 // Try to open the file 81 //fSource = XMLPlatformUtils::openFile((unsignedfileName, manager); 82 //fSource = XMLPlatformUtils::openFile(fileName, manager); 83 // todo: delete xmlstring 82 84 char *myFileName = XMLString::transcode(fileName); 85 //mStream.open(myFileName, ios::binary); 83 86 mStream.open(myFileName); 84 87 } … … 86 89 GzBinFileInputStream::GzBinFileInputStream(const char* const fileName, 87 90 MemoryManager* const manager) : 88 fMemoryManager(manager) 91 fMemoryManager(manager), 92 mCurrentPos(0) 89 93 { 90 94 // Try to open the file 95 //mStream.open(fileName, ios::binary); 91 96 mStream.open(fileName); 92 97 } … … 123 128 unsigned int GzBinFileInputStream::curPos() const 124 129 { 125 return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); 130 //return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); 131 return mCurrentPos; 126 132 } 127 133 128 unsigned int 129 GzBinFileInputStream::readBytes( XMLByte* const toFill 130 , const unsigned int maxToRead) 134 unsigned int GzBinFileInputStream::readBytes(XMLByte* const toFill, 135 const unsigned int maxToRead) 131 136 { 132 137 // … … 134 139 // actually read. 135 140 // 136 //return XMLPlatformUtils::readFileBuffer(fSource, maxToRead, toFill, fMemoryManager); 137 mStream.getline((char *)toFill, maxToRead); 138 return mStream.gcount(); 141 //unsigned int result = XMLPlatformUtils::readFileBuffer(fSource, maxToRead, toFill, fMemoryManager); 142 mStream.read((char *)toFill, maxToRead); 143 144 unsigned int result = mStream.gcount(); 145 mCurrentPos = mStream.tellg(); 146 //GtpVisibilityPreprocessor::Debug << "here1001 " << maxToRead << " haha " << toFill << " " << result << endl; 147 148 return result; 139 149 } 140 150 -
GTP/trunk/Lib/Vis/Preprocessing/src/GzBinFileInputStream.h
r971 r975 61 61 62 62 XERCES_CPP_NAMESPACE_BEGIN 63 //0699/15227486 63 64 64 class /*XMLUTIL_EXPORT*/ GzBinFileInputStream : public BinInputStream 65 65 { … … 105 105 igzstream mStream; 106 106 107 unsigned int mCurrentPos; 107 108 private : 108 109 // ----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/Preprocessing/src/GzFileInputSource.cpp
r971 r975 83 83 // LocalFileInputSource: Constructors and Destructor 84 84 // --------------------------------------------------------------------------- 85 GzFileInputSource::GzFileInputSource( const XMLCh* const basePath86 , const XMLCh* const relativePath 87 ,MemoryManager* const manager)88 85 GzFileInputSource::GzFileInputSource(const XMLCh* const basePath, 86 const XMLCh* const relativePath, 87 MemoryManager* const manager) 88 : LocalFileInputSource(basePath, relativePath, manager) 89 89 { 90 90 } … … 92 92 GzFileInputSource::GzFileInputSource(const XMLCh* const filePath, 93 93 MemoryManager* const manager) 94 94 : LocalFileInputSource(filePath, manager) 95 95 { 96 96 } … … 108 108 { 109 109 GzBinFileInputStream* retStrm = new (getMemoryManager()) GzBinFileInputStream(getSystemId(), getMemoryManager()); 110 110 111 if (!retStrm->getIsOpen()) 111 112 { -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r971 r975 2759 2759 stream.open(filename.c_str()); 2760 2760 stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"<<endl; 2761 stream << "<Visibility _Solution>" << endl;2761 stream << "<VisibilitySolution>" << endl; 2762 2762 2763 2763 //-- the view space bounding box … … 2767 2767 2768 2768 //-- the type of the view cells hierarchy 2769 //stream << "<Hierarchy name=\"bspTree\" />" << endl;2769 2770 2770 // NOTE: load in vsp bsp here because bsp and vsp bsp can use same tree and vsp bsp is bug free 2771 stream << "<Hierarchy name=\"vspBspTree\" />" << endl;2771 stream << "<Hierarchy name=\"vspBspTree\" >" << endl; 2772 2772 2773 2773 //-- load the view cells itself, i.e., the ids and the pvs … … 2783 2783 stream << endl << "</Hierarchy>" << endl; 2784 2784 2785 stream << "</Visibility _Solution>" << endl;2785 stream << "</VisibilitySolution>" << endl; 2786 2786 stream.close(); 2787 2787 … … 4715 4715 4716 4716 ViewCellsManager *vm = NULL; 4717 Debug << "here98 " << filename << endl; 4717 4718 4718 if (parser.ParseFile(filename, &vm, objects, bconverter, env)) 4719 4719 { … … 4763 4763 4764 4764 stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"<<endl; 4765 stream << "<Visibility _Solution>" << endl;4765 stream << "<VisibilitySolution>" << endl; 4766 4766 4767 4767 //-- the view space bounding box … … 4791 4791 4792 4792 //-- export the view cells and the pvs 4793 stream << "<HierarchyType name=\"vspBspTree\" />" << endl; 4794 4793 4795 const int numViewCells = mCurrentViewCellsStats.viewCells; 4794 4796 … … 4803 4805 4804 4806 // the type of the view cells hierarchy 4805 stream << "<Hierarchy name=\"vspBspTree\" />" << endl;4807 stream << "<Hierarchy>" << endl; 4806 4808 mVspBspTree->Export(stream); 4807 4809 stream << endl << "</Hierarchy>" << endl; 4808 4810 4809 4810 4811 stream << "</Visibility_Solution>" << endl; 4811 stream << "</VisibilitySolution>" << endl; 4812 4812 4813 4813 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r974 r975 83 83 , mBoundingBoxConverter(bconverter) 84 84 , mEnvironment(env) 85 {Debug << "here22" << endl; 86 // mObjects = objects; 85 { 87 86 } 88 87 … … 117 116 else 118 117 { 119 if (element == "Interior")118 if (element == "Interior") 120 119 EndBspInterior(); 121 120 } … … 127 126 // go one up in the tree 128 127 if (mCurrentBspNode->GetParent()) 129 { Debug << " öaaaaaaaaaaaa]";128 { Debug << "]"; 130 129 mCurrentBspNode = mCurrentBspNode->GetParent(); 131 130 } … … 153 152 // sort view cells to help associating view cells according to their id 154 153 stable_sort(mViewCells.begin(), mViewCells.end(), vlt); 154 mParseViewCells = false; 155 155 } 156 156 … … 165 165 mBoundingBoxConverter->IdentifyObjects(mIBoundingBoxes, *mObjects); 166 166 167 Debug << "\nconverted bounding boxes to objects in "167 Debug << "\nconverted bounding boxes to objects in " 168 168 << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 169 169 } … … 210 210 void ViewCellsParseHandlers::startElement(const XMLCh* const name, 211 211 AttributeList& attributes) 212 { Debug << "here722" << endl;212 { 213 213 StrX lname(name); 214 214 string element(lname.LocalForm()); 215 215 216 // decides the used view cell hierarchy 216 217 217 if (element == "ViewCells") 218 218 { … … 221 221 } 222 222 223 if (element == "Hierarchy") 224 { 225 Debug << "parsing spatial hierarchy" << endl; 226 mParseViewCells = false; 223 // decides about the view cell hierarchy 224 if (element == "HierarchyType") 225 //if (element == "Hierarchy") 226 { 227 //Debug << "parsing spatial hierarchy" << endl; 228 //mParseViewCells = false; 227 229 StartHierarchy(attributes); 228 230 } … … 242 244 } 243 245 244 // use different methods for the given view cell hierarchy types246 245 247 if (!mParseViewCells) 246 248 { 249 //-- use different methods for the given view cell hierarchy types 247 250 if (mViewCellsManager) 248 251 { … … 262 265 else 263 266 { 267 // interiors + leaves interpreted view cells else 264 268 if (element == "Interior") 265 269 { … … 620 624 mViewCellsManager = new BspViewCellsManager(mBspTree, mEnvironment); 621 625 } 622 else if (strcmp(name, "vspBspTree") == 0) 623 { 624 Debug << "view cell type: VspBsp" << endl; 625 626 mVspBspTree = new VspBspTree(); 627 //mCurrentBspNode = mVspBspTree->GetRoot(); 628 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, mEnvironment); 629 630 mVspBspTree->mBox = mViewSpaceBox; 631 } 626 632 627 else if (strcmp(name, "vspKdTree") == 0) 633 628 { … … 637 632 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree, mEnvironment); 638 633 } 639 else 640 { 641 cerr << "Wrong view cells type: " << name << endl; 642 exit(1); 634 else // vspBspTree 635 { 636 Debug << "view cell type: VspBsp" << endl; 637 638 mVspBspTree = new VspBspTree(); 639 //mCurrentBspNode = mVspBspTree->GetRoot(); 640 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, mEnvironment); 641 642 mVspBspTree->mBox = mViewSpaceBox; 643 643 } 644 644 … … 720 720 } 721 721 722 Debug << "here2" << endl;723 722 // 724 723 // Create a SAX parser object. Then, according to what we were told on … … 759 758 760 759 GzFileInputSource isource(myFilePath); 761 Debug << "here4" << endl;762 760 parser->parse(isource); 763 761
Note: See TracChangeset
for help on using the changeset viewer.