Ignore:
Timestamp:
12/10/07 09:12:27 (17 years ago)
Author:
mattausch
Message:

added functionality for visualization

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

Legend:

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

    r2543 r2560  
    690690        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    691691 
    692         if (1) { 
     692        if (1)  
     693        { 
    693694                SetupCameraProjection(width(), height()); 
    694695                SetupCamera(); 
    695696 
    696                 if (mRenderErrors) { 
     697                if (mRenderErrors)  
     698                { 
    697699                        RenderErrors(); 
    698                 } else { 
     700                }  
     701                else  
     702                { 
    699703                        glColor3f(0.6f, 0.6f, 0.6f); 
    700704                        RenderPvs(); 
     
    845849        mShowRenderCost = false; 
    846850        mShowPvsSizes = false; 
     851        mShowPiercingRays = false; 
    847852        mSpatialFilterSize = 0.01; 
    848853        mPvsSize = 0; 
     
    883888        connect(mControlWidget, SIGNAL(SetUseSpatialFilter(bool)), 
    884889                this, SLOT(SetUseSpatialFilter(bool))); 
     890        connect(mControlWidget, SIGNAL(SetShowPiercingRays(bool)), this, SLOT(SetShowPiercingRays(bool))); 
    885891 
    886892        connect(mControlWidget, 
     
    11461152        eq[3] = mSceneCutPlane.mD; 
    11471153 
    1148         if (mCutViewCells) { 
     1154        if (mCutViewCells)  
     1155        { 
    11491156                glClipPlane(GL_CLIP_PLANE0, eq); 
    11501157                glEnable(GL_CLIP_PLANE0); 
     
    11541161        ViewCellContainer &viewcells = mViewCellsManager->GetViewCells(); 
    11551162        int maxPvs = -1; 
    1156         for (i=0; i < viewcells.size(); i++)  
     1163        int maxPiercingRays = 0; 
     1164 
     1165        for (i = 0; i < viewcells.size(); ++ i)  
    11571166        { 
    11581167                ViewCell *vc = viewcells[i]; 
     
    11621171                if (p > maxPvs) 
    11631172                        maxPvs = p; 
    1164         } 
    1165  
    1166  
    1167         for (i=0; i < viewcells.size(); i++) { 
     1173                const int piercingRays = vc->GetNumPiercingRays(); 
     1174                if (piercingRays > maxPiercingRays) 
     1175                        maxPiercingRays = piercingRays; 
     1176        } 
     1177 
     1178 
     1179        for (i = 0; i < viewcells.size(); ++ i)  
     1180        { 
    11681181                ViewCell *vc = viewcells[i]; 
    11691182                //      Mesh *m = vc->GetMesh(); 
     
    11711184                RgbColor c; 
    11721185 
    1173                 if (!mShowPvsSizes) { 
     1186                if (!mShowPvsSizes && !mShowPiercingRays) 
     1187                { 
    11741188                        mWireFrame = true; 
    11751189                        c = vc->GetColor(); 
    1176                 } else { 
    1177                         //        const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs); 
    1178                         const float importance = 5.0f*mTransferFunction * 
     1190                }  
     1191                else if (mShowPiercingRays) 
     1192                { 
     1193                        // const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs); 
     1194                        const float importance = 5.0f * mTransferFunction * 
     1195                                ((float)vc->GetNumPiercingRays() / (float)maxPiercingRays); 
     1196                        // c = RgbColor(importance, 1.0f - importance, 0.0f); 
     1197                        c = RainbowColorMapping(importance); 
     1198                } 
     1199                else 
     1200                { 
     1201                        // const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs); 
     1202                        const float importance = 5.0f * mTransferFunction * 
    11791203                                ((float)vc->GetPvs().GetSize() / (float)maxPvs); 
    1180                         //        c = RgbColor(importance, 1.0f - importance, 0.0f); 
     1204                        // c = RgbColor(importance, 1.0f - importance, 0.0f); 
    11811205                        c = RainbowColorMapping(importance); 
    1182  
    11831206                } 
     1207 
    11841208                glColor3f(c.r, c.g, c.b); 
    11851209 
     
    11911215 
    11921216        glPopAttrib(); 
    1193  
    11941217} 
    11951218 
     
    13181341        connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowRays(bool))); 
    13191342 
    1320         vbox->resize(800,100); 
     1343         
     1344        cb = new QCheckBox("Show piercing rays", hbox); 
     1345        hlayout->addWidget(cb); 
     1346        cb->setChecked(false); 
     1347        connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowPiercingRays(bool))); 
     1348 
     1349        vbox->resize(800,150); 
    13211350 
    13221351 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h

    r2543 r2560  
    112112  void SetShowRenderCost(bool); 
    113113  void SetShowPvsSizes(bool); 
     114  void SetShowPiercingRays(bool); 
    114115  void SetTopView(bool); 
    115116  void SetCutViewCells(bool); 
    116117  void SetCutScene(bool); 
    117  
    118118}; 
    119119 
     
    137137        bool mUseSpatialFilter; 
    138138        bool mShowRenderCost; 
     139        bool mShowPiercingRays; 
    139140        bool mShowRays; 
    140141 
     
    293294        void SetShowPvsSizes(bool b) { 
    294295                mShowPvsSizes = b; 
     296                updateGL(); 
     297        } 
     298 
     299        void SetShowPiercingRays(bool b) { 
     300                mShowPiercingRays = b; 
    295301                updateGL(); 
    296302        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp

    r2538 r2560  
    5252        if (mRenderer->mRenderViewCells)  
    5353          mRenderer->RenderViewCells(); 
    54  
     54         
    5555        glColor3f(0.8f, 0.8f, 0.8f); 
    5656        mRenderer->RenderPvs(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj

    r2530 r2560  
    166166                                Name="VCCLCompilerTool" 
    167167                                AdditionalIncludeDirectories="..\..\src;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\include;&quot;$(CG_INC_PATH)&quot;" 
    168                                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS;USE_VERBOSE_PVS" 
     168                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS;USE_VERBOSE_PVS;USE_QT;USE_CG;GTP_INTERNAL" 
    169169                                RuntimeLibrary="2" 
    170170                                UsePrecompiledHeader="0" 
Note: See TracChangeset for help on using the changeset viewer.