Ignore:
Timestamp:
09/19/05 03:47:29 (19 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r289 r290  
    185185Debug << "*************\n"; 
    186186Debug << "initial poly\n" << *poly << endl; 
    187                                 //-- split polygon 
     187                                //-- split polygon into front and back part 
    188188                                poly->Split(&mPlane, front_piece, back_piece); 
    189                                 ++ splits; 
     189 
     190                                ++ splits; // increase number of splits 
    190191                         
    191                                 //Debug << "poly\n" << *poly << "split front piece not valid\n" << *front_piece << endl; 
    192                                 //Debug << "poly\n" << *poly << "split back piece not valid\n" << *back_piece << endl; 
    193  
    194                                 if (front_piece->CheckValid()) 
     192                                if (front_piece->mVertices.size() >= 3) // check if polygon still valid  
    195193                                        frontPolys->push_back(front_piece); 
    196                                 else 
    197                                         DEL_PTR(front_piece); 
     194                                else{ 
     195                                        Debug << "poly\n" << *poly << "split front piece not valid\n" << *front_piece << endl; 
     196                                        DEL_PTR(front_piece);} 
    198197                                 
    199                                 //if (back_piece->CheckValid()) 
     198                                if (back_piece->mVertices.size() >= 3) // check if polygon still valid 
    200199                                        backPolys->push_back(back_piece); 
    201                                 //else 
    202                                 //      DEL_PTR(back_piece); 
     200                                else{ 
     201                                        Debug << "poly\n" << *poly << "split back piece not valid\n" << *back_piece << endl; 
     202                                        DEL_PTR(back_piece);} 
     203                                 
    203204Debug << "*************\n"; 
    204205#ifdef _DEBUG 
     
    518519        // copy view cell meshes into one big polygon soup 
    519520        PolygonContainer *polys = new PolygonContainer(); 
    520         Copy2PolygonSoup(viewCells, *polys); 
     521        mStat.polys = Copy2PolygonSoup(viewCells, *polys); 
    521522 
    522523        // construct tree from viewcell polygons 
     
    626627                                                                                  &coincident); 
    627628 
    628         if (coincident.size() == 0)  
    629         { 
    630                 Debug << "size is zero at depth " << tData.mDepth << ", #back polys: " << (int)backPolys->size() << ", #front polys: " << (int)frontPolys->size() << endl; 
    631                 if (frontPolys) Debug << "front poly: " << *frontPolys->back() << endl; 
     629        if ((backPolys->size() == 0) && (coincident.size() > 1))  
     630        { 
     631                Debug << "WARNING: size " << coincident.size() << " at depth " << tData.mDepth << ", #back polys: " << (int)backPolys->size() << ", #front polys: " << (int)frontPolys->size() << endl; 
     632                for (int i=0; i<coincident.size();++i) 
     633                        Debug << "coincident " << i << " vc " << coincident[i]->mParent << endl; 
    632634        } 
    633635        //Debug << "coincident size: " << coincident.size() << endl; 
Note: See TracChangeset for help on using the changeset viewer.