Ignore:
Timestamp:
05/24/08 11:59:35 (16 years ago)
Author:
mattausch
Message:

enabled view cell visualization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2704 r2705  
    333333                        char filename[256]; 
    334334                        //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); 
    336336                        QImage im = toImage(); 
    337337                        string str = mSnapPrefix + filename; 
     
    367367 
    368368                                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); 
    370370                                str = mSnapPrefix + filename; 
    371371                                qstr = str.c_str(); 
     
    10041004        switch (e->key())  
    10051005        { 
    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(); 
    10401009                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); 
    10441033                text = QInputDialog::getText(this, 
    1045                         "Enter a direction", 
     1034                        "Enter a view point", 
    10461035                        "", 
    10471036                        QLineEdit::Normal, 
     
    10501039                if (!ok) 
    10511040                        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(); 
    10551055                        } 
    10561056                        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; 
    10631063        } 
    10641064} 
     
    27002700        SetupCamera(); 
    27012701 
    2702         for (size_t i = 0; i < GetPreprocessor()->mDynamicObjects.size(); ++ i) 
     2702        for (GLuint i = 0; i < GetPreprocessor()->mDynamicObjects.size(); ++ i) 
    27032703        { 
    27042704                glLoadName(i); 
Note: See TracChangeset for help on using the changeset viewer.