Changeset 1972 for GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
- Timestamp:
- 01/12/07 22:41:01 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1970 r1972 1151 1151 const long t1 = GetTime(); 1152 1152 1153 for (int i = 0; i < (int)rays.size();) 1154 { 1155 // HACK: does not really go together with the 16 ray bundles 1156 if (rays[i].mDistribution == SamplingStrategy::HW_GLOBAL_LINES_DISTRIBUTION) 1157 { 1158 mGlobalLinesRenderer->CastGlobalLines(rays[i], vssRays); 1159 i ++; 1153 SimpleRayContainer::const_iterator rit, rit_end = rays.end(); 1154 1155 SimpleRayContainer rayBucket; 1156 int i = 0; 1157 for (rit = rays.begin(); rit != rit_end; ++ rit, ++ i) 1158 { 1159 SimpleRay ray = *rit; 1160 // HACK: global lines must be treated special 1161 if (ray.mDistribution == SamplingStrategy::HW_GLOBAL_LINES_DISTRIBUTION) 1162 { 1163 mGlobalLinesRenderer->CastGlobalLines(ray, vssRays); 1160 1164 continue; 1161 1165 } 1162 1166 1163 if (i + 16 < (int)rays.size()) 1167 rayBucket.push_back(ray); 1168 1169 // 16 rays gathered => do ray casting 1170 if ((int)rayBucket.size() >= 16) 1164 1171 { 1165 1172 mRayCaster->CastRays16( 1166 i, 1167 rays, 1173 rayBucket, 1168 1174 vssRays, 1169 1175 mViewCellsManager->GetViewSpaceBox(), 1170 1176 castDoubleRays, 1171 1177 pruneInvalidRays); 1172 i += 16; 1173 } 1174 else 1178 1179 rayBucket.clear(); 1180 } 1181 1182 if ((int)rays.size() > 10000 && i % 10000 == 0) 1183 cout<<"\r"<<i<<"/"<<(int)rays.size()<<"\r"; 1184 } 1185 1186 // cast rest of rays 1187 SimpleRayContainer::const_iterator sit, sit_end = rayBucket.end(); 1188 1189 for (sit = rayBucket.begin(); sit != sit_end; ++ sit) 1190 { 1191 SimpleRay ray = *sit; 1192 // HACK: global lines must be treated special 1193 if (ray.mDistribution == SamplingStrategy::HW_GLOBAL_LINES_DISTRIBUTION) 1194 { 1195 mGlobalLinesRenderer->CastGlobalLines(ray, vssRays); 1196 } 1197 else 1175 1198 { 1176 1199 mRayCaster->CastRay( 1177 ray s[i],1200 ray, 1178 1201 vssRays, 1179 1202 mViewCellsManager->GetViewSpaceBox(), 1180 1203 castDoubleRays, 1181 1204 pruneInvalidRays); 1182 ++ i; 1183 } 1184 1185 if (rays.size() > 10000 && i % 10000 == 0) 1186 cout<<"\r"<<i<<"/"<<(int)rays.size()<<"\r"; 1187 } 1188 1189 if (rays.size() > 10000) 1205 } 1206 } 1207 1208 if ((int)rays.size() > 10000) 1190 1209 { 1191 1210 cout << endl; 1192 1193 long t2 = GetTime(); 1211 long t2 = GetTime(); 1194 1212 1195 1213 #if SHOW_RAYCAST_TIMING 1196 1214 if (castDoubleRays) 1197 1215 cout << 2 * rays.size() / (1e3f * TimeDiff(t1, t2)) << "M rays/s" << endl; 1198 1216 else 1199 1217 cout << rays.size() / (1e3f * TimeDiff(t1, t2)) << "M rays/s" << endl;
Note: See TracChangeset
for help on using the changeset viewer.