Ignore:
Timestamp:
04/27/06 09:29:52 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r822 r837  
    12471247         
    12481248        // the relative cost ratio 
    1249         float ratio = /*Limits::Infinity;*/99999999.0; 
     1249        float ratio = /*Limits::Infinity;*/99999999.0f; 
    12501250        bool splitPlaneFound = false; 
    12511251 
     
    14301430        int bestAxis; 
    14311431 
     1432        // if max cost ratio is exceeded, take split along longest axis instead 
     1433        const float maxCostRatioForArbitraryAxis = 0.9f; 
     1434 
    14321435        if (mUseDrivingAxisForMaxCost) 
    14331436                bestAxis = box.Size().DrivingAxis(); 
     
    14371440        // mximum cost ratio for axis to be valid: 
    14381441        // if exceeded, spatial mid split is used instead 
    1439         const float maxCostRatio = 0.9f; 
    1440  
    1441         // hack : subdivide along driving axis up to certain depth 
    1442         int maxDepthForDrivingAxis = 0; 
    1443         const maxCostRatioForHeur = 0.99; 
    1444  
    1445     const bool useSpecialAxis = mOnlyDrivingAxis || mUseRandomAxis ||  
    1446                 mCirculatingAxis; 
     1442        //const maxCostRatioForHeur = 0.99f; 
     1443 
     1444 
     1445    const bool useSpecialAxis =  
     1446                mOnlyDrivingAxis || mUseRandomAxis || mCirculatingAxis; 
    14471447 
    14481448 
     
    14761476                         
    14771477                        //-- split plane position is spatial median 
    1478                         //-- use median split if cost ratio very low as 
    1479                         //-- there are not enough visibility cues 
    1480  
    1481                         else //if (!mUseCostHeuristics || (nCostRatio[axis] > maxCostRatioForHeur)) 
     1478 
     1479 
     1480                        // also use median split if cost ratio very low as 
     1481                        // there are not enough visibility cues 
     1482                        //if (!mUseCostHeuristics || (nCostRatio[axis] > maxCostRatioForHeur)) 
     1483                        else  
    14821484                        { 
    14831485 
     
    15411543                        { 
    15421544                                 // NOTE: takes longest axis split if cost ratio exceeds threshold 
    1543                                 if (nCostRatio[axis] < min(maxCostRatio, nCostRatio[bestAxis])) 
     1545                                if (nCostRatio[axis] < min(maxCostRatioForArbitraryAxis, nCostRatio[bestAxis])) 
    15441546                                { 
    15451547                                        bestAxis = axis; 
    15461548                                } 
    1547                                 //else if (nCostRatio[axis] < nCostRatio[bestAxis]) 
    1548                                 //      Debug << "warning!! different path taken: " << axis << " " << bestAxis << endl; 
     1549                                else if (nCostRatio[axis] < nCostRatio[bestAxis]) 
     1550                                        Debug << "taking split along longest axis (" << bestAxis << ") instead of  (" << axis << ")" << endl; 
    15491551                                 
    15501552                        } 
Note: See TracChangeset for help on using the changeset viewer.