Changeset 2705 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 05/24/08 11:59:35 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2704 r2705 333 333 char filename[256]; 334 334 //sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 335 sprintf (filename, "error-frame-%04d-%04d-%08d.png", mFrame, viewcell->GetId(), pixelCount);335 sprintf_s(filename, "error-frame-%04d-%04d-%08d.png", mFrame, viewcell->GetId(), pixelCount); 336 336 QImage im = toImage(); 337 337 string str = mSnapPrefix + filename; … … 367 367 368 368 im = toImage(); 369 sprintf (filename, "error-frame-%04d-%04d-%08d-pvs.png", mFrame, viewcell->GetId(), pixelCount);369 sprintf_s(filename, "error-frame-%04d-%04d-%08d-pvs.png", mFrame, viewcell->GetId(), pixelCount); 370 370 str = mSnapPrefix + filename; 371 371 qstr = str.c_str(); … … 1004 1004 switch (e->key()) 1005 1005 { 1006 case Qt::Key_E: 1007 mRenderErrors = !mRenderErrors; 1008 updateGL(); 1009 break; 1010 case Qt::Key_R: 1011 mUseRandomColorPerPvsObject = !mUseRandomColorPerPvsObject;; 1012 updateGL(); 1013 break; 1014 case Qt::Key_T: 1015 mTopView = !mTopView; 1016 SetupCameraProjection(width(), height()); 1017 updateGL(); 1018 break; 1019 case Qt::Key_V: 1020 mRenderViewCells = !mRenderViewCells; 1021 updateGL(); 1022 break; 1023 case Qt::Key_P: 1024 // set random viewpoint 1025 mViewCellsManager->GetViewPoint(mViewPoint); 1026 updateGL(); 1027 break; 1028 case Qt::Key_S: { 1029 // set view poitn and direction 1030 QString text; 1031 bool ok; 1032 text.sprintf("%f %f %f", mViewPoint.x, mViewPoint.y, mViewPoint.z); 1033 text = QInputDialog::getText(this, 1034 "Enter a view point", 1035 "", 1036 QLineEdit::Normal, 1037 text, 1038 &ok); 1039 if (!ok) 1006 case Qt::Key_E: 1007 mRenderErrors = !mRenderErrors; 1008 updateGL(); 1040 1009 break; 1041 1042 if (sscanf(text.toAscii(), "%f %f %f", &mViewPoint.x, &mViewPoint.y, &mViewPoint.z) == 3) { 1043 text.sprintf("%f %f %f", mViewDirection.x, mViewDirection.y, mViewDirection.z); 1010 case Qt::Key_R: 1011 mUseRandomColorPerPvsObject = !mUseRandomColorPerPvsObject;; 1012 updateGL(); 1013 break; 1014 case Qt::Key_T: 1015 mTopView = !mTopView; 1016 SetupCameraProjection(width(), height()); 1017 updateGL(); 1018 break; 1019 case Qt::Key_V: 1020 mRenderViewCells = !mRenderViewCells; 1021 updateGL(); 1022 break; 1023 case Qt::Key_P: 1024 // set random viewpoint 1025 mViewCellsManager->GetViewPoint(mViewPoint); 1026 updateGL(); 1027 break; 1028 case Qt::Key_S: { 1029 // set view poitn and direction 1030 QString text; 1031 bool ok; 1032 text.sprintf("%f %f %f", mViewPoint.x, mViewPoint.y, mViewPoint.z); 1044 1033 text = QInputDialog::getText(this, 1045 "Enter a direction",1034 "Enter a view point", 1046 1035 "", 1047 1036 QLineEdit::Normal, … … 1050 1039 if (!ok) 1051 1040 break; 1052 if (sscanf(text.toAscii(), "%f %f %f", &mViewDirection.x, 1053 &mViewDirection.y, &mViewDirection.z) == 3) { 1054 updateGL(); 1041 1042 if (sscanf_s(text.toAscii(), "%f %f %f", &mViewPoint.x, &mViewPoint.y, &mViewPoint.z) == 3) { 1043 text.sprintf("%f %f %f", mViewDirection.x, mViewDirection.y, mViewDirection.z); 1044 text = QInputDialog::getText(this, 1045 "Enter a direction", 1046 "", 1047 QLineEdit::Normal, 1048 text, 1049 &ok); 1050 if (!ok) 1051 break; 1052 if (sscanf_s(text.toAscii(), "%f %f %f", &mViewDirection.x, 1053 &mViewDirection.y, &mViewDirection.z) == 3) { 1054 updateGL(); 1055 1055 } 1056 1056 break; 1057 }1058 }1059 default:1060 cerr << "unknown key" << endl;1061 e->ignore();1062 break;1057 } 1058 } 1059 default: 1060 cerr << "unknown key" << endl; 1061 e->ignore(); 1062 break; 1063 1063 } 1064 1064 } … … 2700 2700 SetupCamera(); 2701 2701 2702 for ( size_t i = 0; i < GetPreprocessor()->mDynamicObjects.size(); ++ i)2702 for (GLuint i = 0; i < GetPreprocessor()->mDynamicObjects.size(); ++ i) 2703 2703 { 2704 2704 glLoadName(i); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp
r2686 r2705 60 60 void QtGlViewer::RenderScene() 61 61 { 62 GLfloat mat_ambient[] = { 0.5, 0.5, 0.5, 1.0};62 GLfloat mat_ambient[] = {0.5f, 0.5f, 0.5f, 1.0f}; 63 63 64 64 // mat_specular and mat_shininess are NOT default values 65 GLfloat mat_diffuse[] = { 1.0, 1.0, 1.0, 1.0};66 GLfloat mat_specular[] = { 0.3, 0.3, 0.3, 1.0};67 GLfloat mat_shininess[] = { 1.0};68 69 GLfloat light_ambient[] = { 0.2f, 0.2f, 0.2f, 1.0f};70 GLfloat light_diffuse[] = { 0.4f, 0.4f, 0.4f, 1.0f};71 GLfloat light_specular[] = { 0.3f, 0.3f, 0.3f, 1.0f};65 GLfloat mat_diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f}; 66 GLfloat mat_specular[] = {0.3f, 0.3f, 0.3f, 1.0f}; 67 GLfloat mat_shininess[] = {1.0f }; 68 69 GLfloat light_ambient[] = {0.2f, 0.2f, 0.2f, 1.0f}; 70 GLfloat light_diffuse[] = {0.4f, 0.4f, 0.4f, 1.0f}; 71 GLfloat light_specular[] = {0.3f, 0.3f, 0.3f, 1.0f}; 72 72 73 73 GLfloat lmodel_ambient[] = {0.3f, 0.3f, 0.3f, 1.0f}; … … 75 75 76 76 // set position of the light 77 GLfloat infinite_light[] = {1.0 , 0.8, 1.0, 0.0};77 GLfloat infinite_light[] = {1.0f, 0.8f, 1.0f, 0.0f}; 78 78 glLightfv (GL_LIGHT0, GL_POSITION, infinite_light); 79 79 80 80 // set position of the light2 81 GLfloat infinite_light2[] = {-0.3 , 1.5, 1.0, 0.0};81 GLfloat infinite_light2[] = {-0.3f, 1.5f, 1.0f, 0.0f}; 82 82 glLightfv (GL_LIGHT1, GL_POSITION, infinite_light2); 83 83
Note: See TracChangeset
for help on using the changeset viewer.