Ignore:
Timestamp:
05/22/08 14:07:56 (16 years ago)
Author:
mattausch
Message:

debug version: problematic view points for vienna detected

Location:
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
Files:
2 edited

Legend:

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

    r2694 r2695  
    141141 
    142142 
     143void QtGlRendererBuffer::RenderTrianglePvs() 
     144{ 
     145        ObjectContainer::const_iterator oit, oit_end =  
     146                mViewCellsManager->GetPreprocessor()->mTrianglePvs.end(); 
     147 
     148        //int sz = mViewCellsManager->GetPreprocessor()->mDummyBuffer.size(); 
     149 
     150        int i = 0; 
     151        for (oit = mViewCellsManager->GetPreprocessor()->mTrianglePvs.begin(); 
     152                 oit != oit_end; ++ oit, ++ i) 
     153        { 
     154                //int dum = mViewCellsManager->GetPreprocessor()->mDummyBuffer[i]; 
     155                //glColor3f(0, (float)dum / 20.0f, 1); 
     156                if (mUseFalseColors) SetupFalseColor((*oit)->mId); 
     157 
     158                RenderIntersectable(*oit); 
     159        } 
     160} 
     161 
     162 
     163 
    143164// reimplemented here so that we can snap the error windows 
    144165float QtGlRendererBuffer::GetPixelError(int &pvsSize) 
     
    182203        pvsSize = pvs.GetSize(); 
    183204         
     205        // hack: assume that view cell empty 
    184206        if (pvsSize == 0) 
    185207                return 0.0f; 
    186  
    187         mUseForcedColors = true; 
    188208 
    189209        SetupCamera(); 
     
    270290 
    271291        // some error happened 
    272         if (pixelCount > pixelThres)  
    273         { 
    274                 cout << "f " << mFrame << " id " << viewcell->GetId() << " pvs " << pvsSize << " e " << pixelCount << " vp " << mViewPoint << " vd " << mViewDirection << endl; 
     292        if (1)//pixelCount > pixelThres)  
     293        { 
     294                cout << "f " << mFrame << " id " << viewcell->GetId() << " pvs " << pvsSize  
     295                         << " e " << pixelCount << " vp " << mViewPoint << " vd " << mViewDirection << endl; 
    275296         
    276297                if (mSnapErrorFrames)  
     
    292313                        im.save(qstr, "PNG"); 
    293314 
    294 #if 0 
     315#if 1 
    295316                        /////////// 
    296317                        //-- output computed pvs 
    297  
    298                         //mUseFalseColors = true; 
     318                         
     319                        //mUseFalseColors = false; 
     320                        mUseFalseColors = true; 
    299321                        glPushAttrib(GL_CURRENT_BIT); 
    300322                        glColor3f(0, 1, 0); 
     
    309331 
    310332                        // render pvs once 
    311                         RenderPvs(pvs); 
     333                        //RenderPvs(pvs); 
     334                        RenderTrianglePvs(); 
    312335 
    313336                        glFlush(); 
    314337 
    315                         //mUseForcedColors = false; 
     338                        mUseFalseColors = false; 
     339 
    316340                        im = toImage(); 
    317341                        sprintf(filename, "error-frame-%04d-%04d-%08d-pvs.png", mFrame, viewcell->GetId(), pixelCount); 
     
    338362        int pvsSize = 0; 
    339363        QImage image = toImage(); 
     364 
    340365        Intersectable::NewMail(); 
    341366 
     
    12181243 
    12191244 
     1245QtGlRendererWidget::~QtGlRendererWidget()  
     1246{  
     1247        delete mPlacer;  
     1248} 
     1249 
     1250 
    12201251void 
    12211252QtGlRendererWidget::RenderRenderCost() 
     
    25712602} 
    25722603 
    2573  
    2574 } 
     2604/* 
     2605 
     2606int ExampleRenderThread::faceAtPosition(const QPoint &pos)  
     2607{  
     2608        // we need to lock the rendering context  
     2609        glw.lockGLContext();  
     2610        // this is the same as in every OpenGL picking example  
     2611        const int MaxSize = 512;  
     2612        // see below for an explanation on the buffer content  
     2613        GLuint buffer[MaxSize];  
     2614        GLint viewport[4]; 
     2615        glGetIntegerv(GL_VIEWPORT, viewport);  
     2616        glSelectBuffer(MaxSize, buffer);  
     2617        // enter select mode  
     2618        glRenderMode(GL_SELECT);  
     2619        glInitNames();  
     2620        glPushName(0);  
     2621        glMatrixMode(GL_PROJECTION);  
     2622        glPushMatrix();  
     2623        glLoadIdentity();  
     2624        gluPickMatrix((GLdouble)pos.x(), 215 (GLdouble)(viewport[3] - pos.y()), 216 5.0, 5.0, viewport);  
     2625        GLfloat x = (GLfloat)viewport_size.width() / viewport_size.height();  
     2626        glFrustum(-x, x, -1.0, 1.0, 4.0, 15.0);  
     2627        draw();  
     2628        glMatrixMode(GL_PROJECTION);  
     2629        glPopMatrix(); 
     2630        // finally release the rendering context again  
     2631        if (!glRenderMode(GL_RENDER))  
     2632        {  
     2633                glw.unlockGLContext();  
     2634                return -1;  
     2635        }  
     2636         
     2637        glw.unlockGLContext();  
     2638         
     2639        // Each hit takes 4 items in the buffer.  
     2640        // The first item is the number of names on the name stack when the hit occured.  
     2641        // The second item is the minimum z value of all the verticies that intersected 
     2642        // the viewing area at the time of the hit. The third item is the maximum z value  
     2643        // of all the vertices that intersected the viewing area at the time of the hit  
     2644        // and the last item is the content of the name stack at the time of the hit  
     2645        // (name of the object). We are only interested in the object name  
     2646        // (number of the surface).  
     2647        // return the name of the clicked surface  
     2648         
     2649        return buffer[3];  
     2650} 
     2651*/ 
     2652} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h

    r2694 r2695  
    7676        int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const; 
    7777 
     78        /** quick hack in order to be able to render gvs pvs. 
     79        */ 
     80        void RenderTrianglePvs(); 
    7881 
    7982public: 
     
    260263        QtGlRendererWidget() {}; 
    261264 
    262         ~QtGlRendererWidget() { delete mPlacer; } 
     265        ~QtGlRendererWidget(); 
    263266 
    264267        void SetThread(QtPreprocessorThread *t) 
     
    266269                mPreprocessorThread = t; 
    267270        } 
     271 
    268272        void RenderRenderCost(); 
    269273 
    270274        virtual void SetupCamera(); 
    271275 
    272         void initializeGL() { 
     276        void initializeGL()  
     277        { 
    273278                InitGL(); 
    274279        } 
Note: See TracChangeset for help on using the changeset viewer.