Changeset 683 for GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
- Timestamp:
- 03/09/06 04:27:07 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r682 r683 2511 2511 Plane3 halfSpace = dynamic_cast<BspInterior *>(interior)->GetPlane(); 2512 2512 2513 if (interior->Get Front() != lastNode)2513 if (interior->GetBack() != lastNode) 2514 2514 halfSpace.ReverseOrientation(); 2515 2515 … … 2530 2530 vector<Plane3> candidatePlanes; 2531 2531 2532 // bounded planes are added to the polygons (reverse polygons 2533 // as they have to be outfacing) 2532 // bounded planes are added to the polygons 2534 2533 for (int i = 0; i < (int)halfSpaces.size(); ++ i) 2535 2534 { … … 2538 2537 if (p->Valid(mEpsilon)) 2539 2538 { 2540 candidatePolys.push_back(p->CreateReversePolygon()); 2541 // Why? 2542 Plane3 candidatePlane = p->GetSupportingPlane(); //halfSpaces[i]; 2543 //candidatePlane.ReverseOrientation(); 2544 candidatePlanes.push_back(candidatePlane); 2545 2546 DEL_PTR(p); 2539 candidatePolys.push_back(p); 2540 candidatePlanes.push_back(halfSpaces[i]); 2547 2541 } 2548 2542 } … … 2590 2584 DEL_PTR(candidatePolys[i]); 2591 2585 2592 if ( frontPoly->Valid(mEpsilon))2593 candidatePolys[i] = frontPoly;2586 if (backPoly->Valid(mEpsilon)) 2587 candidatePolys[i] = backPoly; 2594 2588 else 2595 DEL_PTR(frontPoly); 2596 2597 DEL_PTR(backPoly); 2589 DEL_PTR(backPoly); 2590 2591 // outside, don't need this 2592 DEL_PTR(frontPoly); 2598 2593 break; 2599 2600 case Polygon3:: BACK_SIDE:2594 // polygon outside of halfspace 2595 case Polygon3::FRONT_SIDE: 2601 2596 DEL_PTR(candidatePolys[i]); 2602 2597 break; 2603 2598 // just take polygon as it is 2604 case Polygon3:: FRONT_SIDE:2599 case Polygon3::BACK_SIDE: 2605 2600 case Polygon3::COINCIDENT: 2606 2601 default: … … 2685 2680 mEpsilon); 2686 2681 2687 if (cf == Polygon3:: BACK_SIDE)2682 if (cf == Polygon3::FRONT_SIDE) 2688 2683 { 2689 2684 isAdjacent = false; … … 2704 2699 mEpsilon); 2705 2700 2706 if (cf == Polygon3:: BACK_SIDE)2701 if (cf == Polygon3::FRONT_SIDE) 2707 2702 { 2708 2703 isAdjacent = false; … … 2738 2733 mEpsilon); 2739 2734 2740 if (cf == Polygon3:: FRONT_SIDE)2741 { 2742 nodeStack.push(bspNodePair(interior->Get Front(), fGeom));2743 DEL_PTR( bGeom);2735 if (cf == Polygon3::BACK_SIDE) 2736 { 2737 nodeStack.push(bspNodePair(interior->GetBack(), bGeom)); 2738 DEL_PTR(fGeom); 2744 2739 } 2745 2740 else 2746 2741 { 2747 if (cf == Polygon3:: BACK_SIDE)2742 if (cf == Polygon3::FRONT_SIDE) 2748 2743 { 2749 nodeStack.push(bspNodePair(interior->Get Back(), bGeom));2750 DEL_PTR( fGeom);2744 nodeStack.push(bspNodePair(interior->GetFront(), fGeom)); 2745 DEL_PTR(bGeom); 2751 2746 } 2752 2747 else … … 2830 2825 mEpsilon); 2831 2826 2832 if (cf == Polygon3:: FRONT_SIDE)2833 { 2834 nodeStack.push(bspNodePair(interior->Get Front(), fGeom));2835 DEL_PTR( bGeom);2827 if (cf == Polygon3::BACK_SIDE) 2828 { 2829 nodeStack.push(bspNodePair(interior->GetBack(), bGeom)); 2830 DEL_PTR(fGeom); 2836 2831 } 2837 2832 else 2838 2833 { 2839 if (cf == Polygon3:: BACK_SIDE)2834 if (cf == Polygon3::FRONT_SIDE) 2840 2835 { 2841 nodeStack.push(bspNodePair(interior->Get Back(), bGeom));2842 DEL_PTR( fGeom);2836 nodeStack.push(bspNodePair(interior->GetFront(), fGeom)); 2837 DEL_PTR(bGeom); 2843 2838 } 2844 2839 else … … 3044 3039 3045 3040 float t; 3046 const float thresh = 1 ? 1e-6f : 0.0f; 3041 //const float thresh = 1 ? 1e-6f : 0.0f; 3042 const float thresh = 0.01f; 3047 3043 3048 3044 while (1)
Note: See TracChangeset
for help on using the changeset viewer.