Changeset 1387 for GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
- Timestamp:
- 09/16/06 21:19:22 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r1344 r1387 193 193 float costRatio; 194 194 bool mOnlyDrivingAxis = false; 195 if (mOnlyDrivingAxis) { 195 196 if (mOnlyDrivingAxis) { 196 197 axis = box.Size().DrivingAxis(); 197 198 costRatio = BestCostRatio(leaf, … … 485 486 { 486 487 488 #define DEBUG_COST 0 489 490 #if DEBUG_COST 491 static int nodeId = -1; 492 char filename[256]; 493 494 static int lastAxis = 100; 495 if (axis <= lastAxis) 496 nodeId++; 497 498 lastAxis = axis; 499 500 sprintf(filename, "sah-cost%d-%d.log", nodeId, axis); 501 ofstream costStream; 502 503 if (nodeId < 100) 504 costStream.open(filename); 505 506 #endif 507 487 508 SortSubdivisionCandidates(node, axis); 488 509 … … 543 564 // cout<<"pos="<<(*ci).value<<"\t q=("<<ql<<","<<qr<<")\t r=("<<rl<<","<<rr<<")"<<endl; 544 565 // cout<<"cost= "<<sum<<endl; 545 566 567 #if DEBUG_COST 568 if (nodeId < 100) { 569 float oldCost = mSahUseFaces ? totalIntersections : node->mObjects.size(); 570 float newCost = mCt_div_ci + sum/boxArea; 571 float ratio = newCost/oldCost; 572 costStream<<(*ci).value<<" "<<ratio<<endl; 573 } 574 #endif 575 546 576 if (sum < minSum) { 547 577 minSum = sum;
Note: See TracChangeset
for help on using the changeset viewer.