Changeset 1968 for GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
- Timestamp:
- 01/11/07 04:18:36 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1966 r1968 21 21 #include "IntelRayCaster.h" 22 22 #include "InternalRayCaster.h" 23 23 #include "GlobalLinesRenderer.h" 24 24 25 25 … … 134 134 mRayCaster(NULL), 135 135 mStopComputation(false), 136 mThread(NULL) 136 mThread(NULL), 137 mGlobalLinesRenderer(NULL) 137 138 { 138 139 Environment::GetSingleton()->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer); … … 174 175 mSamplesPerEvaluation); 175 176 176 177 177 Debug << "******* Preprocessor Options **********" << endl; 178 178 Debug << "detect empty view space=" << mDetectEmptyViewSpace << endl; … … 211 211 DEL_PTR(renderer); 212 212 DEL_PTR(mRayCaster); 213 214 DEL_PTR(mGlobalLinesRenderer); 213 215 } 214 216 … … 1074 1076 1075 1077 1076 bool Preprocessor::InitRayCast(const string externKdTree, const string internKdTree) 1078 bool Preprocessor::InitRayCast(const string externKdTree, 1079 const string internKdTree) 1077 1080 { 1078 1081 // always try to load the kd tree … … 1081 1084 if (!LoadKdTree(internKdTree)) 1082 1085 { 1083 cout << "error loading kd tree with filename " << internKdTree << ", rebuilding it instead ... " << endl; 1086 cout << "error loading kd tree with filename " 1087 << internKdTree << ", rebuilding it instead ... " << endl; 1084 1088 // build new kd tree from scene geometry 1085 1089 BuildKdTree(); … … 1091 1095 if (!ExportKdTree(internKdTree)) 1092 1096 { 1093 cout << " error exporting kd tree with filename " << internKdTree << endl; 1097 cout << " error exporting kd tree with filename " 1098 << internKdTree << endl; 1094 1099 } 1095 1100 else 1096 1101 { 1097 cout << "finished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 1102 cout << "finished in " 1103 << TimeDiff(startTime, GetTime()) * 1e-3 1104 << " secs" << endl; 1098 1105 } 1099 1106 } … … 1114 1121 1115 1122 int rayCastMethod; 1116 Environment::GetSingleton()->GetIntValue("Preprocessor.rayCastMethod", rayCastMethod); 1123 Environment::GetSingleton()-> 1124 GetIntValue("Preprocessor.rayCastMethod", rayCastMethod); 1117 1125 1118 1126 if (rayCastMethod == 0) … … 1145 1153 for (int i = 0; i < (int)rays.size();) 1146 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 ++; 1160 continue; 1161 } 1162 1147 1163 if (i + 16 < (int)rays.size()) 1148 1164 { … … 1173 1189 if (rays.size() > 10000) 1174 1190 { 1175 cout<<endl;1176 1177 long t2 = GetTime();1191 cout << endl; 1192 1193 long t2 = GetTime(); 1178 1194 1179 1195 #if SHOW_RAYCAST_TIMING 1180 if (castDoubleRays)1181 1182 else1183 cout << rays.size() / (1e3f * TimeDiff(t1, t2)) << "M rays/s" << endl;1196 if (castDoubleRays) 1197 cout << 2 * rays.size() / (1e3f * TimeDiff(t1, t2)) << "M rays/s" << endl; 1198 else 1199 cout << rays.size() / (1e3f * TimeDiff(t1, t2)) << "M rays/s" << endl; 1184 1200 #endif 1185 1201 } … … 1230 1246 ray.Init(point, direction, Ray::LOCAL_RAY); 1231 1247 } 1248 1232 1249 1233 1250 void Preprocessor::EvalViewCellHistogram() … … 1326 1343 } 1327 1344 1328 } 1345 1346 void Preprocessor::PrepareHwGlobalLines() 1347 { 1348 int texHeight, texWidth; 1349 float eps; 1350 int maxDepth; 1351 bool sampleReverse; 1352 1353 Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.texHeight", texHeight); 1354 Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.texHeight", texWidth); 1355 Environment::GetSingleton()->GetFloatValue("Preprocessor.HwGlobalLines.stepSize", eps); 1356 Environment::GetSingleton()->GetIntValue("Preprocessor.HwGlobalLines.maxDepth", maxDepth); 1357 Environment::GetSingleton()->GetBoolValue("Preprocessor.HwGlobalLines.sampleReverse", sampleReverse); 1358 1359 mGlobalLinesRenderer = 1360 new GlobalLinesRenderer(this, 1361 texHeight, 1362 texWidth, 1363 eps, 1364 maxDepth, 1365 sampleReverse); 1366 1367 mGlobalLinesRenderer->InitGl(); 1368 } 1369 1370 }
Note: See TracChangeset
for help on using the changeset viewer.