- Timestamp:
- 03/08/06 08:36:06 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r679 r681 3027 3027 planePoly = SplitPolygon(planePoly, epsilon); 3028 3028 3029 bool splitsGeom = (planePoly != NULL) 3030 3031 3029 3032 //-- new polygon splits all other polygons 3030 3033 for (int i = 0; i < (int)mPolys.size()/* && planePoly*/; ++ i) … … 3056 3059 else 3057 3060 { 3058 Debug << "no f! " << endl;3061 //Debug << "no f! " << endl; 3059 3062 DEL_PTR(frontPoly); 3060 3063 } … … 3066 3069 else 3067 3070 { 3068 Debug << "no b! " << endl;3071 //Debug << "no b! " << endl; 3069 3072 DEL_PTR(backPoly); 3070 3073 } … … 3073 3076 break; 3074 3077 case Polygon3::BACK_SIDE: 3075 3076 3078 back.Add(new Polygon3(mPolys[i]->mVertices), mPlanes[i]); 3077 3079 break; 3078 3080 case Polygon3::FRONT_SIDE: 3079 3080 3081 front.Add(new Polygon3(mPolys[i]->mVertices), mPlanes[i]); 3081 3082 break; 3082 3083 // only put into back container (split should have no effect ...) 3083 3084 case Polygon3::COINCIDENT: 3084 3085 back.Add(new Polygon3(mPolys[i]->mVertices), mPlanes[i]); 3086 //front.Add(CreateReversePolygon(mPolys[i]), mPlanes[i]); 3085 Debug << "error should not come here" << endl; 3086 splitsGeom = false; 3087 3088 if (DotProd(mPlanes[i].mNormal, splitPlane.mNormal > 0)) 3089 back.Add(new Polygon3(mPolys[i]->mVertices), mPlanes[i]); 3090 else 3091 front.Add(new Polygon3(mPolys[i]->mVertices), mPlanes[i]); 3087 3092 break; 3088 3093 default: … … 3102 3107 reversePlane.ReverseOrientation(); 3103 3108 front.Add(planePoly->CreateReversePolygon(), reversePlane); 3104 //front.mPolys.push_back(planePoly->CreateReversePolygon()); 3105 Debug << "plane poly!" << endl; 3106 } 3107 else 3108 Debug << "no plane poly!" << endl; 3109 3110 return planePoly != NULL; 3109 } 3110 3111 3112 return splitsGeom; 3111 3113 } 3112 3114 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r678 r681 1707 1707 if (clipPlane) 1708 1708 { 1709 BspNodeGeometry front; 1710 BspNodeGeometry back; 1711 1712 geom.SplitGeometry(front, 1713 back, 1714 *clipPlane, 1715 mViewSpaceBox, 1716 0.0001f); 1717 1718 if (back.Size() >= 3) 1719 exporter->ExportPolygons(back.GetPolys()); 1709 const int cf = Polygon3::ClassifyPlane(geom.GetPolys(), *clipPlane, 0.0001f); 1710 1711 if (cf == Polygon3::BACK_SIDE) 1712 { 1713 exporter->ExportPolygons(geom.GetPolys()); 1714 } 1715 else if (cf == Polygon3::SPLIT) 1716 { 1717 BspNodeGeometry front; 1718 BspNodeGeometry back; 1719 1720 geom.SplitGeometry(front, 1721 back, 1722 *clipPlane, 1723 mViewSpaceBox, 1724 0.0001f); 1725 1726 if (back.Valid()) 1727 exporter->ExportPolygons(back.GetPolys()); 1728 } 1720 1729 } 1721 1730 else 1722 1731 { 1723 1724 1732 exporter->ExportPolygons(geom.GetPolys()); 1725 1733 }
Note: See TracChangeset
for help on using the changeset viewer.