Ignore:
Timestamp:
07/25/06 08:42:07 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r863 r1149  
    165165} 
    166166 
     167 
    167168float RayInfo::SqrSegmentLength() const 
    168169{ 
     
    170171} 
    171172 
     173 
     174void GetRayInfoSets(const RayInfoContainer &sourceRays, 
     175                    const int maxSize, 
     176                                        RayInfoContainer &usedRays, 
     177                                        RayInfoContainer *savedRays) 
     178{ 
     179        const int limit = min(maxSize, (int)sourceRays.size()); 
     180        const float prop = (float)limit / ((float)sourceRays.size() + Limits::Small); 
     181 
     182        RayInfoContainer::const_iterator it, it_end = sourceRays.end(); 
     183 
     184        for (it = sourceRays.begin(); it != it_end; ++ it) 
     185        { 
     186                if (Random(1.0f) < prop) 
     187                        usedRays.push_back(*it); 
     188                else if (savedRays) 
     189                        savedRays->push_back(*it); 
     190        } 
    172191} 
     192 
     193} 
Note: See TracChangeset for help on using the changeset viewer.