Changeset 678 for GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
- Timestamp:
- 03/07/06 11:09:10 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r676 r678 186 186 mSplitCandidates = new vector<SortableEntry>; 187 187 188 Debug << "here3" << endl;189 188 Debug << endl; 190 189 } … … 463 462 464 463 // first node is kd node, i.e. an axis aligned box 465 if ( 1)464 if (0) 466 465 tData.mIsKdNode = true; 467 466 else … … 1348 1347 if (1) 1349 1348 { 1350 PolygonContainer::const_iterator it, it_end = tData.mGeometry-> mPolys.end();1351 1352 for(it = tData.mGeometry-> mPolys.begin(); it < it_end; ++ it)1349 PolygonContainer::const_iterator it, it_end = tData.mGeometry->GetPolys().end(); 1350 1351 for(it = tData.mGeometry->GetPolys().begin(); it < it_end; ++ it) 1353 1352 box.Include(*(*it)); 1354 1353 } … … 1402 1401 pos = box.Max(); pos[axis] = nPosition[axis]; 1403 1402 AxisAlignedBox3 bBox(box.Min(), pos); 1404 bBox.ExtractPolys(nBackGeom[axis]->mPolys); 1405 1403 // TODO 1404 #if 0 1405 bBox.ExtractPolys(nBackGeom[axis]->GetPolys()); 1406 #endif 1406 1407 pos = box.Min(); pos[axis] = nPosition[axis]; 1407 1408 AxisAlignedBox3 fBox(pos, box.Max()); 1408 fBox.ExtractPolys(nFrontGeom[axis]->mPolys); 1409 // TODO 1410 #if 0 1411 fBox.ExtractPolys(nFrontGeom[axis]->GetPolys()); 1412 #endif 1409 1413 } 1410 1414 else … … 1569 1573 DEL_PTR(bGeom); 1570 1574 } 1571 1572 1573 #ifdef _DEBUG 1575 1576 1577 if (lowestCost > 10) 1578 Debug << "warning!! lowest cost: " << lowestCost << endl; 1579 1580 //#ifdef _DEBUG 1574 1581 Debug << "plane lowest cost: " << lowestCost << endl; 1575 #endif1582 //#endif 1576 1583 1577 1584 if (lowestCost > mTermMaxCostRatio) … … 1716 1723 Debug << "vol f " << pFront << " b " << pBack << " p " << pOverall << endl; 1717 1724 Debug << "real vol f " << pFront << " b " << geomBack.GetVolume() << " p " << pOverall << endl; 1718 Debug << "polys f " << (int)geomFront.mPolys.size() << " b " << (int)geomFront.mPolys.size() << " data " << (int)data.mGeometry->mPolys.size() << endl;1725 Debug << "polys f " << geomFront.Size() << " b " << geomBack.Size() << " data " << data.mGeometry->Size() << endl; 1719 1726 } 1720 1727 … … 1807 1814 candidatePlane, 1808 1815 mBox, 1809 0.000000 1f);1816 0.000000001f); 1810 1817 //mEpsilon); 1811 1818 … … 1820 1827 if (1) 1821 1828 { 1822 if (pFront <= 0) 1823 { 1824 //Debug << "error f: " << pFront << endl; 1825 return 999; 1826 } 1827 1828 if (pBack <= 0) 1829 { 1830 //Debug << "error b: " << pBack << endl; 1829 if ((pFront <= 0) || (pBack <= 0) || 1830 !geomFront.Valid() || !geomBack.Valid()) 1831 { 1832 Debug << "error f: " << pFront << " b: " << pBack << endl; 1831 1833 return 999; 1832 1834 } … … 2527 2529 2528 2530 PolygonContainer candidatePolys; 2531 vector<Plane3> candidatePlanes; 2529 2532 2530 2533 // bounded planes are added to the polygons (reverse polygons 2531 // as they have to be outfacing 2534 // as they have to be outfacing) 2532 2535 for (int i = 0; i < (int)halfSpaces.size(); ++ i) 2533 2536 { … … 2537 2540 { 2538 2541 candidatePolys.push_back(p->CreateReversePolygon()); 2542 // Why? 2543 Plane3 candidatePlane = p->GetSupportingPlane(); //halfSpaces[i]; 2544 //candidatePlane.ReverseOrientation(); 2545 candidatePlanes.push_back(candidatePlane); 2546 2539 2547 DEL_PTR(p); 2540 2548 } … … 2549 2557 vertices.push_back(mBox.GetFace(i).mVertices[j]); 2550 2558 2551 candidatePolys.push_back(new Polygon3(vertices)); 2559 Polygon3 *poly = new Polygon3(vertices); 2560 2561 candidatePolys.push_back(poly); 2562 candidatePlanes.push_back(poly->GetSupportingPlane()); 2552 2563 } 2553 2564 … … 2587 2598 DEL_PTR(backPoly); 2588 2599 break; 2600 2589 2601 case Polygon3::BACK_SIDE: 2590 2602 DEL_PTR(candidatePolys[i]); … … 2599 2611 2600 2612 if (candidatePolys[i]) 2601 geom.mPolys.push_back(candidatePolys[i]); 2613 { 2614 geom.Add(candidatePolys[i], candidatePlanes[i]); 2615 // geom.mPolys.push_back(candidates[i]); 2616 } 2602 2617 } 2603 2618 } … … 2667 2682 { 2668 2683 const int cf = 2669 Polygon3::ClassifyPlane(geom-> mPolys,2684 Polygon3::ClassifyPlane(geom->GetPolys(), 2670 2685 halfSpaces[i], 2671 2686 mEpsilon); … … 2681 2696 // TODO: why is this wrong?? 2682 2697 // test all planes of current node if still adjacent 2683 for (int i = 0; (i < (int)nodeGeom.mPolys.size()) && isAdjacent; ++ i)2698 for (int i = 0; (i < nodeGeom.Size()) && isAdjacent; ++ i) 2684 2699 { 2685 Polygon3 *poly = nodeGeom. mPolys[i];2700 Polygon3 *poly = nodeGeom.GetPolys()[i]; 2686 2701 2687 2702 const int cf = 2688 Polygon3::ClassifyPlane(geom-> mPolys,2703 Polygon3::ClassifyPlane(geom->GetPolys(), 2689 2704 poly->GetSupportingPlane(), 2690 2705 mEpsilon); … … 2707 2722 BspInterior *interior = dynamic_cast<BspInterior *>(node); 2708 2723 2709 const int cf = Polygon3::ClassifyPlane(nodeGeom. mPolys,2724 const int cf = Polygon3::ClassifyPlane(nodeGeom.GetPolys(), 2710 2725 interior->GetPlane(), 2711 2726 mEpsilon); … … 2799 2814 BspInterior *interior = dynamic_cast<BspInterior *>(node); 2800 2815 2801 const int cf = Polygon3::ClassifyPlane(nodeGeom. mPolys,2816 const int cf = Polygon3::ClassifyPlane(nodeGeom.GetPolys(), 2802 2817 interior->GetPlane(), 2803 2818 mEpsilon); … … 2870 2885 2871 2886 const int cf = 2872 Polygon3::ClassifyPlane(geom. mPolys, halfspace, mEpsilon);2887 Polygon3::ClassifyPlane(geom.GetPolys(), halfspace, mEpsilon); 2873 2888 2874 2889 if (cf == Polygon3::BACK_SIDE)
Note: See TracChangeset
for help on using the changeset viewer.