Changeset 2050 for GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
- Timestamp:
- 01/24/07 06:53:09 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2049 r2050 117 117 { 118 118 Triangle3 &t = object->GetItem(); 119 119 120 120 glBegin(GL_TRIANGLES); 121 121 Vector3 normal = t.GetNormal(); … … 130 130 GlRenderer::RenderIntersectable(Intersectable *object) 131 131 { 132 if (!object) 133 return; 134 132 135 if (object->Mailed()) 133 136 return; 137 134 138 object->Mail(); 135 139 … … 1389 1393 void GlRenderer::EvalPvsStat(const SimpleRayContainer &viewPoints) 1390 1394 { 1391 ClearErrorBuffer(); 1392 1393 mPvsStat.Reset(); 1394 halton.Reset(); 1395 1396 SetupProjection(GetWidth(), GetHeight()); 1397 1398 cout << "mPvsStatFrames=" << mPvsStatFrames << endl; 1399 1400 SimpleRayContainer::const_iterator sit, sit_end = viewPoints.end(); 1401 int i = 0; 1402 1403 for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i) 1404 { 1405 //cout << "view point: " << (*sit) << endl;; 1406 SimpleRay sray = *sit; 1407 1408 float err; 1409 1410 // set frame id for saving the error buffer 1411 mFrame = i; 1412 mViewPoint = sray.mOrigin; 1413 mViewDirection = sray.mDirection; 1414 1415 if (0 && (mPvsErrorBuffer[i].mError == 1.0f)) 1395 mPvsStat.Reset(); 1396 1397 SetupProjection(GetWidth(), GetHeight()); 1398 1399 cout << "mPvsStatFrames=" << mPvsStatFrames << endl; 1400 1401 SimpleRayContainer::const_iterator sit, sit_end = viewPoints.end(); 1402 int i = 0; 1403 1404 for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i) 1405 { 1406 1407 //cout << "view point: " << (*sit) << endl;; 1408 SimpleRay sray = *sit; 1409 1410 float err; 1411 1412 // set frame id for saving the error buffer 1413 mFrame = i; 1414 mViewPoint = sray.mOrigin; 1415 mViewDirection = sray.mDirection; 1416 1417 if (mPvsErrorBuffer[i].mError > 0.0f) 1416 1418 { 1417 // check if the view point is valid 1418 if (!ValidViewPoint()) 1419 { 1420 cout << "error: " << " view point invalid" << endl; 1421 mPvsErrorBuffer[i].mError = -1.0f; 1422 } 1423 else 1424 { 1425 cout << "view point valid" << endl; 1426 } 1419 int pvsSize; 1420 1421 // compute the pixel error 1422 float error = GetPixelError(pvsSize); 1423 1424 mPvsErrorBuffer[i].mError = error; 1425 mPvsErrorBuffer[i].mPvsSize = pvsSize; 1426 1427 cout << "(" << i << "," << mPvsErrorBuffer[i].mError <<")"; 1427 1428 } 1428 1429 if (mPvsErrorBuffer[i].mError > 0.0f) 1429 1430 err = mPvsErrorBuffer[i].mError; 1431 1432 if (err >= 0.0f) 1430 1433 { 1431 int pvsSize; 1432 1433 // compute the pixel error 1434 float error = GetPixelError(pvsSize); 1435 1436 mPvsErrorBuffer[i].mError = error; 1437 mPvsErrorBuffer[i].mPvsSize = pvsSize; 1438 1439 cout << "(" << i << "," << mPvsErrorBuffer[i].mError <<")"; 1440 } 1441 1442 err = mPvsErrorBuffer[i].mError; 1443 1444 if (err >= 0.0f) 1445 { 1446 if (err > mPvsStat.maxError) 1447 mPvsStat.maxError = err; 1448 1449 mPvsStat.sumError += err; 1434 if (err > mPvsStat.maxError) 1435 mPvsStat.maxError = err; 1436 1437 mPvsStat.sumError += err; 1450 1438 mPvsStat.sumPvsSize += mPvsErrorBuffer[i].mPvsSize; 1451 1439 1452 1440 if (err == 0.0f) 1453 1454 1441 ++ mPvsStat.errorFreeFrames; 1442 1455 1443 ++ mPvsStat.frames; 1456 1444 } 1457 1445 } 1458 1459 1460 1446 1447 glFinish(); 1448 cout << endl << flush; 1461 1449 } 1462 1450
Note: See TracChangeset
for help on using the changeset viewer.