Changeset 682


Ignore:
Timestamp:
03/08/06 18:35:34 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
4 edited

Legend:

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

    r679 r682  
    15731573                                        "rays.out"); 
    15741574 
    1575         RegisterOption("Preprocessor.useGlRenderer", 
    1576                                         optBool, 
    1577                                         "useGlRenderer", 
    1578                                         "false"); 
    1579  
    15801575        RegisterOption("Preprocessor.loadPolygonsAsMeshes", 
    15811576                                        optBool, 
     
    15881583                                   "10000"); 
    15891584 
     1585         
     1586        RegisterOption("Preprocessor.useGlRenderer", 
     1587                                        optBool, 
     1588                                        "preprocessor_use_gl_renderer=", 
     1589                                        "false"); 
     1590 
    15901591        RegisterOption("Preprocessor.useGlDebugger", 
    15911592                                        optBool, 
    1592                                         "useGlDebugger", 
     1593                                        "preprocessor_use_gl_debugger=", 
    15931594                                        "false"); 
    15941595 
    15951596        RegisterOption("Preprocessor.detectEmptyViewSpace", 
    15961597                                   optBool, 
    1597                                    "detectEmptyViewSpace", 
     1598                                   "preprocessor_detect_empty_viewspace=", 
    15981599                                   "false"); 
    15991600         
    16001601        RegisterOption("Preprocessor.quitOnFinish", 
    16011602                                   optBool, 
    1602                                    "quitOnFinish", 
     1603                                   "preprocessor_quit_on_finish=", 
    16031604                                   "true"); 
     1605 
     1606 
    16041607 
    16051608        /**************************************************************************************/ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp

    r681 r682  
    30233023        // get cross section of new polygon 
    30243024        Polygon3 *planePoly = box.CrossSection(splitPlane); 
    3025  
     3025        //Vector3 ndummy = planePoly->GetSupportingPlane().mNormal; 
    30263026        // split polygon with all other polygons 
    30273027        planePoly = SplitPolygon(planePoly, epsilon); 
    30283028 
    3029         bool splitsGeom = (planePoly != NULL) 
    3030  
     3029        bool splitsGeom = (planePoly != NULL); 
    30313030 
    30323031        //-- new polygon splits all other polygons 
     
    30993098        if (planePoly) 
    31003099        { 
     3100                // add polygon with reverse orientation to front cell 
     3101                Plane3 reversePlane(splitPlane); 
     3102                reversePlane.ReverseOrientation(); 
     3103 
     3104                //Debug << "poly normal : " << ndummy << " split plane normal " << splitPlane.mNormal << endl; 
    31013105                // add polygon with normal pointing into positive half space to back cell 
    31023106                back.Add(planePoly, splitPlane); 
    31033107                //back.mPolys.push_back(planePoly); 
    3104  
    3105                 // add polygon with reverse orientation to front cell 
    3106                 Plane3 reversePlane(splitPlane); 
    3107                 reversePlane.ReverseOrientation(); 
    3108                 front.Add(planePoly->CreateReversePolygon(), reversePlane); 
     3108                Polygon3 *reversePoly = planePoly->CreateReversePolygon(); 
     3109                front.Add(reversePoly, reversePlane); 
     3110                Debug << "poly normal : " << reversePoly->GetSupportingPlane().mNormal << " split plane normal " << reversePlane.mNormal << endl; 
    31093111        } 
    31103112 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r681 r682  
    34833483                        BspNodeGeometry back; 
    34843484 
    3485          
    34863485                        BspLeaf *leaf = dynamic_cast<BspViewCell *>(*it)->mLeaf; 
    3487  
    34883486                        mVspBspTree->ConstructGeometry(leaf, geom); 
    3489                          
    3490                         geom.SplitGeometry(front, 
    3491                                                            back, 
    3492                                                            *clipPlane, 
    3493                                                            mViewSpaceBox,  
    3494                                                            0.0001f); 
    3495  
    3496                         if (back.Size() >= 3) 
    3497                                 exporter->ExportPolygons(back.GetPolys()); 
     3487 
     3488                        const int cf = Polygon3::ClassifyPlane(geom.GetPolys(), *clipPlane, 0.0005); 
     3489 
     3490                        if (cf == Polygon3::BACK_SIDE) 
     3491                        { 
     3492                                exporter->ExportPolygons(geom.GetPolys()); 
     3493                        } 
     3494                        else if (cf == Polygon3::SPLIT) 
     3495                        { 
     3496                                geom.SplitGeometry(front, 
     3497                                                                   back, 
     3498                                                                   *clipPlane, 
     3499                                                                   mViewSpaceBox,  
     3500                                                                   0.0001f); 
     3501         
     3502                                if (back.Size() >= 3) 
     3503                                        exporter->ExportPolygons(back.GetPolys()); 
     3504                        } 
    34983505                } 
    34993506        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r679 r682  
    154154        Debug << "use random axis: " << mUseRandomAxis << endl; 
    155155        Debug << "breath first splits: " << mBreathFirstSplits << endl; 
    156          
     156        Debug << "empty view cells merge: " << mEmptyViewCellsMergeAllowed << endl; 
     157 
    157158        Debug << "octree: " << mSimulateOctree << endl; 
    158159 
     
    18251826                 
    18261827                // clamp because of possible precision issues 
    1827                 if (1) 
    1828                 { 
    1829                         if (!splitSuccessFull || (pFront <= 0) || (pBack <= 0) ||  
    1830                                 !geomFront.Valid() || !geomBack.Valid()) 
    1831                         { 
    1832                                 Debug << "error f: " << pFront << " b: " << pBack << endl; 
    1833                                 return 999; 
    1834                         } 
     1828                if (0 &&  
     1829                        (!splitSuccessFull || (pFront <= 0) || (pBack <= 0) ||  
     1830                        !geomFront.Valid() || !geomBack.Valid())) 
     1831                { 
     1832                        Debug << "error f: " << pFront << " b: " << pBack << endl; 
     1833                        return 999; 
    18351834                } 
    18361835        } 
     
    33883387                                // in the tree? 
    33893388                                if (mEmptyViewCellsMergeAllowed || 
    3390                                         (!leaf->GetViewCell()->GetPvs().Empty() && ! (*nit)->GetViewCell()->GetPvs().Empty()) || 
     3389                                        !leaf->GetViewCell()->GetPvs().Empty() || !(*nit)->GetViewCell()->GetPvs().Empty() || 
    33913390                    leaf->IsSibling(*nit)) 
    33923391                                { 
Note: See TracChangeset for help on using the changeset viewer.