Ignore:
Timestamp:
03/12/07 19:20:55 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2237 r2238  
    11221122                // should use classical approach here ... 
    11231123#if BOUND_RENDERCOST 
     1124                const float rcLeft = std::max(objectsLeft, MIN_RENDERCOST); 
     1125                const float rcRight = std::max(objectsRight, MIN_RENDERCOST); 
     1126 
    11241127                const float sum = noValidSplit ? 1e25f : objectsLeft * al + objectsRight * ar; 
    11251128#else 
    1126                 const float rcLeft = std::max(objectsLeft, MIN_RENDERCOST); 
    1127                 const float rcRight = std::max(objectsRight, MIN_RENDERCOST); 
    11281129 
    11291130                const float sum = noValidSplit ? 1e25f : objectsLeft * al + objectsRight * ar; 
    1130  
    11311131#endif 
    11321132                /*cout << "pos=" << (*cit).mPos << "\t q=(" << objectsLeft << "," << objectsRight <<")\t r=("  
     
    13731373        float volRight = totalVol; 
    13741374         
    1375 #if 1//USE_BETTER_RENDERCOST_EST 
    13761375        const float nTotalObjects = EvalAbsCost(tData.mNode->mObjects); 
    13771376        float nObjectsLeft = 0; 
    13781377        float nObjectsRight = nTotalObjects; 
    1379 #else 
    1380         const int nTotalObjects = (int)EvalAbsCost(tData.mNode->mObjects); 
    1381         int nObjectsLeft = 0; 
    1382         int nObjectsRight = (int)nTotalObjects; 
    1383 #endif 
    13841378 
    13851379        const float viewSpaceVol =  
     
    14401434 
    14411435#if BOUND_RENDERCOST 
     1436 
     1437                const float rcLeft = max(nObjectsLeft, MIN_RENDERCOST); 
     1438                const float rcRight = max(nObjectsRight, MIN_RENDERCOST); 
     1439                 
     1440                // the heuristics 
     1441            const float sum = noValidSplit ?  
     1442                        1e25f : volLeft * (float)rcLeft + volRight * (float)rcRight; 
     1443#else 
     1444         
    14421445                // the heuristics 
    14431446            const float sum = noValidSplit ?  
    14441447                        1e25f : volLeft * (float)nObjectsLeft + volRight * (float)nObjectsRight; 
    1445 #else 
    1446                 const float rcLeft = max(nObjectsLeft, MIN_RENDERCOST); 
    1447                 const float rcRight = max(nObjectsRight, MIN_RENDERCOST); 
    1448  
    1449                 // the heuristics 
    1450             const float sum = noValidSplit ?  
    1451                         1e25f : volLeft * (float)rcLeft + volRight * (float)rcRight; 
    1452  
    14531448#endif 
    14541449                 
     
    17921787        VssRayContainer::const_iterator rit, rit_end = rays.end(); 
    17931788 
     1789        VssRay *lastVssRay = NULL; 
     1790 
    17941791        VssRay::NewMail(); 
    17951792 
     
    17981795                VssRay *ray = (*rit); 
    17991796 
    1800                 if (ray->mTerminationObject) 
    1801                 { 
    1802                         ray->mTerminationObject->GetOrCreateRays()->push_back(ray); 
    1803                         if (!ray->Mailed()) 
     1797                // filter out double rays (last ray the same as this ray 
     1798                if (!lastVssRay || 
     1799                        !(ray->mOrigin == lastVssRay->mTermination) || 
     1800                        !(ray->mTermination == lastVssRay->mOrigin))  
     1801                { 
     1802                        //cout << "j"; 
     1803                        if (ray->mTerminationObject) 
    18041804                        { 
    1805                                 ray->Mail(); 
    1806                                 ++ nRays; 
     1805                                ray->mTerminationObject->GetOrCreateRays()->push_back(ray); 
     1806                                if (!ray->Mailed()) 
     1807                                { 
     1808                                        ray->Mail(); 
     1809                                        ++ nRays; 
     1810                                } 
    18071811                        } 
    1808                 } 
    18091812 
    18101813#if COUNT_ORIGIN_OBJECTS 
    18111814 
    1812                 if (ray->mOriginObject) 
    1813                 { 
    1814                         cout << "o"; 
    1815                         ray->mOriginObject->GetOrCreateRays()->push_back(ray); 
    1816  
    1817                         if (!ray->Mailed()) 
     1815                        if (ray->mOriginObject) 
    18181816                        { 
    1819                                 ray->Mail(); 
    1820                                 ++ nRays; 
     1817                                //cout << "o"; 
     1818                                ray->mOriginObject->GetOrCreateRays()->push_back(ray); 
     1819 
     1820                                if (!ray->Mailed()) 
     1821                                { 
     1822                                        ray->Mail(); 
     1823                                        ++ nRays; 
     1824                                } 
    18211825                        } 
    18221826                } 
Note: See TracChangeset for help on using the changeset viewer.