Changeset 676


Ignore:
Timestamp:
03/06/06 19:02:49 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
5 edited

Legend:

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

    r675 r676  
    12761276        RegisterOption("ViewCells.exportToFile", 
    12771277                                        optBool, 
    1278                                         "view_cells_export_to_file", 
     1278                                        "view_cells_export_to_file=", 
     1279                                        "false"); 
     1280 
     1281        RegisterOption("ViewCells.PostProcess.emptyViewCellsMergeAllowed", 
     1282                                        optBool, 
     1283                                        "view_cells_post_process_empty_view_cells_merge_allowed=" 
    12791284                                        "false"); 
    12801285 
     
    15651570        RegisterOption("Preprocessor.samplesFilename", 
    15661571                                        optString, 
    1567                                         "-preprocessor_samples_filename=", 
     1572                                        "preprocessor_samples_filename=", 
    15681573                                        "rays.out"); 
    15691574 
     
    17171722        RegisterOption("VspKdTree.Termination.missTolerance", 
    17181723                        optInt, 
    1719                         "-vsp_kd_term_miss_tolerance=", 
     1724                        "vsp_kd_term_miss_tolerance=", 
    17201725                        "4"); 
    17211726 
     
    19972002                        "0.1"); 
    19982003 
    1999         RegisterOption("VspBspTree.Factor.leastRaySplits", optFloat, "-vsp_bsp_factor_least_ray_splits=", "1.0"); 
    2000         RegisterOption("VspBspTree.Factor.balancedRays", optFloat, "-vsp_bsp_factor_balanced_rays=", "1.0"); 
    2001         RegisterOption("VspBspTree.Factor.pvs", optFloat, "-vsp_bsp_factor_pvs=", "1.0"); 
     2004        RegisterOption("VspBspTree.Factor.leastRaySplits",  
     2005                                        optFloat,  
     2006                                        "vsp_bsp_factor_least_ray_splits=",  
     2007                                        "1.0"); 
     2008 
     2009        RegisterOption("VspBspTree.Factor.balancedRays",  
     2010                                        optFloat,  
     2011                                        "vsp_bsp_factor_balanced_rays=",  
     2012                                        "1.0"); 
     2013 
     2014        RegisterOption("VspBspTree.Factor.pvs",  
     2015                                        optFloat,  
     2016                                        "vsp_bsp_factor_pvs=",  
     2017                                        "1.0"); 
    20022018         
    20032019        RegisterOption("VspBspTree.Construction.renderCostWeight", 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp

    r675 r676  
    980980                viewCell->mLeaf = leaf; 
    981981 
    982                 float probability = max(0.0f, tData.mProbability); 
     982                //float probability = max(0.0f, tData.mProbability); 
     983                float probability = tData.mProbability; 
    983984 
    984985                if (mUseAreaForPvs) 
     
    29832984                /// don't use epsilon here to get exact split planes 
    29842985                const int cf =  
    2985                         mPolys[i]->ClassifyPlane(splitPlane, Limits::Small); 
     2986                        mPolys[i]->ClassifyPlane(splitPlane, epsilon); 
    29862987                         
    29872988                switch (cf) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r666 r676  
    481481        bool mEvaluateViewCells; 
    482482 
    483         bool mShowVisualization; 
     483        bool mShowVisualization;         
    484484}; 
    485485 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r675 r676  
    121121        environment->GetBoolValue("VspBspTree.useBreathFirstSplits", mBreathFirstSplits); 
    122122 
     123        environment->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMergeAllowed", mEmptyViewCellsMergeAllowed); 
     124         
    123125        char subdivisionStatsLog[100]; 
    124126        environment->GetStringValue("VspBspTree.subdivisionStats", subdivisionStatsLog); 
     
    184186        mSplitCandidates = new vector<SortableEntry>; 
    185187 
     188        Debug << "here3" << endl; 
    186189        Debug << endl; 
    187190} 
     
    10111014                                                                           splitPlane, 
    10121015                                                                           mBox, 
    1013                                                                            0.0000001f); 
     1016                                                                           0.000000001f); 
    10141017                                                                           //mEpsilon); 
    10151018                 
     
    10231026                        frontData.mProbability = frontData.mGeometry->GetVolume(); 
    10241027                        backData.mProbability = tData.mProbability - frontData.mProbability; 
     1028 
     1029                        if (frontData.mProbability < -0.00001) 
     1030                                Debug << "here2 error: " << frontData.mProbability << endl; 
     1031                        if (backData.mProbability < -0.00001) 
     1032                                Debug << "here2 error: " << backData.mProbability << endl; 
     1033 
    10251034                        // clamp because of precision issues 
    1026                         if (frontData.mProbability < 0) frontData.mProbability = 0; 
    1027                         if (backData.mProbability < 0) backData.mProbability = 0; 
     1035                        if (0) 
     1036                        { 
     1037                                if (frontData.mProbability < 0) frontData.mProbability = 0; 
     1038                                if (backData.mProbability < 0) backData.mProbability = 0; 
     1039                        } 
    10281040                } 
    10291041        } 
     
    16921704                                                                  candidatePlane, 
    16931705                                                                  mBox, 
    1694                                                                   0.0000001f); 
     1706                                                                  0.000000001f); 
    16951707                                                                  //mEpsilon); 
    16961708 
     
    17001712                pBack = pOverall - pFront; 
    17011713 
     1714                if ((pFront < 0.001) || (pBack < 0.001)) 
     1715                { 
     1716                        Debug << "vol f " << pFront << " b " << pBack << " p " << pOverall << endl; 
     1717                        Debug << "real vol f " << pFront << " b " << geomBack.GetVolume() << " p " << pOverall << endl; 
     1718                        Debug << "polys f" << (int)geomFront.mPolys.size() << " b " << (int)geomFront.mPolys.size() << " data " << (int)data.mGeometry->mPolys.size() << endl; 
     1719                } 
     1720 
    17021721                // clamp because of possible precision issues 
    1703                 if (pFront < 0) pFront = 0; 
    1704                 if (pBack < 0) pBack = 0; 
     1722                if (0) 
     1723                { 
     1724                        if (pFront < 0) pFront = 0; 
     1725                        if (pBack < 0) pBack = 0; 
     1726                } 
    17051727        } 
    17061728        else 
     
    17851807                                                                  candidatePlane, 
    17861808                                                                  mBox, 
    1787  
    1788                                                                   mEpsilon); 
     1809                                                                  0.0000001f); 
     1810                                                                  //mEpsilon); 
    17891811 
    17901812        pOverall = data.mProbability; 
     
    17961818                 
    17971819                // clamp because of possible precision issues 
    1798                 if (pFront < 0) pFront = 0; 
    1799                 if (pBack < 0) pBack = 0; 
     1820                if (1) 
     1821                { 
     1822                        if (pFront <= 0) 
     1823                        { 
     1824                                //Debug << "error f: " << pFront << endl; 
     1825                                return 999; 
     1826                        } 
     1827 
     1828                        if (pBack <= 0)  
     1829                        { 
     1830                                //Debug << "error b: " << pBack << endl; 
     1831                                return 999; 
     1832                        } 
     1833                } 
    18001834        } 
    18011835        else 
     
    33353369                        { 
    33363370                                MergeCandidate mc(leaf->GetViewCell(), (*nit)->GetViewCell()); 
    3337                                 candidates.push_back(mc); 
     3371 
     3372                                // dont't merge view cells if they are empty and not front and back leaf of the same parent 
     3373                                // in the tree? 
     3374                                if (mEmptyViewCellsMergeAllowed || 
     3375                                        (!leaf->GetViewCell()->GetPvs().Empty() && ! (*nit)->GetViewCell()->GetPvs().Empty()) || 
     3376                    leaf->IsSibling(*nit)) 
     3377                                { 
     3378                                        candidates.push_back(mc); 
     3379                                } 
    33383380 
    33393381                                ++ numCandidates; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h

    r670 r676  
    798798        bool mBreathFirstSplits; 
    799799 
     800        bool mEmptyViewCellsMergeAllowed; 
     801 
    800802private: 
    801803 
Note: See TracChangeset for help on using the changeset viewer.