Changeset 681


Ignore:
Timestamp:
03/08/06 08:36:06 (18 years ago)
Author:
mattausch
Message:

debug version

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp

    r679 r681  
    30273027        planePoly = SplitPolygon(planePoly, epsilon); 
    30283028 
     3029        bool splitsGeom = (planePoly != NULL) 
     3030 
     3031 
    30293032        //-- new polygon splits all other polygons 
    30303033        for (int i = 0; i < (int)mPolys.size()/* && planePoly*/; ++ i) 
     
    30563059                                        else 
    30573060                                        { 
    3058                                                 Debug << "no f! " << endl; 
     3061                                                //Debug << "no f! " << endl; 
    30593062                                                DEL_PTR(frontPoly); 
    30603063                                        } 
     
    30663069                                        else 
    30673070                                        { 
    3068                                                 Debug << "no b! " << endl; 
     3071                                                //Debug << "no b! " << endl; 
    30693072                                                DEL_PTR(backPoly); 
    30703073                                        } 
     
    30733076                                break; 
    30743077                        case Polygon3::BACK_SIDE: 
    3075                  
    30763078                                back.Add(new Polygon3(mPolys[i]->mVertices), mPlanes[i]); 
    30773079                                break; 
    30783080                        case Polygon3::FRONT_SIDE: 
    3079  
    30803081                                front.Add(new Polygon3(mPolys[i]->mVertices), mPlanes[i]); 
    30813082                                break; 
    30823083                        // only put into back container (split should have no effect ...) 
    30833084                        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]); 
    30873092                                break; 
    30883093                        default: 
     
    31023107                reversePlane.ReverseOrientation(); 
    31033108                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; 
    31113113} 
    31123114 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r678 r681  
    17071707        if (clipPlane) 
    17081708        { 
    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                } 
    17201729        } 
    17211730        else 
    17221731        { 
    1723                  
    17241732                exporter->ExportPolygons(geom.GetPolys()); 
    17251733        } 
Note: See TracChangeset for help on using the changeset viewer.