- Timestamp:
- 07/24/06 18:21:32 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r1143 r1147 1994 1994 RegisterOption("VspBspTree.Construction.maxBand", 1995 1995 optFloat, 1996 "vsp_bsp_construction_m in_band=",1996 "vsp_bsp_construction_max_band=", 1997 1997 "0.99"); 1998 1998 -
GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.h
r1133 r1147 92 92 */ 93 93 int ComputeRayIntersection(const Plane3 &splitPlane, float &t) const; 94 95 /*friend void GetRaySets(const RayInfoContainer &sourceRays, 96 const int maxSize, 97 RayInfoContainer &usedRays, 98 RayInfoContainer *savedRays) const;*/ 94 99 }; 95 100 96 97 101 } 98 99 102 #endif 100 103 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r1145 r1147 1358 1358 float &position) 1359 1359 { 1360 RayInfoContainer usedRays, savedRays; 1361 1362 /* if (mMaxTests < rays.size()) 1363 { 1364 GetRaySets(rays, mMaxTests, usedRays, savedRays); 1365 } 1366 else 1367 {*/ 1368 usedRays = rays; 1369 //} 1370 1360 1371 const float minBox = box.Min(axis); 1361 1372 const float maxBox = box.Max(axis); … … 1366 1377 const float maxBand = minBox + mMaxBand * sizeBox; 1367 1378 1368 SortSplitCandidates( rays, axis, minBand, maxBand);1379 SortSplitCandidates(usedRays, axis, minBand, maxBand); 1369 1380 1370 1381 // go through the lists, count the number of objects left and right … … 1391 1402 Intersectable::NewMail(); 1392 1403 1393 RayInfoContainer::const_iterator ri, ri_end = rays.end();1404 RayInfoContainer::const_iterator ri, ri_end = usedRays.end(); 1394 1405 1395 1406 // set all object as belonging to the front pvs … … 1486 1497 sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value); 1487 1498 1499 float currentPos; 1500 1501 // HACK: current positition is BETWEEN visibility events 1502 if ((ci + 1) != ci_end) 1503 currentPos = ((*ci).value + (*(ci + 1)).value) * 0.5f; 1504 else 1505 currentPos = (*ci).value; 1506 1488 1507 //Debug << "pos=" << (*ci).value << "\t pvs=(" << pvsl << "," << pvsr << ")" << endl; 1489 1508 //Debug << "cost= " << sum << endl; … … 1494 1513 1495 1514 minSum = sum; 1496 position = (*ci).value;1515 position = currentPos; 1497 1516 1498 1517 pvsBack = pvsl; … … 1501 1520 } 1502 1521 } 1503 1504 1522 1505 1523 // -- compute cost … … 1560 1578 //TODO: for kd split geometry already is box => only take minmax vertices 1561 1579 if (1) 1562 { 1563 // get bounding box from geometry 1580 { // get bounding box from geometry 1564 1581 tData.mGeometry->GetBoundingBox(box); 1565 1582 } … … 1572 1589 box.Include((*ri).ExtrapTermination()); 1573 1590 } 1591 1574 1592 1575 1593 int sAxis = 0; … … 1620 1638 } 1621 1639 else 1622 { 1623 //-- split plane position is spatial median 1640 { //-- split plane position is spatial median 1624 1641 1625 1642 nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1146 r1147 1448 1448 1449 1449 // HACK: current positition is BETWEEN visibility events 1450 if ( ci!= ci_end)1450 if ((ci + 1) != ci_end) 1451 1451 currentPos = ((*ci).value + (*(ci + 1)).value) * 0.5f; 1452 1452 else … … 1454 1454 1455 1455 sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value); 1456 Debug << "pos=" << (*ci).value << "\t newpos=" << currentPos << "\t pvs=(" << pvsl << "," << pvsr << ")" << "\t cost= " << sum << endl;1456 //Debug << "pos=" << (*ci).value << "\t newpos=" << currentPos << "\t pvs=(" << pvsl << "," << pvsr << ")" << "\t cost= " << sum << endl; 1457 1457 1458 1458 if (sum < minSum) … … 1461 1461 1462 1462 minSum = sum; 1463 position = (*ci).value;1463 position = currentPos; 1464 1464 1465 1465 pvsBack = pvsl; … … 1470 1470 1471 1471 1472 // 1472 //-- compute cost 1473 1473 1474 1474 const int lowerPvsLimit = mViewCellsManager->GetMinPvsSize(); … … 3292 3292 sum = voll * pvsl + volr * pvsr; 3293 3293 3294 float currentPos; 3295 3296 // HACK: current positition is BETWEEN visibility events 3297 if ((ci + 1) != ci_end) 3298 currentPos = ((*ci).mPos + (*(ci + 1)).mPos) * 0.5f; 3299 else 3300 currentPos = (*ci).mPos; 3301 3294 3302 // note matt: can happen that volr is less than zero: bug or numerical error? 3295 3303 //if (volr < 0) Debug << "warning!! " << totalVol << " " << volRightDecr << " " << volRightDecr - totalVol << endl; … … 3313 3321 volFront = volr; 3314 3322 3315 position = (*ci).mPos;3323 position = currentPos; 3316 3324 } 3317 3325 }
Note: See TracChangeset
for help on using the changeset viewer.