Changeset 2677 for GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
- Timestamp:
- 05/14/08 19:06:06 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r2643 r2677 1477 1477 1478 1478 KdLeaf *KdTree::ImportBinLeaf(IN_STREAM &stream, 1479 1480 1481 { 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 lower_bound(objects.begin(), objects.end(), (Intersectable *)&dummyInst, ilt);1500 1501 1502 leaf->mObjects.push_back(*oit);1503 1504 Debug << "error: object with id " << objId << " does not exist" << endl;1505 1506 1507 1479 KdInterior *parent, 1480 const ObjectContainer &objects) 1481 { 1482 int leafId = TYPE_LEAF; 1483 int objId = leafId; 1484 int size; 1485 1486 stream.read(reinterpret_cast<char *>(&size), sizeof(int)); 1487 KdLeaf *leaf = new KdLeaf(parent, size); 1488 1489 MeshInstance dummyInst(NULL); 1490 1491 // read object ids 1492 // note: this can also be done geometrically 1493 for (int i = 0; i < size; ++ i) 1494 { 1495 stream.read(reinterpret_cast<char *>(&objId), sizeof(int)); 1496 dummyInst.SetId(objId); 1497 1498 ObjectContainer::const_iterator oit = 1499 lower_bound(objects.begin(), objects.end(), (Intersectable *)&dummyInst, ilt); 1500 1501 if ((oit != objects.end()) && ((*oit)->GetId() == objId)) 1502 leaf->mObjects.push_back(*oit); 1503 else 1504 Debug << "error: object with id " << objId << " does not exist" << endl; 1505 } 1506 1507 return leaf; 1508 1508 } 1509 1509
Note: See TracChangeset
for help on using the changeset viewer.