Changeset 1925


Ignore:
Timestamp:
12/29/06 22:24:42 (17 years ago)
Author:
mattausch
Message:

debugged qtglrenderer (compiling again)

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
6 edited

Legend:

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

    r1785 r1925  
    2525static bool nvQuerySupport = false; 
    2626 
    27 GLuint frontDepthMap; 
    28 GLuint backDepthMap; 
     27static GLuint frontDepthMap; 
     28static GLuint backDepthMap; 
    2929 
    3030const int depthMapSize = 512; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.h

    r1528 r1925  
    2020struct SimpleRay; 
    2121 
     22 
    2223/** This class provides an interface for ray casting. 
    2324*/ 
     
    2728        /** Default constructor initialising e.g., KD tree and BSP tree. 
    2829        */ 
    29         IntelRayCaster( 
    30                 const Preprocessor &preprocessor, 
    31                 const string externKdTree); 
     30        IntelRayCaster(const Preprocessor &preprocessor, 
     31                                   const string externKdTree); 
    3232 
    3333        virtual ~IntelRayCaster(); 
    3434 
    35         int Type() const { return INTEL_RAYCASTER; } 
     35        int Type() const  
     36        {  
     37                return INTEL_RAYCASTER;  
     38        } 
    3639 
    37         virtual int CastRay( 
    38                 const SimpleRay &simpleRay, 
    39         VssRayContainer &vssRays, 
    40                 const AxisAlignedBox3 &box, 
    41                 const bool castDoubleRay, 
    42                 const bool pruneInvalidRays = true 
    43                 ); 
     40        virtual int CastRay(const SimpleRay &simpleRay, 
     41                                                VssRayContainer &vssRays, 
     42                                                const AxisAlignedBox3 &box, 
     43                                                const bool castDoubleRay, 
     44                                                const bool pruneInvalidRays = true); 
    4445 
    45          virtual void CastRays16( 
    46                  const int i, 
    47                  SimpleRayContainer &rays,  
    48                  VssRayContainer &vssRays, 
    49                  const AxisAlignedBox3 &sbox, 
    50                  const bool castDoubleRay, 
    51                  const bool pruneInvalidRays = true 
    52                  ); 
    53           
     46        virtual void CastRays16(const int i, 
     47                                                        SimpleRayContainer &rays,  
     48                                                        VssRayContainer &vssRays, 
     49                                                        const AxisAlignedBox3 &sbox, 
     50                                                        const bool castDoubleRay, 
     51                                                        const bool pruneInvalidRays = true); 
     52 
    5453protected: 
    5554 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h

    r1877 r1925  
    184184        int Compress() {return 0;} 
    185185        int GetSize() const {return (int)mEntries.size();} 
    186   bool Empty() const {return mEntries.empty();} 
    187  
    188   void Reserve(const int n) { mEntries.reserve(n); } 
     186        bool Empty() const {return mEntries.empty();} 
     187 
     188        void Reserve(const int n) { mEntries.reserve(n); } 
     189 
    189190        /** Normalize the visibility of entries in order to get  
    190191                comparable results. 
     
    901902                return s; 
    902903        } 
    903  
    904904}; 
    905905 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer/QtGlRenderer.cpp

    r1841 r1925  
    2323static CGprofile sCgFragmentProfile; 
    2424 
    25 GLuint frontDepthMap; 
    26 GLuint backDepthMap; 
     25static GLuint frontDepthMap; 
     26static GLuint backDepthMap; 
    2727 
    2828const int depthMapSize = 512; 
     
    213213QtGlRendererBuffer::GetPixelError(int &pvsSize) 
    214214{ 
    215   float pErrorPixels = -1.0f; 
    216    
    217   glReadBuffer(GL_BACK); 
    218    
    219   //  mUseFalseColors = true; 
    220    
    221   mUseFalseColors = false; 
    222   unsigned int pixelCount; 
    223  
    224   //static int query = -1; 
    225   //if (query == -1) 
    226 //        glGenOcclusionQueriesNV(1, (unsigned int *)&query); 
    227  
    228   OcclusionQuery query; 
    229  
    230   if (mDetectEmptyViewSpace) { 
    231         // now check whether any backfacing polygon would pass the depth test 
    232         SetupCamera(); 
    233         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    234         glEnable( GL_CULL_FACE ); 
    235          
    236         RenderScene(); 
    237          
    238         glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
    239         glDepthMask(GL_FALSE); 
    240         glDisable( GL_CULL_FACE ); 
    241  
    242          
    243         query.BeginQuery(); 
    244          
    245         RenderScene(); 
    246          
    247         query.EndQuery(); 
    248          
    249         // at this point, if possible, go and do some other computation 
    250         glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    251         glDepthMask(GL_TRUE); 
    252         glEnable( GL_CULL_FACE ); 
    253          
    254         // reenable other state 
    255         pixelCount = query.GetQueryResult(); 
    256          
    257         if (pixelCount > 0) 
    258           return -1.0f; // backfacing polygon found -> not a valid viewspace sample 
    259   } else 
    260         glDisable( GL_CULL_FACE ); 
    261          
    262  
    263   ViewCell *viewcell = NULL; 
    264    
    265   PrVs prvs; 
    266    
    267   mViewCellsManager->SetMaxFilterSize(0); 
    268   mViewCellsManager->GetPrVS(mViewPoint, prvs, mViewCellsManager->GetFilterWidth()); 
    269   viewcell = prvs.mViewCell; 
    270    
    271   //  ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 
    272   pvsSize = 0; 
    273   if (viewcell) { 
    274         SetupCamera(); 
    275         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    276  
    277         glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); 
    278          
    279         // Render PVS 
    280         ObjectPvsMap::const_iterator it = viewcell->GetPvs().mEntries.begin(); 
    281  
    282         pvsSize = viewcell->GetPvs().mEntries.size(); 
    283          
    284         for (; it != viewcell->GetPvs().mEntries.end(); ++ it) { 
    285           Intersectable *object = (*it).first; 
    286           RenderIntersectable(object); 
    287         } 
    288  
    289         //      glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); 
    290         glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    291         mUseFalseColors = true; 
    292  
    293         query.BeginQuery(); 
    294  
    295         SetupCamera(); 
    296  
    297         RenderScene(); 
    298          
    299         query.EndQuery(); 
    300          
    301  
     215        float pErrorPixels = -1.0f; 
     216 
     217        glReadBuffer(GL_BACK); 
     218 
     219        mUseFalseColors = false; 
    302220        unsigned int pixelCount; 
    303         // reenable other state 
    304         pixelCount = query.GetQueryResult(); 
    305          
    306          
    307         pErrorPixels = ((float)pixelCount)/(GetWidth()*GetHeight()); 
    308         if (mSnapErrorFrames && pErrorPixels > 0.01) { 
    309            
    310           char filename[256]; 
    311           sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 
    312           QImage im = toImage(); 
    313           string str = mSnapPrefix + filename; 
    314           QString qstr(str.c_str()); 
    315  
    316           im.save(qstr, "PNG"); 
    317           if (1) { //0 && mFrame == 1543) { 
    318                 int x,y; 
    319                 int lastIndex = -1; 
    320                 for (y=0; y < im.height(); y++) 
    321                   for (x=0; x < im.width(); x++) { 
    322                         QRgb p = im.pixel(x,y); 
    323                         int index = qRed(p) + (qGreen(p)<<8) + (qBlue(p)<<16); 
    324                         if (qGreen(p) != 255 && index!=0) { 
    325                           if (index != lastIndex) { 
    326                                 //                              Debug<<"ei="<<index<<" "; 
    327                                 lastIndex = index; 
    328                           } 
     221 
     222        OcclusionQuery query; 
     223 
     224        if (mDetectEmptyViewSpace)  
     225        { 
     226                // now check whether any backfacing polygon would pass the depth test 
     227                SetupCamera(); 
     228                glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     229                glEnable( GL_CULL_FACE ); 
     230 
     231                RenderScene(); 
     232 
     233                glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
     234                glDepthMask(GL_FALSE); 
     235                glDisable( GL_CULL_FACE ); 
     236 
     237 
     238                query.BeginQuery(); 
     239 
     240                RenderScene(); 
     241 
     242                query.EndQuery(); 
     243 
     244                // at this point, if possible, go and do some other computation 
     245                glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     246                glDepthMask(GL_TRUE); 
     247                glEnable( GL_CULL_FACE ); 
     248 
     249                // reenable other state 
     250                pixelCount = query.GetQueryResult(); 
     251 
     252                if (pixelCount > 0) 
     253                        return -1.0f; // backfacing polygon found -> not a valid viewspace sample 
     254        }  
     255        else 
     256        { 
     257                glDisable( GL_CULL_FACE ); 
     258        } 
     259 
     260        ViewCell *viewcell = NULL; 
     261 
     262        PrVs prvs; 
     263 
     264        mViewCellsManager->SetMaxFilterSize(0); 
     265        mViewCellsManager->GetPrVS(mViewPoint, prvs, mViewCellsManager->GetFilterWidth()); 
     266        viewcell = prvs.mViewCell; 
     267 
     268        // ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 
     269        pvsSize = 0; 
     270        if (viewcell)  
     271        { 
     272                SetupCamera(); 
     273                glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     274 
     275                glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); 
     276 
     277                // Render PVS 
     278                ObjectPvsIterator pit = viewcell->GetPvs().GetIterator(); 
     279 
     280                while (pit.HasMoreEntries()) 
     281                {                
     282                        const ObjectPvsEntry &entry = pit.Next(); 
     283                        Intersectable *obj = entry.mObject; 
     284 
     285                        RenderIntersectable(obj); 
     286                } 
     287 
     288                // glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); 
     289                glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     290                mUseFalseColors = true; 
     291 
     292                query.BeginQuery(); 
     293 
     294                SetupCamera(); 
     295 
     296                RenderScene(); 
     297 
     298                query.EndQuery(); 
     299 
     300                unsigned int pixelCount; 
     301                // reenable other state 
     302                pixelCount = query.GetQueryResult(); 
     303 
     304                pErrorPixels = ((float)pixelCount)/(GetWidth()*GetHeight()); 
     305                if (mSnapErrorFrames && pErrorPixels > 0.01)  
     306                { 
     307            char filename[256]; 
     308 
     309                        sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 
     310                        QImage im = toImage(); 
     311                        string str = mSnapPrefix + filename; 
     312                        QString qstr(str.c_str()); 
     313 
     314                        im.save(qstr, "PNG"); 
     315                        if (1)  
     316                        { 
     317                                int x,y; 
     318                                int lastIndex = -1; 
     319                                for (y=0; y < im.height(); y++) 
     320                                { 
     321                                        for (x=0; x < im.width(); x++)  
     322                                        { 
     323                                                QRgb p = im.pixel(x,y); 
     324 
     325                                                int index = qRed(p) + (qGreen(p)<<8) + (qBlue(p)<<16); 
     326                                                 
     327                                                if (qGreen(p) != 255 && index!=0)  
     328                                                { 
     329                                                        if (index != lastIndex)  
     330                                                        { 
     331                                                                lastIndex = index; 
     332                                                        } 
     333                                                } 
     334                                        } 
     335                                } 
    329336                        } 
    330                   } 
    331           } 
    332  
    333  
    334           mUseFalseColors = false; 
    335           glPushAttrib(GL_CURRENT_BIT); 
    336           glColor3f(0,1,0); 
    337           glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    338           SetupCamera(); 
    339           glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    340            
    341           // Render PVS 
    342           ObjectPvsMap::const_iterator it = viewcell->GetPvs().mEntries.begin(); 
    343            
    344           for (; it != viewcell->GetPvs().mEntries.end(); ++ it) { 
    345                 Intersectable *object = (*it).first; 
    346                 RenderIntersectable(object); 
    347           } 
    348  
    349           im = toImage(); 
    350           sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels); 
    351           str = mSnapPrefix + filename; 
    352           qstr = str.c_str(); 
    353           im.save(qstr, "PNG"); 
    354           glPopAttrib(); 
    355         } 
    356         glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    357   } 
    358  
    359   if (viewcell && mViewCellsManager->GetMaxFilterSize() > 0) 
    360         mViewCellsManager->DeleteLocalMergeTree(viewcell); 
    361    
    362   return pErrorPixels; 
     337 
     338                        mUseFalseColors = false; 
     339                        glPushAttrib(GL_CURRENT_BIT); 
     340                        glColor3f(0,1,0); 
     341                        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     342                        SetupCamera(); 
     343                        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     344 
     345                        // Render PVS 
     346                        ObjectPvsIterator pit = viewcell->GetPvs().GetIterator(); 
     347 
     348                        while (pit.HasMoreEntries()) 
     349                        {                
     350                                const ObjectPvsEntry &entry = pit.Next(); 
     351                                Intersectable *obj = entry.mObject; 
     352 
     353                                RenderIntersectable(obj); 
     354                        } 
     355 
     356                        im = toImage(); 
     357                        sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels); 
     358                        str = mSnapPrefix + filename; 
     359                        qstr = str.c_str(); 
     360                        im.save(qstr, "PNG"); 
     361                        glPopAttrib(); 
     362                } 
     363                glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     364        } 
     365 
     366        if (viewcell && mViewCellsManager->GetMaxFilterSize() > 0) 
     367                mViewCellsManager->DeleteLocalMergeTree(viewcell); 
     368 
     369        return pErrorPixels; 
    363370} 
    364371 
     
    512519 
    513520void QtGlRendererBuffer::SampleViewpointContributions(Intersectable *sourceObject, 
    514                                                                                                         const Vector3 viewPoint, 
    515                                                                                                         Beam &beam, 
    516                                                                                                         const int samples, 
    517                                                     BeamSampleStatistics &stat) 
     521                                                                                                          const Vector3 viewPoint, 
     522                                                                                                          Beam &beam, 
     523                                                                                                          const int samples, 
     524                                                                                                          BeamSampleStatistics &stat) 
    518525{ 
    519526    // 1. setup the view port to match the desired samples 
     
    864871 
    865872int QtGlRendererBuffer::ComputePvs(ObjectContainer &objects,  
    866                                                                  ObjectContainer &pvs) const 
     873                                                                   ObjectContainer &pvs) const 
    867874{ 
    868875        int pvsSize = 0; 
     
    933940        viewcell = mViewCellsManager->GetViewCell(mViewPoint, true); 
    934941  } else { 
    935         //  mViewCellsManager->SetMaxFilterSize(1); 
    936         mViewCellsManager->GetPrVS(mViewPoint, prvs, mViewCellsManager->GetFilterWidth()); 
    937         viewcell = prvs.mViewCell; 
     942          //  mViewCellsManager->SetMaxFilterSize(1); 
     943          mViewCellsManager->GetPrVS(mViewPoint, prvs, mViewCellsManager->GetFilterWidth()); 
     944          viewcell = prvs.mViewCell; 
    938945  } 
    939    
    940   if (viewcell) { 
    941         // copy the pvs so that it can be filtered... 
    942         ObjectPvs pvs = viewcell->GetPvs(); 
    943  
    944         if (mUseSpatialFilter) { 
    945           mViewCellsManager->ApplySpatialFilter(mKdTree, 
    946                                                                                         mSpatialFilterSize* 
    947                                                                                         Magnitude(mViewCellsManager->GetViewSpaceBox().Size()), 
    948                                                                                         pvs); 
    949         } 
    950          
    951          
    952         // read back the texture 
    953         ObjectPvsMap::const_iterator it = pvs.mEntries.begin(); 
    954  
    955         mPvsSize = pvs.mEntries.size(); 
    956            
    957         for (; it != pvs.mEntries.end(); ++ it) { 
    958           Intersectable *object = (*it).first; 
    959           float visibility = log10((*it).second.mSumPdf + 1)/5.0f; 
    960           glColor3f(visibility, 0.0f, 0.0f); 
    961           mUseForcedColors = true; 
    962           RenderIntersectable(object); 
    963           mUseForcedColors = false; 
    964         } 
    965  
    966         if (mRenderFilter) { 
    967           mWireFrame = true; 
    968           RenderIntersectable(viewcell); 
    969           mWireFrame = false; 
    970         } 
    971          
    972         if (mUseFilter) 
    973           mViewCellsManager->DeleteLocalMergeTree(viewcell); 
    974   } else { 
    975         ObjectContainer::const_iterator oi = mObjects.begin(); 
    976         for (; oi != mObjects.end(); oi++) 
    977           RenderIntersectable(*oi); 
     946 
     947  if (viewcell)  
     948  { 
     949          // copy the pvs so that it can be filtered... 
     950          ObjectPvs pvs = viewcell->GetPvs(); 
     951 
     952          if (mUseSpatialFilter) { 
     953                  mViewCellsManager->ApplySpatialFilter(mKdTree, 
     954                          mSpatialFilterSize* 
     955                          Magnitude(mViewCellsManager->GetViewSpaceBox().Size()), 
     956                          pvs); 
     957          } 
     958 
     959          // read back the texture 
     960          mPvsSize = pvs.GetSize(); 
     961 
     962          ObjectPvsIterator pit = pvs.GetIterator(); 
     963 
     964          while (pit.HasMoreEntries()) 
     965          {              
     966                  const ObjectPvsEntry &entry = pit.Next(); 
     967                  Intersectable *obj = entry.mObject; 
     968 
     969                  float visibility = log10(entry.mData.mSumPdf + 1) / 5.0f; 
     970                  glColor3f(visibility, 0.0f, 0.0f); 
     971                  mUseForcedColors = true; 
     972                  RenderIntersectable(obj); 
     973                  mUseForcedColors = false; 
     974          } 
     975 
     976          if (mRenderFilter)  
     977          { 
     978                  mWireFrame = true; 
     979                  RenderIntersectable(viewcell); 
     980                  mWireFrame = false; 
     981          } 
     982 
     983          if (mUseFilter) 
     984          { 
     985                  mViewCellsManager->DeleteLocalMergeTree(viewcell); 
     986          } 
     987  }  
     988  else  
     989  { 
     990          ObjectContainer::const_iterator oi = mObjects.begin(); 
     991          for (; oi != mObjects.end(); oi++) 
     992                  RenderIntersectable(*oi); 
    978993  } 
    979994} 
     
    13131328  QString s; 
    13141329  int vc = 0; 
     1330   
    13151331  if (mViewCellsManager) 
    1316         vc = mViewCellsManager->GetViewCells().size(); 
     1332          vc = (int)mViewCellsManager->GetViewCells().size(); 
     1333 
    13171334  int filter = 0; 
    13181335  if (mViewCellsManager) 
    13191336        filter = mViewCellsManager->GetMaxFilterSize(); 
    13201337 
    1321   s.sprintf("frame:%04d viewpoint:(%4.1f,%4.1f,%4.1f) dir:(%4.1f,%4.1f,%4.1f) viewcells:%04d filter:%04d pvs:%04d error:%5.5f\%", 
     1338  s.sprintf("frame:%04d viewpoint:(%4.1f,%4.1f,%4.1f) dir:(%4.1f,%4.1f,%4.1f) viewcells:%04d filter:%04d pvs:%04d error:%5.5f %", 
    13221339                        mFrame, 
    13231340                        mViewPoint.x, 
     
    14831500QtGlRendererWidget::RenderViewCells() 
    14841501{ 
    1485   mUseFalseColors = true; 
    1486  
    1487   SetupCamera(); 
    1488   glEnable(GL_CULL_FACE); 
    1489   //glDisable(GL_CULL_FACE); 
    1490   glCullFace(GL_FRONT); 
    1491   double eq[4]; 
    1492   eq[0] = mSceneCutPlane.mNormal.x; 
    1493   eq[1] = mSceneCutPlane.mNormal.y; 
    1494   eq[2] = mSceneCutPlane.mNormal.z; 
    1495   eq[3] = mSceneCutPlane.mD; 
    1496  
    1497   if (mCutViewCells) { 
    1498         glClipPlane(GL_CLIP_PLANE0, eq); 
    1499         glEnable(GL_CLIP_PLANE0); 
    1500   } 
    1501    
    1502   int i; 
    1503   ViewCellContainer &viewcells = mViewCellsManager->GetViewCells(); 
    1504   int maxPvs = -1; 
    1505   for (i=0; i < viewcells.size(); i++)  
    1506   { 
    1507         ViewCell *vc = viewcells[i]; 
    1508         const int p = vc->GetPvs().CountObjectsInPvs(); 
    1509         if (p > maxPvs) 
    1510           maxPvs = p; 
    1511   } 
    1512  
    1513  
    1514   for (i=0; i < viewcells.size(); i++) { 
    1515         ViewCell *vc = viewcells[i]; 
    1516         //      Mesh *m = vc->GetMesh(); 
    1517  
    1518  
    1519         RgbColor c; 
    1520  
    1521         if (!mShowPvsSizes)  
    1522           c = vc->GetColor(); 
    1523         else { 
    1524           const float importance = (float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs; 
    1525           c = RgbColor(importance, 1.0f - importance, 0.0f); 
    1526         } 
    1527         glColor3f(c.r, c.g, c.b); 
    1528          
    1529         RenderViewCell(vc); 
    1530   } 
    1531  
    1532   glDisable(GL_CLIP_PLANE0); 
    1533  
     1502        mUseFalseColors = true; 
     1503 
     1504        SetupCamera(); 
     1505        glEnable(GL_CULL_FACE); 
     1506        //glDisable(GL_CULL_FACE); 
     1507        glCullFace(GL_FRONT); 
     1508        double eq[4]; 
     1509        eq[0] = mSceneCutPlane.mNormal.x; 
     1510        eq[1] = mSceneCutPlane.mNormal.y; 
     1511        eq[2] = mSceneCutPlane.mNormal.z; 
     1512        eq[3] = mSceneCutPlane.mD; 
     1513 
     1514        if (mCutViewCells)  
     1515        { 
     1516                glClipPlane(GL_CLIP_PLANE0, eq); 
     1517                glEnable(GL_CLIP_PLANE0); 
     1518        } 
     1519 
     1520        //int i; 
     1521        ViewCellContainer &viewCells = mViewCellsManager->GetViewCells(); 
     1522        float maxPvs = -1; 
     1523        ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 
     1524 
     1525        for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
     1526        { 
     1527                ViewCell *vc = *vit; 
     1528                const float p = vc->GetPvs().EvalPvsCost(); 
     1529                if (p > maxPvs) 
     1530                        maxPvs = p; 
     1531        } 
     1532 
     1533        for (vit = viewCells.begin(); vit != vit_end; ++ vit)  
     1534        { 
     1535                ViewCell *vc = *vit; 
     1536 
     1537                RgbColor c; 
     1538 
     1539                if (!mShowPvsSizes)  
     1540                { 
     1541                        c = vc->GetColor(); 
     1542                } 
     1543                else  
     1544                { 
     1545                        const float importance = (float)vc->GetPvs().EvalPvsCost() / (float)maxPvs; 
     1546                        c = RgbColor(importance, 1.0f - importance, 0.0f); 
     1547                } 
     1548 
     1549                glColor3f(c.r, c.g, c.b); 
     1550 
     1551                RenderViewCell(vc); 
     1552        } 
     1553 
     1554        glDisable(GL_CLIP_PLANE0); 
    15341555} 
    15351556 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer/QtGlRenderer.h

    r1252 r1925  
    44#include <QtOpenGL> 
    55#include <QWaitCondition> 
    6  
    7 //#include <QGLPixelBuffer> 
    86 
    97#include "Vector3.h" 
     
    3634 
    3735 
    38 class __declspec(dllexport) QtGlRendererBuffer : public QObject, public QGLPixelBuffer, public GlRendererBuffer 
     36class __declspec(dllexport) QtGlRendererBuffer: public QObject, public QGLPixelBuffer, public GlRendererBuffer 
    3937{ 
    4038        Q_OBJECT 
    4139public: 
    4240        QtGlRendererBuffer(const int w, 
    43                 const int h, 
    44                 SceneGraph *sceneGraph, 
    45                 ViewCellsManager *viewcells, 
    46                 KdTree *tree); 
     41                                           const int h, 
     42                                           SceneGraph *sceneGraph, 
     43                                           ViewCellsManager *viewcells, 
     44                                           KdTree *tree); 
    4745 
    4846        ~QtGlRendererBuffer(); 
     
    104102  */ 
    105103  void ComputeRays(Intersectable *sourceObj, VssRayContainer &rays); 
    106  
    107   int ComputePvs() const; 
    108104 
    109105  float 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer/QtGlRenderer.vcproj

    r1520 r1925  
    9090                        <Tool 
    9191                                Name="VCLinkerTool" 
    92                                 AdditionalDependencies="Preprocessor.lib qtmain.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib QtCore4.lib QtOpenGL4.lib xerces-c_2.lib glew32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib" 
     92                                AdditionalDependencies="Preprocessor.lib qtmain.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib QtCore4.lib QtOpenGL4.lib xerces-c_2.lib glew32.lib OpenGL32.Lib glu32.lib cg.lib RTScene.lib RTWorld.lib cgGL.lib" 
    9393                                OutputFile="$(OutDir)/QtGlRenderer.dll" 
    9494                                LinkIncremental="1" 
    95                                 AdditionalLibraryDirectories="&quot;$(QTDIR)\lib&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib;&quot;$(CG_LIB_PATH)&quot;;..\..\src\GL;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;&quot;..\..\lib\$(ConfigurationName)&quot;" 
     95                                AdditionalLibraryDirectories="&quot;$(QTDIR)\lib&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\lib;&quot;$(CG_LIB_PATH)&quot;;..\..\src\GL;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;&quot;..\..\lib\$(ConfigurationName)&quot;;..\..\MultiLevelRayTracing\RTScene\Release;..\..\MultiLevelRayTracing\RTWorld\Release" 
    9696                                GenerateDebugInformation="FALSE" 
    9797                                SubSystem="2" 
Note: See TracChangeset for help on using the changeset viewer.