Changeset 2119 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 02/15/07 14:45:30 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r2115 r2119 365 365 { 366 366 friend class ViewCellsParseHandlers; 367 friend class ObjectsParseHandlers; 367 368 friend class HierarchyManager; 368 369 -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
r2042 r2119 236 236 237 237 while (fgets(str, 1000, file) != NULL) 238 {++ line; 238 { 239 ++ line; 239 240 switch (str[0]) 240 241 { 241 242 case 'v': // vertex or normal 242 243 { 243 switch (str[1]) { 244 switch (str[1]) 245 { 244 246 case 'n' : 245 246 247 // normal do nothing 248 break; 247 249 default: 248 249 250 251 //cout << "vertex: " << vertices.back() << endl;250 float x, y, z; //cout << "v"; 251 sscanf(str + 1, "%f %f %f", &x, &y, &z); 252 vertices.push_back(Vector3(x,y,z)); 253 252 254 } 253 255 break; … … 258 260 { 259 261 Face *face = LoadFace(str, vertices, hashTable); 262 260 263 if (!face) break; 261 264 -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.cpp
r2115 r2119 88 88 //if (!is_sorted(mPvsObjects.begin(), mPvsObjects.end(), ilt)) 89 89 sort(mPvsObjects.begin(), mPvsObjects.end(), ilt); 90 90 Debug << "here333"; 91 91 //if (!is_sorted(mPreprocessorObjects.begin(), mPreprocessorObjects.end(), ilt)) 92 92 //sort(mPreprocessorObjects.begin(), mPreprocessorObjects.end(), ilt); … … 133 133 if (element == "Leaf") 134 134 { 135 //cout << "l";136 135 StartBvhLeaf(attributes); 137 136 } … … 196 195 } 197 196 197 198 198 void ObjectsParseHandlers::StartBvhLeaf(AttributeList& attributes) 199 199 { … … 217 217 sscanf(ptr, "%f %f %f", &maxBox.x, &maxBox.y, &maxBox.z); 218 218 } 219 /*if (attrName == "objects")219 if (attrName == "objects") 220 220 { 221 221 StartBvhLeafObjects(objects, ptr); 222 } */222 } 223 223 } 224 224 … … 227 227 BvhLeaf *leaf = new BvhLeaf(box, NULL, (int)objects.size()); 228 228 229 //leaf->mObjects = objects;230 //BvHierarchy::AssociateObjectsWithLeaf(leaf);229 leaf->mObjects = objects; 230 BvHierarchy::AssociateObjectsWithLeaf(leaf); 231 231 232 232 // new pvs object … … 370 370 371 371 GzFileInputSource isource(myFilePath); 372 Debug<<"here93" << endl; 372 373 parser->parse(isource); 373 374 #else … … 375 376 376 377 #endif 377 378 Debug<<"here932" << endl; 378 379 const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis(); 379 380 duration = endMillis - startMillis; -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.h
r2115 r2119 15 15 { 16 16 public: 17 ObjectsParser(): Parser() {} 17 18 ObjectsParser(): Parser() {} 18 19 19 20 ObjectContainer &pvsObjects,21 const ObjectContainer &preprocessorObjects);20 bool ParseObjects(const string &filename, 21 ObjectContainer &pvsObjects, 22 const ObjectContainer &preprocessorObjects); 22 23 }; 23 24 -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParserXerces.h
r2115 r2119 25 25 { 26 26 public: 27 28 friend class BvHierarchy; 27 29 28 30 // ----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2117 r2119 479 479 const int files = SplitFilenames(filename, filenames); 480 480 cout << "number of input files: " << files << endl; 481 481 482 bool result = false; 482 483 bool isObj = false; … … 533 534 534 535 result = parser->ParseFile(filename, 535 mSceneGraph->GetRoot(),536 mLoadMeshes,537 fi);538 536 mSceneGraph->GetRoot(), 537 mLoadMeshes, 538 fi); 539 539 540 cout << "loaded " << (int)mSceneGraph->GetRoot()->mGeometry.size() << " entities" << endl; 541 540 542 // only works for triangles 541 543 if (result && !mLoadMeshes) 542 544 { 543 545 cout << "exporting binary obj to " << bnFile << "... " << endl; 546 544 547 ExportBinaryObj(bnFile, mSceneGraph->GetRoot()); 548 545 549 cout << "finished" << endl; 546 550 } 547 551 548 552 delete parser; 549 }550 else if (0)551 {552 ExportBinaryObj("../data/test.bn", mSceneGraph->GetRoot());553 553 } 554 554 } … … 741 741 742 742 Environment::GetSingleton()->GetStringValue("ViewCells.filename", buf); 743 744 743 cout << "loading objects from " << buf << endl; 745 744 746 745 // load objects which will be used as pvs entries 747 746 ObjectContainer pvsObjects; 748 749 LoadObjects(buf, pvsObjects, mObjects); 747 if (0) LoadObjects(buf, pvsObjects, mObjects); 750 748 751 749 cout << "loading view cells from " << buf << endl; … … 1649 1647 { 1650 1648 ObjectsParser parser; 1651 1649 Debug << "here322 " << filename << endl; 1652 1650 const bool success = parser.ParseObjects(filename, 1653 1651 pvsObjects, -
GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorFactory.cpp
r1942 r2119 14 14 Preprocessor *PreprocessorFactory::CreatePreprocessor(const string &preprocessorType) 15 15 { 16 Debug << "here9191" << endl; 16 17 if (preprocessorType == "vss") 17 { 18 {Debug << "here21112" << endl; 18 19 return new VssPreprocessor(); 19 20 } -
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
r2105 r2119 2264 2264 2265 2265 int startIndex = (int)rays.size(); 2266 // Debug<<"B"<<flush; 2267 2266 2268 2267 AxisAlignedBox3 box = GetBBox(leaf); 2269 2268 AxisAlignedBox3 dirBox = GetDirBBox(leaf); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2117 r2119 2609 2609 } 2610 2610 #else 2611 cout<<"b";2612 2611 pvs.AddSample(obj, pdf); 2613 2612 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r2115 r2119 464 464 if (element == "BoundingBox") 465 465 { 466 // cout << "b";467 466 StartBoundingBox(attributes); 468 467 }
Note: See TracChangeset
for help on using the changeset viewer.