Changeset 2066 for GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
- Timestamp:
- 01/31/07 01:51:57 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r2017 r2066 16 16 int KdNode::sMailId = 1; 17 17 int KdNode::sReservedMailboxes = 1; 18 18 19 19 20 inline static bool ilt(Intersectable *obj1, Intersectable *obj2) … … 178 179 179 180 180 181 181 bool 182 182 KdTree::TerminationCriteriaMet(const KdLeaf *leaf) 183 183 { 184 // cerr<<"\n OBJECTS="<<leaf->mObjects.size()<<endl; 185 return 186 ((int)leaf->mObjects.size() <= mTermMinCost) || 187 (leaf->mDepth >= mTermMaxDepth); 188 184 const bool criteriaMet = 185 ((int)leaf->mObjects.size() <= mTermMinCost) || 186 (leaf->mDepth >= mTermMaxDepth); 187 188 if (criteriaMet) 189 cerr<<"\n OBJECTS="<<leaf->mObjects.size()<<endl; 190 191 return criteriaMet; 189 192 } 190 193 … … 462 465 { 463 466 CLEAR_CONTAINER(*splitCandidates); 464 //splitCandidates->clear(); 465 466 int requestedSize = 2*(int)node->mObjects.size(); 467 // creates a sorted split candidates array 468 if (splitCandidates->capacity() > 500000 && 469 requestedSize < (int)(splitCandidates->capacity()/10) ) { 470 delete splitCandidates; 471 splitCandidates = new vector<SortableEntry *>; 467 //splitCandidates->clear(); 468 469 int requestedSize = 2*(int)node->mObjects.size(); 470 471 // creates a sorted split candidates array 472 if (splitCandidates->capacity() > 500000 && 473 requestedSize < (int)(splitCandidates->capacity()/10) ) { 474 delete splitCandidates; 475 splitCandidates = new vector<SortableEntry *>; 472 476 } 473 477 … … 477 481 for(ObjectContainer::const_iterator mi = node->mObjects.begin(); 478 482 mi != node->mObjects.end(); 479 mi++) { 480 AxisAlignedBox3 box = (*mi)->GetBox(); 481 482 splitCandidates->push_back(new SortableEntry(SortableEntry::BOX_MIN, 483 box.Min(axis), 484 *mi) 485 ); 483 mi++) 484 { 485 AxisAlignedBox3 box = (*mi)->GetBox(); 486 487 splitCandidates->push_back(new SortableEntry(SortableEntry::BOX_MIN, 488 box.Min(axis), 489 *mi) 490 ); 486 491 487 488 splitCandidates->push_back(new SortableEntry(SortableEntry::BOX_MAX, 489 box.Max(axis), 490 *mi) 491 ); 492 } 493 494 stable_sort(splitCandidates->begin(), splitCandidates->end()); 492 splitCandidates->push_back(new SortableEntry(SortableEntry::BOX_MAX, 493 box.Max(axis), 494 *mi) 495 ); 496 } 497 498 stable_sort(splitCandidates->begin(), splitCandidates->end(), iltS); 495 499 } 496 500
Note: See TracChangeset
for help on using the changeset viewer.