Changeset 1149 for GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp
- Timestamp:
- 07/25/06 08:42:07 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp
r863 r1149 165 165 } 166 166 167 167 168 float RayInfo::SqrSegmentLength() const 168 169 { … … 170 171 } 171 172 173 174 void 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 } 172 191 } 192 193 }
Note: See TracChangeset
for help on using the changeset viewer.