Changeset 1147


Ignore:
Timestamp:
07/24/06 18:21:32 (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

    r1143 r1147  
    19941994        RegisterOption("VspBspTree.Construction.maxBand", 
    19951995                                        optFloat, 
    1996                                         "vsp_bsp_construction_min_band=", 
     1996                                        "vsp_bsp_construction_max_band=", 
    19971997                                        "0.99"); 
    19981998 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.h

    r1133 r1147  
    9292        */ 
    9393        int ComputeRayIntersection(const Plane3 &splitPlane, float &t) const; 
     94 
     95        /*friend void GetRaySets(const RayInfoContainer &sourceRays, 
     96                                                   const int maxSize, 
     97                                                   RayInfoContainer &usedRays, 
     98                                                   RayInfoContainer *savedRays) const;*/ 
    9499}; 
    95100 
    96  
    97101} 
    98  
    99102#endif  
    100103 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r1145 r1147  
    13581358                                          float &position) 
    13591359{ 
     1360        RayInfoContainer usedRays, savedRays; 
     1361 
     1362/*      if (mMaxTests < rays.size()) 
     1363        { 
     1364                GetRaySets(rays, mMaxTests, usedRays, savedRays); 
     1365        } 
     1366        else 
     1367        {*/ 
     1368                usedRays = rays; 
     1369        //} 
     1370 
    13601371        const float minBox = box.Min(axis); 
    13611372        const float maxBox = box.Max(axis); 
     
    13661377        const float maxBand = minBox + mMaxBand * sizeBox; 
    13671378 
    1368         SortSplitCandidates(rays, axis, minBand, maxBand); 
     1379        SortSplitCandidates(usedRays, axis, minBand, maxBand); 
    13691380 
    13701381        // go through the lists, count the number of objects left and right 
     
    13911402        Intersectable::NewMail(); 
    13921403 
    1393         RayInfoContainer::const_iterator ri, ri_end = rays.end(); 
     1404        RayInfoContainer::const_iterator ri, ri_end = usedRays.end(); 
    13941405 
    13951406        // set all object as belonging to the front pvs 
     
    14861497                        sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value); 
    14871498 
     1499                        float currentPos; 
     1500                         
     1501                        // HACK: current positition is BETWEEN visibility events 
     1502                        if ((ci + 1) != ci_end) 
     1503                                currentPos = ((*ci).value + (*(ci + 1)).value) * 0.5f; 
     1504                        else 
     1505                                currentPos = (*ci).value;                        
     1506 
    14881507                        //Debug  << "pos=" << (*ci).value << "\t pvs=(" <<  pvsl << "," << pvsr << ")" << endl; 
    14891508                        //Debug << "cost= " << sum << endl; 
     
    14941513 
    14951514                                minSum = sum; 
    1496                                 position = (*ci).value; 
     1515                                position = currentPos; 
    14971516                                 
    14981517                                pvsBack = pvsl; 
     
    15011520                } 
    15021521        } 
    1503          
    15041522         
    15051523        // -- compute cost 
     
    15601578        //TODO: for kd split geometry already is box => only take minmax vertices 
    15611579        if (1) 
    1562         { 
    1563                 // get bounding box from geometry 
     1580        {       // get bounding box from geometry 
    15641581                tData.mGeometry->GetBoundingBox(box); 
    15651582        } 
     
    15721589                        box.Include((*ri).ExtrapTermination()); 
    15731590        } 
     1591 
    15741592 
    15751593        int sAxis = 0; 
     
    16201638                        } 
    16211639                        else  
    1622                         { 
    1623                                 //-- split plane position is spatial median 
     1640                        {       //-- split plane position is spatial median 
    16241641 
    16251642                                nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp

    r1146 r1147  
    14481448                         
    14491449                        // HACK: current positition is BETWEEN visibility events 
    1450                         if (ci != ci_end) 
     1450                        if ((ci + 1) != ci_end) 
    14511451                                currentPos = ((*ci).value + (*(ci + 1)).value) * 0.5f; 
    14521452                        else 
     
    14541454 
    14551455                        sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value); 
    1456                         Debug  << "pos=" << (*ci).value << "\t newpos=" << currentPos << "\t pvs=(" <<  pvsl << "," << pvsr << ")" << "\t cost= " << sum << endl; 
     1456                        //Debug  << "pos=" << (*ci).value << "\t newpos=" << currentPos << "\t pvs=(" <<  pvsl << "," << pvsr << ")" << "\t cost= " << sum << endl; 
    14571457 
    14581458                        if (sum < minSum) 
     
    14611461 
    14621462                                minSum = sum; 
    1463                                 position = (*ci).value; 
     1463                                position = currentPos; 
    14641464                                 
    14651465                                pvsBack = pvsl; 
     
    14701470         
    14711471         
    1472         // -- compute cost 
     1472        //-- compute cost 
    14731473 
    14741474        const int lowerPvsLimit = mViewCellsManager->GetMinPvsSize(); 
     
    32923292                        sum = voll * pvsl + volr * pvsr; 
    32933293 
     3294                        float currentPos; 
     3295                         
     3296                        // HACK: current positition is BETWEEN visibility events 
     3297                        if ((ci + 1) != ci_end) 
     3298                                currentPos = ((*ci).mPos + (*(ci + 1)).mPos) * 0.5f; 
     3299                        else 
     3300                                currentPos = (*ci).mPos;                         
     3301 
    32943302                        // note matt: can happen that volr is less than zero: bug or numerical error? 
    32953303                        //if (volr < 0)         Debug << "warning!! " << totalVol << " " << volRightDecr << " " << volRightDecr - totalVol << endl; 
     
    33133321                                volFront = volr; 
    33143322 
    3315                                 position = (*ci).mPos; 
     3323                                position = currentPos; 
    33163324                        } 
    33173325                } 
Note: See TracChangeset for help on using the changeset viewer.