Changeset 997


Ignore:
Timestamp:
05/31/06 10:04:05 (18 years ago)
Author:
mattausch
Message:

fixed bug for histogram
improved samplerenderer
todo: difference detectempty true / false

Location:
GTP/trunk/Lib/Vis
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/TestPreprocessor.vcproj

    r991 r997  
    8080                        <Tool 
    8181                                Name="VCLinkerTool" 
    82                                 AdditionalDependencies="xerces-c_2.lib zdll.lib zziplib.lib devil.lib qtmain.lib QtGuid4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib QtCore4.lib QtOpenGL4.lib" 
     82                                AdditionalDependencies="xerces-c_2.lib zdll.lib zziplib.lib devil.lib qtmain.lib QtGui4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib QtCore4.lib QtOpenGL4.lib" 
    8383                                OutputFile="$(OutDir)/Preprocessor.exe" 
    8484                                LinkIncremental="1" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r991 r997  
    11681168                                 "1000"); 
    11691169 
    1170   RegisterOption("VssPreprocessor.initialSamples", 
     1170   RegisterOption("RenderSampler.useOcclusionQueries", 
     1171                                 optBool, 
     1172                                 "render_sampler_use_occlusion_queries=", 
     1173                                 "true"); 
     1174 
     1175   RegisterOption("VssPreprocessor.initialSamples", 
    11711176                                 optInt, 
    11721177                                 "initial_samples=", 
     
    12471252                                        "false"); 
    12481253 
    1249         RegisterOption("ViewCells.Evaluation.histoPasses", 
    1250                                         optInt, 
    1251                                         "view_cells_evaluation_histo_passes=", 
     1254        RegisterOption("ViewCells.Evaluation.histoStepSize", 
     1255                                        optInt, 
     1256                                        "view_cells_evaluation_histo_step_size=", 
    12521257                                        "5000"); 
    12531258 
     
    16451650                                   "pvsRenderErrorSamples=", 
    16461651                                   "10000"); 
    1647  
    16481652         
    16491653        RegisterOption("Preprocessor.useGlRenderer", 
     
    16741678        RegisterOption("Preprocessor.exportVisibility", 
    16751679                                   optBool, 
    1676                                    "preprocessor_export_visibility", 
     1680                                   "preprocessor_export_visibility=", 
    16771681                                   "true"); 
    16781682 
     
    16841688        RegisterOption("Preprocessor.applyVisibilityFilter", 
    16851689                                   optBool, 
    1686                                    "preprocessor_apply_filter", 
     1690                                   "preprocessor_apply_filter=", 
    16871691                                   "true"); 
    16881692         
    16891693        RegisterOption("Preprocessor.applyVisibilitySpatialFilter", 
    16901694                                   optBool, 
    1691                                    "preprocessor_apply_spatial_filter", 
     1695                                   "preprocessor_apply_spatial_filter=", 
    16921696                                   "true"); 
    16931697 
     
    17191723        RegisterOption("VspKdTree.Termination.maxDepth",  
    17201724                optInt,  
    1721                 "vsp_term_maxdepth=", "30"); 
     1725                "vsp_term_maxdepth=",  
     1726                "30"); 
    17221727 
    17231728        RegisterOption("VspKdTree.Termination.minPvs",  
     
    18581863         
    18591864        RegisterOption("VssTree.queryPosWeight", optFloat, "qposweight=", "0.0"); 
    1860         RegisterOption("VssTree.useRefDirSplits", optBool, "refdir", "false"); 
     1865        RegisterOption("VssTree.useRefDirSplits", optBool, "refdir=", "false"); 
    18611866        RegisterOption("VssTree.refDirAngle", optFloat, "refangle=", "10"); 
    18621867        RegisterOption("VssTree.refDirBoxMaxSize", optFloat, "refboxsize=", "0.1"); 
     
    18901895        RegisterOption("RssPreprocessor.useImportanceSampling", 
    18911896                                        optBool, 
    1892                                         "rss_use_importance", 
     1897                                        "rss_use_importance=", 
    18931898                                        "true"); 
    18941899 
    18951900        RegisterOption("RssPreprocessor.objectBasedSampling", 
    18961901                                        optBool, 
    1897                                         "rss_object_based_sampling", 
     1902                                        "rss_object_based_sampling=", 
    18981903                                        "true"); 
    18991904 
    19001905        RegisterOption("RssPreprocessor.directionalSampling", 
    19011906                                        optBool, 
    1902                                         "rss_directional_sampling", 
     1907                                        "rss_directional_sampling=", 
    19031908                                        "false"); 
    19041909 
     
    19111916        RegisterOption("RssTree.epsilon", optFloat, "kd_eps=", "1e-6"); 
    19121917        RegisterOption("RssTree.ct_div_ci", optFloat, "kd_ctdivci=", "1.0"); 
    1913         RegisterOption("RssTree.randomize", optBool, "randomize", "false"); 
     1918        RegisterOption("RssTree.randomize", optBool, "randomize=", "false"); 
    19141919        RegisterOption("RssTree.splitType", optString, "split=", "queries"); 
    19151920        RegisterOption("RssTree.splitUseOnlyDrivingAxis", optBool, "splitdriving=", "false"); 
     
    19311936        RegisterOption("RssTree.minCollapseDepth", optInt, "colldepth=", "4"); 
    19321937 
    1933         RegisterOption("RssTree.interleaveDirSplits", optBool, "interleavedirsplits", "true"); 
     1938        RegisterOption("RssTree.interleaveDirSplits", optBool, "interleavedirsplits=", "true"); 
    19341939        RegisterOption("RssTree.dirSplitDepth", optInt, "dirsplidepth=", "10"); 
    1935         RegisterOption("RssTree.importanceBasedCost", optBool, "importance_based_cost", "true"); 
     1940        RegisterOption("RssTree.importanceBasedCost", optBool, "importance_based_cost=", "true"); 
    19361941        RegisterOption("RssTree.maxRays", optInt, "rss_max_rays=", "2000000"); 
    19371942 
    19381943        RegisterOption("RssTree.perObjectTree", optBool, "rss_per_object_tree", "false"); 
    19391944 
    1940         RegisterOption("RssPreprocessor.Export.pvs", optBool, "rss_export_pvs", "false"); 
    1941         RegisterOption("RssPreprocessor.Export.rssTree", optBool, "rss_export_rss_tree", "false"); 
    1942         RegisterOption("RssPreprocessor.Export.rays", optBool, "rss_export_rays", "false"); 
     1945        RegisterOption("RssPreprocessor.Export.pvs", optBool, "rss_export_pvs=", "false"); 
     1946        RegisterOption("RssPreprocessor.Export.rssTree", optBool, "rss_export_rss_tree=", "false"); 
     1947        RegisterOption("RssPreprocessor.Export.rays", optBool, "rss_export_rays=", "false"); 
    19431948        RegisterOption("RssPreprocessor.Export.numRays", optInt, "rss_export_num_rays=", "5000"); 
    1944         RegisterOption("RssPreprocessor.useViewcells", optBool, "rss_use_viewcells", "false"); 
     1949        RegisterOption("RssPreprocessor.useViewcells", optBool, "rss_use_viewcells=", "false"); 
    19451950        RegisterOption("RssPreprocessor.updateSubdivision", 
    19461951                                   optBool, 
    1947                                    "rss_update_subdivision", 
     1952                                   "rss_update_subdivision=", 
    19481953                                   "false"); 
    19491954 
     
    19711976        RegisterOption("VspBspTree.Termination.minGlobalCostRatio", 
    19721977                                        optFloat, 
    1973                                         "vsp_bsp_term_min_global_cost_ratio", 
     1978                                        "vsp_bsp_term_min_global_cost_ratio=", 
    19741979                                        "0.0001"); 
    19751980 
     
    19811986        RegisterOption("VspBspTree.Termination.globalCostMissTolerance", 
    19821987                                        optInt, 
    1983                                         "vsp_bsp_term_global_cost_miss_tolerance", 
     1988                                        "vsp_bsp_term_global_cost_miss_tolerance=", 
    19841989                                        "4"); 
    19851990 
     
    20502055 
    20512056        RegisterOption("VspBspTree.Termination.missTolerance", 
    2052                                         optInt, 
    2053                                         "vsp_bsp_term_miss_tolerance=", 
    2054                                         "4"); 
     2057                optInt, 
     2058                "vsp_bsp_term_miss_tolerance=", 
     2059                "4"); 
     2060 
    20552061        RegisterOption("VspBspTree.splitPlaneStrategy", 
    20562062                                        optString, 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r991 r997  
    444444 
    445445void 
     446GlRendererBuffer::EvalQueryWithItemBuffer( 
     447                                                                           //RenderCostSample &sample 
     448                                                                           ) 
     449{ 
     450        // read back the texture 
     451        glReadPixels(0, 0, 
     452                                GetWidth(), GetHeight(), 
     453                                GL_RGBA, 
     454                                GL_UNSIGNED_BYTE, 
     455                                mPixelBuffer); 
     456                 
     457                         
     458        unsigned int *p = mPixelBuffer; 
     459                         
     460        for (int y = 0; y < GetHeight(); y++) 
     461        { 
     462                for (int x = 0; x < GetWidth(); x++, p++)  
     463                { 
     464                        unsigned int id = (*p) & 0xFFFFFF; 
     465 
     466                        if (id != 0xFFFFFF) 
     467                                ++ mObjects[id]->mCounter; 
     468                } 
     469        } 
     470} 
     471 
     472 
     473void 
     474GlRendererBuffer::EvalQueryWithOcclusionQueries( 
     475                                                                           //RenderCostSample &sample 
     476                                                                           ) 
     477{ 
     478        glDepthFunc(GL_LEQUAL); 
     479                 
     480        glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
     481        glDepthMask(GL_FALSE); 
     482                 
     483        // now issue queries for all objects 
     484        for (int j = 0; j < mObjects.size(); ++ j)  
     485        { 
     486                for (int q = 0; j + q < mObjects.size() && q < mOcclusionQueries.size(); ++ q)  
     487                { 
     488                        glBeginOcclusionQueryNV(mOcclusionQueries[q]); 
     489                                         
     490                        RenderIntersectable(mObjects[j + q]); 
     491                        glEndOcclusionQueryNV(); 
     492                } 
     493                 
     494                // collect results of the queries 
     495                for (int q = 0; j + q < mObjects.size() && q < mOcclusionQueries.size(); ++ q)  
     496                { 
     497                        unsigned int pixelCount; 
     498                                         
     499                        //-- reenable other state 
     500#if 1 
     501                        do  
     502                        { 
     503                                glGetOcclusionQueryuivNV(mOcclusionQueries[q], 
     504                                                                                GL_PIXEL_COUNT_AVAILABLE_NV, 
     505                                                                                &pixelCount); 
     506                                         
     507                                if (0 && !pixelCount) cout << "W"; 
     508                        }  
     509                        while (!pixelCount); 
     510#endif 
     511 
     512                        glGetOcclusionQueryuivNV(mOcclusionQueries[q], 
     513                                                                        GL_PIXEL_COUNT_NV, 
     514                                                                        &pixelCount); 
     515 
     516                        // if (pixelCount) 
     517                        // cout<<"q="<<mOcclusionQueries[q]<<" pc="<<pixelCount<<" "; 
     518                         
     519                        mObjects[j + q]->mCounter += pixelCount; 
     520                } 
     521 
     522                j += q; 
     523        } 
     524                 
     525        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     526        glDepthMask(GL_TRUE); 
     527} 
     528 
     529 
     530void 
    446531GlRendererBuffer::EvalRenderCostSample( 
    447532                                                                           RenderCostSample &sample 
    448533                                                                           ) 
    449534{ 
    450   mViewCellsManager->GetViewPoint(mViewPoint); 
    451   sample.mPosition = mViewPoint; 
    452  
    453   cout << mViewPoint << endl; 
    454    
    455   // take a render cost sample by rendering a cube 
    456   Vector3 directions[6]; 
    457   directions[0] = Vector3(1,0,0); 
    458   directions[1] = Vector3(0,1,0); 
    459   directions[2] = Vector3(0,0,1); 
    460   directions[3] = Vector3(-1,0,0); 
    461   directions[4] = Vector3(0,-1,0); 
    462   directions[5] = Vector3(0,0,-1); 
    463  
    464   sample.mVisibleObjects = 0; 
    465  
    466   int i, j; 
    467    
    468   // reset object visibility 
    469   for (i=0; i < mObjects.size(); i++) { 
    470         mObjects[i]->mCounter = 0; 
    471   } 
    472   mFrame++; 
    473   for (i=0; i < 6; i++) { 
    474         mViewDirection = directions[i]; 
    475         SetupCamera(); 
    476         glClearColor(1.0f, 1.0f, 1.0f, 1.0f); 
    477         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    478          
    479         glDepthFunc( GL_LESS ); 
    480  
    481         mUseFalseColors = true; 
    482  
    483         RenderScene(); 
    484  
    485         if (1) { 
    486           char filename[256]; 
    487           sprintf(filename, "snap/frame-%04d-%d.png", mFrame, i); 
    488           QImage im = toImage(); 
    489           im.save(filename, "PNG"); 
    490         } 
    491          
    492         bool useItemBuffer = false; 
    493          
    494         if (useItemBuffer) { 
    495           // read back the texture 
    496           glReadPixels(0, 0, 
    497                                    GetWidth(), GetHeight(), 
    498                                    GL_RGBA, 
    499                                    GL_UNSIGNED_BYTE, 
    500                                    mPixelBuffer); 
    501            
    502           int x, y; 
    503           unsigned int *p = mPixelBuffer; 
    504           for (y = 0; y < GetHeight(); y++) 
    505                 for (x = 0; x < GetWidth(); x++, p++) { 
    506                   unsigned int id = (*p) & 0xFFFFFF; 
    507                   if (id != 0xFFFFFF) 
    508                         mObjects[id]->mCounter++; 
     535        // choose a random view point 
     536        mViewCellsManager->GetViewPoint(mViewPoint); 
     537        sample.mPosition = mViewPoint; 
     538        //cout << "viewpoint: " << mViewPoint << endl; 
     539 
     540        // take a render cost sample by rendering a cube 
     541        Vector3 directions[6]; 
     542 
     543        directions[0] = Vector3(1,0,0); 
     544        directions[1] = Vector3(0,1,0); 
     545        directions[2] = Vector3(0,0,1); 
     546        directions[3] = Vector3(-1,0,0); 
     547        directions[4] = Vector3(0,-1,0); 
     548        directions[5] = Vector3(0,0,-1); 
     549 
     550        sample.mVisibleObjects = 0; 
     551 
     552        int i, j; 
     553 
     554        // reset object visibility 
     555        for (i=0; i < mObjects.size(); i++)  
     556        { 
     557                mObjects[i]->mCounter = 0; 
     558        } 
     559 
     560        ++ mFrame; 
     561 
     562        // either use occlusion queries or item buffer 
     563        bool useOcclusionQueries; 
     564        environment->GetBoolValue("RenderSampler.useOcclusionQueries", useOcclusionQueries); 
     565 
     566        //if (useOcclusionQueries) cout << "using occlusion queries" << endl; 
     567        //else cout << "using item buffer" << endl; 
     568         
     569        glCullFace(GL_FRONT); 
     570 
     571        if (mDetectEmptyViewSpace)  
     572        { 
     573                glEnable(GL_CULL_FACE); 
     574                cout << "culling" << endl; 
     575        } 
     576        else 
     577        { 
     578                cout << "not culling" << endl; 
     579                glDisable(GL_CULL_FACE); 
     580        } 
     581 
     582        for (i = 0; i < 6; ++ i)  
     583        { 
     584                mViewDirection = directions[i]; 
     585                SetupCamera(); 
     586 
     587                glClearColor(1.0f, 1.0f, 1.0f, 1.0f); 
     588                glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     589                glDepthFunc(GL_LESS); 
     590                mUseFalseColors = true; 
     591 
     592 
     593                // the actual scene rendering 
     594 
     595                RenderScene(); 
     596 
     597 
     598                if (0)  
     599                { 
     600                        char filename[256]; 
     601                        sprintf(filename, "snap/frame-%04d-%d.png", mFrame, i); 
     602                        QImage im = toImage(); 
     603                        im.save(filename, "PNG"); 
    509604                } 
    510            
    511         } else { 
    512          
    513           //      glDepthFunc( GL_LEQUAL ); 
    514           glDepthFunc( GL_LEQUAL ); 
    515            
    516           glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 
    517           glDepthMask(GL_FALSE); 
    518            
    519           // now issue queries for all objects 
    520           for (j = 0; j < mObjects.size(); j++) { 
    521                 int q; 
    522                 for (q = 0; j + q < mObjects.size() && q < mOcclusionQueries.size(); q++) { 
    523                   glBeginOcclusionQueryNV(mOcclusionQueries[q]); 
    524                   RenderIntersectable(mObjects[j+q]); 
    525                   glEndOcclusionQueryNV(); 
     605          
     606                if (useOcclusionQueries)  
     607                { 
     608                        EvalQueryWithOcclusionQueries(); 
    526609                } 
    527                  
    528                  
    529                 // collect results of the queries 
    530                 for (q = 0; j + q < mObjects.size() && q < mOcclusionQueries.size(); q++) { 
    531                   unsigned int pixelCount; 
    532                   // reenable other state 
    533  
    534 #if 1 
    535                   do { 
    536                         glGetOcclusionQueryuivNV(mOcclusionQueries[q], 
    537                                                                          GL_PIXEL_COUNT_AVAILABLE_NV, 
    538                                                                          &pixelCount); 
    539                         if (!pixelCount) 
    540                           cout<<"W"; 
    541                   } while(!pixelCount); 
    542 #endif 
    543  
    544                   glGetOcclusionQueryuivNV(mOcclusionQueries[q], 
    545                                                                    GL_PIXEL_COUNT_NV, 
    546                                                                    &pixelCount); 
    547                   //            if (pixelCount) 
    548                   //              cout<<"q="<<mOcclusionQueries[q]<<" pc="<<pixelCount<<" "; 
    549                   mObjects[j+q]->mCounter += pixelCount; 
     610                else  
     611                { 
     612                        EvalQueryWithItemBuffer(); 
    550613                } 
    551                 j += q; 
    552           } 
    553            
    554           glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    555           glDepthMask(GL_TRUE); 
    556         } 
    557            
    558          
    559   }   
    560   // now evaluate the statistics over that sample 
    561   // currently only the number of visible objects is taken into account 
    562   sample.Reset(); 
    563   for (j = 0; j < mObjects.size(); j++) { 
    564         if (mObjects[j]->mCounter) { 
    565           sample.mVisibleObjects++; 
    566           sample.mVisiblePixels += mObjects[j]->mCounter; 
    567         } 
    568   } 
    569   cout<<"RS="<<sample.mVisibleObjects<<" "; 
     614        }   
     615 
     616        // now evaluate the statistics over that sample 
     617        // currently only the number of visible objects is taken into account 
     618        sample.Reset(); 
     619 
     620        for (j = 0; j < mObjects.size(); j++)  
     621        { 
     622                if (mObjects[j]->mCounter)  
     623                { 
     624                        ++ sample.mVisibleObjects; 
     625                        sample.mVisiblePixels += mObjects[j]->mCounter; 
     626                } 
     627        } 
     628 
     629        cout << "RS=" << sample.mVisibleObjects << " "; 
    570630} 
    571631 
     
    575635                                                                   vector<RenderCostSample> &samples 
    576636                                                                   ) 
    577 {cout << "here1" << endl; 
     637{ 
    578638  makeCurrent(); 
    579639 
    580640  if (mPixelBuffer == NULL) 
    581         mPixelBuffer = new unsigned int[GetWidth()*GetHeight()]; 
     641          mPixelBuffer = new unsigned int[GetWidth()*GetHeight()]; 
    582642   
    583643  SetupProjection(GetHeight(), GetHeight(), 90.0f); 
     
    589649  int numQ = 500; 
    590650 
    591   cout << "here2988" << endl; 
    592651 
    593652  if (mOcclusionQueries.size() < numQ)  
     
    605664          mOcclusionQueries.resize(numQ); 
    606665         
    607           for (i=0; i < numQ; ++ i) 
     666          for (i = 0; i < numQ; ++ i) 
    608667          { 
    609668                  mOcclusionQueries[i] = queries[i]; 
     
    613672  } 
    614673   
    615   for (i=0; i < n; ++ i) 
     674  for (i = 0; i < n; ++ i) 
    616675  { 
    617           cout << i << " "; 
    618676          EvalRenderCostSample(samples[i]); 
    619677  } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h

    r991 r997  
    223223  vector<PvsErrorEntry> mPvsErrorBuffer; 
    224224 
     225   
    225226private: 
    226227  unsigned int *mPixelBuffer; 
     
    232233 
    233234                                                                         Intersectable *sourceObject); 
     235 
     236        void EvalQueryWithItemBuffer(); 
     237        void EvalQueryWithOcclusionQueries(); 
    234238 
    235239public: 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r991 r997  
    275275   
    276276  if (mApplyVisibilityFilter || mApplyVisibilitySpatialFilter) { 
    277         cout<<"Applying visibility filter..."; 
    278         cout<<"filyter width = "<<mVisibilityFilterWidth<<endl; 
     277        cout<<"Applying visibility filter ..."; 
     278        cout<<"filyter width = " << mVisibilityFilterWidth << endl; 
    279279         
    280280        mViewCellsManager->ApplyFilter(mKdTree, 
    281281                                                                   mApplyVisibilityFilter ? mVisibilityFilterWidth : -1.0f, 
    282282                                                                   mApplyVisibilitySpatialFilter ? mVisibilityFilterWidth : -1.0f); 
    283         cout<<"done."; 
     283        cout << "done." << endl; 
    284284  } 
    285285   
     
    354354         
    355355        if (mLoadViewCells) 
    356         { 
     356        {        
    357357                environment->GetStringValue("ViewCells.filename", buf); 
    358358                mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, environment, true); 
     
    363363                char viewCellsStr[64]; 
    364364                environment->GetStringValue("ViewCells.type", viewCellsStr); 
     365                 
    365366            mViewCellsManager = CreateViewCellsManager(viewCellsStr); 
    366367        } 
    367368 
     369        //-- parameters for render heuristics evaluation 
    368370        float objRenderCost = 0, vcOverhead = 0, moveSpeed = 0; 
    369371 
     
    377379        mViewCellsManager->SetRenderer(mRenderSimulator); 
    378380 
     381        // default view space is the extent of the scene 
     382        mViewCellsManager->SetViewSpaceBox(mSceneGraph->GetBox()); 
    379383 
    380384        if (mUseGlRenderer || mUseGlDebugger) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RenderSampler.cpp

    r991 r997  
    3030   
    3131        if (renderer) 
    32         {cout << "here18 " << mSamples << endl; 
     32        { 
    3333                renderer->SampleRenderCost(mSamples, samples); 
    3434        } 
     
    3737 
    3838 
    39         //-- Evaluate properties 
     39        //-- Evaluate results 
    4040         
    4141 
     
    4646        vector<int> histogram(intervals); 
    4747   
    48         int i; 
    49  
    50         /// initialise histogram 
    51         for (i = 0; i < intervals; ++ i) 
     48        // initialise histogram 
     49        for (int i = 0; i < intervals; ++ i) 
    5250        { 
    5351                histogram[i] = 0; 
    5452        } 
    5553 
    56          
    57  
    58         for (i = 0; i < mSamples; ++ i)  
     54        // store maximal pvs 
     55        for (int i = 0; i < mSamples; ++ i)  
    5956        { 
    6057                if (samples[i].mVisibleObjects > maxPvs) 
     
    6764 
    6865        // sometimes need need to unifiy maximum pvs to compare with other method's histograms 
    69         // => choose histoMaxPvs accordingly (higher than all pvsss) 
     66        // => choose histoMaxPvs accordingly (higher than all pvss) ( but smaller than highest possible pvs?) 
     67 
    7068        const int maxVal = max(histoMaxVal, maxPvs); 
    71          
    72         for (i = 0; i < mSamples; ++ i)  
     69        //const int maxVal = min(max(histoMaxVal, maxPvs), mObjects.size()); 
     70 
     71        for (int i = 0; i < mSamples; ++ i)  
    7372        { 
    7473                const int bin = (samples[i].mVisibleObjects * intervals) / maxVal; 
     74                //const int bin = samples[i].mVisibleObjects; 
    7575 
    7676                ++ histogram[bin]; 
     
    8585 
    8686 
    87  
    8887        Debug << "****************************************" << endl; 
    8988        Debug << "From point queries: " << endl; 
    9089 
    91         for (i = 0; i < intervals; ++ i)  
     90        for (int i = 0; i < intervals; ++ i)  
    9291        { 
    9392                outstream << "#Pass\n" << i << endl; 
    94                 outstream << "#Pvs\n" << histogram[i] << endl; 
     93                outstream << "#Pvs\n" << (float)(i * maxVal) / (float)intervals << endl; 
     94 
     95                // HACK: #point samples substitute for volume 
     96                outstream << "#VolumeDif\n" << (float)histogram[i] / (float)mSamples << endl; 
    9597                //cout << histogram[i] << endl; 
    9698        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp

    r971 r997  
    16611661        int pvsSize = 0; 
    16621662 
    1663         if (vc->IsLeaf()) 
    1664         { 
    1665                 pvsSize = vc->GetPvs().GetSize(); 
    1666         } 
    1667          
    1668  
    16691663        Intersectable::NewMail(); 
    16701664 
    16711665        ////////////////////////// 
     1666        // for interiors, pvs can be stored using different methods 
     1667 
    16721668        switch (mViewCellsStorage) 
    16731669        { 
    16741670        case PVS_IN_LEAVES: //-- store pvs only in leaves 
    16751671                {                        
     1672                        // pvs is always stored directly in leaves 
     1673                        if (vc->IsLeaf()) 
     1674                        { 
     1675                                pvsSize = vc->GetPvs().GetSize(); 
     1676                                break; 
     1677                        } 
     1678         
     1679                        // the stored pvs size is the valid pvs size => just return scalar 
    16761680                        if (vc->mPvsSizeValid) 
    16771681                        { 
     
    16801684                        } 
    16811685         
    1682                         //-- if no valid pvs size stored as a scalar=> compute new pvs size 
     1686                        //-- if no valid pvs size stored as a scalar => compute new pvs size 
    16831687                        ViewCellContainer leaves; 
    16841688                        CollectLeaves(vc, leaves); 
     
    17111715                { 
    17121716                        //////////////////////// 
    1713         //-- compressed pvs 
     1717                        //-- compressed pvs 
    17141718 
    17151719                        if (vc->mPvsSizeValid) 
     1720                        { 
    17161721                                return vc->mPvsSize; 
    1717  
    1718                         // if no pvs size stored: compute 
    1719         int pvsSize = 0; 
    1720         ViewCell *root = vc; 
    1721          
    1722         // also add pvs from this view cell to root 
    1723         while (root->GetParent()) 
    1724         { 
    1725                 root = root->GetParent(); 
    1726                 pvsSize += CountDiffPvs(root); 
    1727         } 
    1728  
    1729         stack<ViewCell *> tstack; 
    1730         tstack.push(vc); 
    1731  
    1732         while (!tstack.empty()) 
    1733         { 
    1734                 vc = tstack.top(); 
    1735                 tstack.pop(); 
    1736  
    1737                 pvsSize += CountDiffPvs(vc); 
    1738  
    1739                 if (!vc->IsLeaf()) 
    1740                 { 
    1741                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
    1742  
    1743                         ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    1744  
    1745                         for (it = interior->mChildren.begin(); it != it_end; ++ it) 
     1722                        } 
     1723 
     1724                        // if no pvs size stored, compute new one 
     1725                        int pvsSize = 0; 
     1726                        ViewCell *root = vc; 
     1727         
     1728                        // also add pvs from this view cell to root 
     1729                        while (root->GetParent()) 
    17461730                        { 
    1747                                 tstack.push(*it); 
    1748                         }                
    1749                 } 
    1750         } 
     1731                                root = root->GetParent(); 
     1732                                pvsSize += CountDiffPvs(root); 
     1733                        } 
     1734 
     1735                        stack<ViewCell *> tstack; 
     1736                        tstack.push(vc); 
     1737 
     1738                        while (!tstack.empty()) 
     1739                        { 
     1740                                vc = tstack.top(); 
     1741                                tstack.pop(); 
     1742         
     1743                                pvsSize += CountDiffPvs(vc); 
     1744 
     1745                                if (!vc->IsLeaf()) 
     1746                                { 
     1747                                        ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1748 
     1749                                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     1750 
     1751                                        for (it = interior->mChildren.begin(); it != it_end; ++ it) 
     1752                                        { 
     1753                                                tstack.push(*it); 
     1754                                        }                
     1755                                } 
     1756                        } 
    17511757                        break; 
    17521758                } 
    17531759        case PVS_IN_INTERIORS: 
    1754         default:Debug << "in interiors: " << vc->mPvsSize << " $$ " << vc->GetPvs().GetSize() << endl; 
     1760        default: 
     1761                Debug << "in interiors: " << vc->mPvsSize << " $$ " << vc->GetPvs().GetSize() << endl; 
    17551762                pvsSize = vc->GetPvs().GetSize();                
    17561763        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h

    r971 r997  
    193193        static bool SmallerPvs(const ViewCell *a, const ViewCell *b)  
    194194        { 
    195         return a->GetPvs().GetSize() < b->GetPvs().GetSize(); 
    196   } 
    197  
    198  static bool SmallerRenderCost(const ViewCell *a, const ViewCell *b)  
    199  { 
    200          return a->GetRenderCost() < b->GetRenderCost(); 
    201  } 
    202  
    203  static bool LargerRenderCost(const ViewCell *a, const ViewCell *b)  
    204  { 
    205          return a->GetRenderCost() > b->GetRenderCost(); 
    206  } 
     195                // HACK: take scalar value because pvs may not have been stored properly 
     196#if 1 
     197                return a->mPvsSize < b->mPvsSize; 
     198#else 
     199                return a->GetPvs().GetSize() < b->GetPvs().GetSize(); 
     200#endif 
     201        } 
     202 
     203        static bool SmallerRenderCost(const ViewCell *a, const ViewCell *b)  
     204        { 
     205                return a->GetRenderCost() < b->GetRenderCost(); 
     206        } 
     207 
     208        static bool LargerRenderCost(const ViewCell *a, const ViewCell *b)  
     209        { 
     210                return a->GetRenderCost() > b->GetRenderCost(); 
     211        } 
    207212 
    208213        void SetMergeCost(const float mergeCost); 
     214 
    209215        float GetMergeCost() const; 
    210         static void NewMail(const int reserve = 1) { 
     216 
     217        static void NewMail(const int reserve = 1)  
     218        { 
    211219                sMailId += sReservedMailboxes; 
    212220                sReservedMailboxes = reserve; 
    213221        } 
     222 
    214223        void Mail() { mMailbox = sMailId; } 
    215224        bool Mailed() const { return mMailbox == sMailId; } 
     
    309318 
    310319         
    311         /// points to the currently active view cell. 
     320        /** points to the currently active view cell. This is the 
     321                view cell representing the current brach. 
     322        */ 
    312323        ViewCell *mActiveViewCell; 
    313324}; 
     
    349360 
    350361public: 
     362        /** View cells tree constructor taking a view cell mnanager and 
     363                an environment as parameters. 
     364        */ 
    351365        ViewCellsTree(ViewCellsManager *vcm, Environment *env); 
    352366        ~ViewCellsTree(); 
     
    372386         
    373387        /** Assign colors to the viewcells so that they can be renderered interactively without 
    374           color flickering. 
    375           */ 
     388            color flickering.   
     389        */ 
    376390        void AssignRandomColors(); 
    377391 
    378         /** Updates view cell stats for this particular view cell 
     392        /** Updates view cell stats for this particular view cell. 
    379393        */ 
    380394        void UpdateViewCellsStats(ViewCell *vc, ViewCellsStatistics &vcStat); 
    381395 
    382396 
    383         /** Get costs resulting from each merge step. */ 
     397        /** Get costs resulting from each merge step.  
     398        */ 
    384399        void GetCostFunction(vector<float> &costFunction); 
    385400 
     
    465480 
    466481 
    467         ////////////////////////////////////////////////////////////// 
    468         //                 merge related stuff                      // 
    469         ////////////////////////////////////////////////////////////// 
     482        ///////////////////////////////////////////////////////////////// 
     483        //                    merge related stuff                      // 
     484        ///////////////////////////////////////////////////////////////// 
    470485 
    471486        /** Computes render cost of the merged pvs. 
     
    525540                                                           const int numNewViewCells); 
    526541 
    527         /** merge queue must be reset after some time because expected value 
     542        /** Merge queue must be reset after some time because expected value 
    528543                may not be valid. 
    529544        */ 
     
    535550        int UpdateActiveViewCells(ViewCellContainer &viewCells); 
    536551 
     552        /** Helper function pullling pvs as high up in the tree as possible. 
     553        */  
    537554        void PullUpVisibility(ViewCellInterior *interior); 
    538555 
     556        /** Compress pvs of view cell and children. 
     557        */ 
    539558        void CompressViewCellsPvs(ViewCell *root); 
    540559 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r991 r997  
    568568        Debug << "histogram min rc: " << minRenderCost << " max rc: " << maxRenderCost << endl; 
    569569 
    570  
    571         const int intervals = min(20, (int)viewCells.size()); 
    572  
     570    int histoIntervals; 
     571        mEnvironment->GetIntValue("Preprocessor.histogram.intervals", histoIntervals); 
     572        const int intervals = min(histoIntervals, (int)viewCells.size()); 
     573 
     574        int histoMaxVal; 
     575        mEnvironment->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal); 
     576        maxRenderCost = max(histoMaxVal, maxRenderCost); 
     577 
     578         
    573579        const float range = maxRenderCost - minRenderCost; 
    574580        const float stepSize = range / (float)intervals; 
     
    580586        //const float totalVol = mViewCellsTree->GetRoot()->GetVolume(); 
    581587 
    582         //float vol = 0; 
    583         //int smallerCost = 0; 
    584588        int j = 0; 
    585589        int i = 0; 
     
    677681                                                                                         const ObjectContainer &objects) 
    678682{ 
     683        if (!ViewCellsConstructed()) 
     684                return false; 
     685 
    679686        cout << "exporting view cells to xml ... "; 
    680687         
    681688#if ZIPPED_VIEWCELLS 
    682689        ogzstream stream(filename.c_str()); 
    683         cout << "!!!!!!!!!!!!!!!!!!!!!!" << endl; 
    684690#else 
    685691        std::ofstream stream(filename.c_str()); 
     
    755761        mViewCellsTree->CollectBestViewCellSet(viewCells, nViewCells); 
    756762 
    757         int maxPvsSize, minPvsSize; 
    758  
    759         // sort by render cost 
     763        int maxPvs, maxVal, minVal; 
     764 
     765        // sort by pvs size 
    760766        sort(viewCells.begin(), viewCells.end(), ViewCell::SmallerPvs); 
    761767 
    762         minPvsSize = viewCells.front()->GetPvs().GetSize(); 
    763         maxPvsSize = viewCells.back()->GetPvs().GetSize(); 
    764         minPvsSize = 0; 
     768        //Debug << "********************" << endl; 
     769        //for (int i = 0; i < viewCells.size(); ++ i) 
     770        //      Debug << "pvs: " << mViewCellsTree->GetPvsSize(viewCells[i]) << " "; 
     771        //Debug << "\n"; 
     772        maxPvs = mViewCellsTree->GetPvsSize(viewCells.back()); 
     773        minVal = 0; 
     774 
    765775        // hack: normalize pvs size 
    766         maxPvsSize = 1200; 
    767         minPvsSize = 0; 
    768         maxPvsSize = 1200; 
    769  
    770         Debug << "histogram minpvssize: " << minPvsSize << " maxpvssize: " << maxPvsSize << endl; 
    771  
    772  
    773         const int intervals = min(20, (int)viewCells.size()); 
    774         const int range = maxPvsSize - minPvsSize; 
     776        int histoMaxVal; 
     777        mEnvironment->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal); 
     778        maxVal = max(histoMaxVal, maxPvs); 
     779                 
     780        Debug << "histogram minpvssize: " << minVal << " maxpvssize: " << maxVal << " real maxpvs " << maxPvs << endl; 
     781 
     782        int histoIntervals; 
     783        mEnvironment->GetIntValue("Preprocessor.histogram.intervals", histoIntervals); 
     784        const int intervals = min(histoIntervals, (int)viewCells.size()); 
     785 
     786        const int range = maxVal - minVal; 
    775787        int stepSize = range / intervals; 
    776788 
    777          
     789        // set step size to avoid endless loop 
    778790        if (!stepSize) stepSize = 1; 
    779791         
    780792        Debug << "stepsize: " << stepSize << endl; 
    781         cout << "stepsize: " << stepSize << endl; 
     793         
    782794 
    783795        const float totalRenderCost = mViewCellsTree->GetRoot()->GetRenderCost(); 
    784796        const float totalVol = GetViewSpaceBox().GetVolume(); 
    785797 
    786         int currentPvsSize = minPvsSize;//(int)ceil(minRenderCost); 
    787  
    788         //float vol = 0; 
     798        int currentPvs = minVal;//(int)ceil(minRenderCost); 
     799 
     800         
    789801        int i = 0; 
    790802        int j = 0; 
     
    795807        ViewCellContainer::const_iterator it = viewCells.begin(), it_end = viewCells.end();              
    796808         
    797         while (1) 
     809        for (int j = 0; j < intervals; ++ j) 
    798810        { 
    799811                float volDif = 0; 
    800812                int smallerDif = 0; 
    801813 
    802                 while ((i < (int)viewCells.size()) && (viewCells[i]->GetPvs().GetSize() < currentPvsSize)) 
     814                while ((i < (int)viewCells.size()) &&  
     815                           (mViewCellsTree->GetPvsSize(viewCells[i]) < currentPvs)) 
    803816                { 
    804817                        volDif += viewCells[i]->GetVolume(); 
    805818                        volSum += viewCells[i]->GetVolume(); 
     819 
    806820                        ++ i; 
    807821                        ++ smallerDif; 
     
    809823                } 
    810824                 
    811                 //if (i < (int)viewCells.size()) 
    812                 //      Debug << "new pvs size increase: " << viewCells[i]->GetPvs().GetSize() << " " << currentPvsSize << endl; 
    813  
    814                 if ((i >= (int)viewCells.size()) || (currentPvsSize >= maxPvsSize)) 
    815                         break; 
    816  
     825                if (0 && (i < (int)viewCells.size())) 
     826                        Debug << "new pvs size increase: " << mViewCellsTree->GetPvsSize(viewCells[i]) << " " << currentPvs << endl; 
     827         
    817828                const float volRatioDif = volDif / totalVol; 
    818829                const float volRatioSum = volSum / totalVol; 
    819830 
    820                 outstream << "#Pass\n" << j ++ << endl; 
    821                 outstream << "#Pvs\n" << currentPvsSize << endl; 
     831                outstream << "#Pass\n" << j << endl; 
     832                outstream << "#Pvs\n" << currentPvs << endl; 
    822833                outstream << "#ViewCellsDif\n" << smallerDif << endl; 
    823834                outstream << "#ViewCellsSum\n" << smallerSum << endl;    
    824835                outstream << "#VolumeDif\n" << volRatioDif << endl << endl; 
    825836                outstream << "#VolumeSum\n" << volRatioSum << endl << endl; 
    826  
    827                 // increase current pvs size 
    828                 currentPvsSize += stepSize; 
     837         
     838                //if ((i >= (int)viewCells.size()) || (currentPvs >= maxPvs))   break; 
     839 
     840                //-- increase current pvs size to define next interval 
     841                currentPvs += stepSize; 
    829842        } 
    830843 
     
    856869 
    857870 
    858 /*ViewCellContainer leaves; 
    859 mViewCellsTree->CollectLeaves(mViewCellsTree->GetRoot(), leaves); 
    860 */       
    861871        cout << "reseting pvs ... "; 
    862872                 
     
    922932        } 
    923933         
     934 
     935        //-- histogram 
     936 
     937 
    924938        bool useHisto; 
    925         int histoPasses; 
     939        int histoStepSize; 
    926940 
    927941        mEnvironment->GetBoolValue("ViewCells.Evaluation.histogram", useHisto); 
    928         mEnvironment->GetIntValue("ViewCells.Evaluation.histoPasses", histoPasses); 
    929  
     942        mEnvironment->GetIntValue("ViewCells.Evaluation.histoStepSize", histoStepSize); 
     943 
     944        Debug << "here21 " << histoStepSize << endl; 
    930945        const int numLeaves = mViewCellsTree->GetNumInitialViewCells(mViewCellsTree->GetRoot()); 
    931946 
    932         //Debug << "number of leaves: " << numLeaves << endl; 
    933         //cout << "number of leaves: " << numLeaves << endl; 
    934947 
    935948        if (useHisto) 
     
    937950                // evaluate view cells in a histogram            
    938951                char s[64]; 
     952 
     953                for (int pass = histoStepSize; pass <= numLeaves; pass += histoStepSize) 
     954                { 
     955                        string filename; 
     956 
     957                        cout << "computing histogram for " << pass << " view cells" << endl; 
    939958#if 0 
    940                 for (int passes = 1; passes <= histoPasses; ++ passes) 
    941                 { 
    942                         int n = numLeaves * passes / histoPasses; 
    943                  
    944                         cout << "computing histogram for " << n << " view cells" << endl; 
    945  
    946                         //-- evaluate histogram for render cost 
    947                         sprintf(s, "-%09d-histo.log", n); 
    948                         string filename = string(statsPrefix) + string(s); 
    949  
    950                         EvalViewCellHistogram(filename, n); 
    951  
    952                         ////////////////////////////////////////// 
    953             // --evaluate histogram for pvs size 
    954  
    955                         cout << "computing pvs histogram for " << n << " view cells" << endl; 
    956  
    957                         sprintf(s, "-%09d-histo-pvs.log", n); 
    958                         filename = string(statsPrefix) + string(s); 
    959  
    960                         EvalViewCellHistogramForPvsSize(filename, n); 
    961                 } 
    962 #else 
    963                 for (int pass = histoPasses; pass <= numLeaves; pass += histoPasses) 
    964                 { 
    965                         cout << "computing histogram for " << pass << " view cells" << endl; 
    966  
    967959                        //-- evaluate histogram for render cost 
    968960                        sprintf(s, "-%09d-histo.log", pass); 
    969                         string filename = string(statsPrefix) + string(s); 
     961                        filename = string(statsPrefix) + string(s); 
    970962 
    971963                        EvalViewCellHistogram(filename, pass); 
    972964 
     965#endif 
    973966                        ////////////////////////////////////////// 
    974967            //-- evaluate histogram for pvs size 
     
    981974                        EvalViewCellHistogramForPvsSize(filename, pass); 
    982975                } 
    983 #endif 
    984976        } 
    985977 
     
    12501242                                                                                ) 
    12511243{ 
    1252   sort(mViewCells.begin(), mViewCells.end(), ViewCell::SmallerPvs); 
    1253  
    1254   int start = mViewCells.size()*minValid; 
    1255   int end = mViewCells.size()*maxValid; 
    1256  
    1257   for (int i=0; i < mViewCells.size(); i++) 
    1258   { 
    1259           mViewCells[i]->SetValid(i >= start && i <= end); 
    1260    
    1261   } 
     1244        sort(mViewCells.begin(), mViewCells.end(), ViewCell::SmallerPvs); 
     1245 
     1246        int start = mViewCells.size()*minValid; 
     1247        int end = mViewCells.size()*maxValid; 
     1248 
     1249        for (int i = 0; i < mViewCells.size(); ++ i) 
     1250        { 
     1251                mViewCells[i]->SetValid(i >= start && i <= end); 
     1252        } 
    12621253} 
    12631254 
     
    12931284{ 
    12941285        viewPoint = mViewSpaceBox.GetRandomPoint(); 
    1295  
    12961286        return true; 
    12971287} 
     
    25372527        Debug << "\nOutput view cells: " << endl; 
    25382528 
    2539         // sort view cells to get largest view cells 
     2529        // sort view cells in order to find the largest view cells 
    25402530        if (0) 
    25412531                stable_sort(mViewCells.begin(), mViewCells.end(), ViewCell::SmallerPvs); 
     
    42894279                } 
    42904280        } 
     4281 
    42914282        Debug << "failed to find valid view point, taking " << viewPoint << endl; 
    42924283        return false; 
     
    47094700        int numSamples; 
    47104701 
    4711         environment->GetIntValue("RenderSampler.samples", numSamples); 
     4702        mEnvironment->GetIntValue("RenderSampler.samples", numSamples); 
    47124703        cout << "samples" << numSamples << endl; 
    47134704 
     
    50225013  //                                      center + Vector3(viewSpaceFilterSize/2)); 
    50235014 
     5015        if (!ViewCellsConstructed()) 
     5016                return; 
     5017 
    50245018  if (viewSpaceFilterSize >=0.0f) { 
    50255019 
     
    50675061                                                          ) 
    50685062{ 
     5063 
     5064        if (!ViewCellsConstructed()) 
     5065                return; 
    50695066 
    50705067  ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r991 r997  
    2828int 
    2929main(int argc, char **argv) 
    30 {QApplication *app = new QApplication(argc, argv); 
     30{ 
    3131 
    32         cout << "here222237" << endl; 
    33 //Now just call this function at the start of your program and if you're 
    34 //compiling in debug mode (F5), any leaks will be displayed in the Output 
    35 //window when the program shuts down. If you're not in debug mode this will 
    36 //be ignored. Use it as you will! 
    37 //note: from GDNet Direct [3.8.04 - 3.14.04] void detectMemoryLeaks() { 
     32        //Now just call this function at the start of your program and if you're 
     33        //compiling in debug mode (F5), any leaks will be displayed in the Output 
     34        //window when the program shuts down. If you're not in debug mode this will 
     35        //be ignored. Use it as you will! 
     36        //note: from GDNet Direct [3.8.04 - 3.14.04] void detectMemoryLeaks() { 
    3837    _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF); 
    3938    _CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE); 
    4039    _CrtSetReportFile(_CRT_ASSERT,_CRTDBG_FILE_STDERR);  
    41 cout << "here3" << endl; 
    42   Debug.open("debug.log");cout << "here2" << endl; 
     40 
     41  Debug.open("debug.log"); 
    4342  environment = new Environment; 
    44   cout << "here122223" << endl; cout.flush(); 
     43  
    4544  environment->Parse(argc, argv, USE_EXE_PATH); 
    4645  MeshKdTree::ParseEnvironment(); 
    47 cout << "here222283" << endl; 
     46 
    4847  char buff[128]; 
    4948  environment->GetStringValue("Preprocessor.type", buff); 
     
    5150         
    5251  Preprocessor *p; 
    53 cout << "here22223" << endl; 
     52 
    5453  if (preprocessorType == "vss") 
    55   {cout << "here223" << endl; 
    56         p = new VssPreprocessor(); 
     54  { 
     55          p = new VssPreprocessor(); 
    5756  } 
    5857  else 
     
    6867                  if (preprocessorType == "render") 
    6968                  { 
    70                           cout << "here23" << endl; 
    71                         p = new RenderSampler(); 
     69                          p = new RenderSampler(); 
    7270                  } 
    7371                  else { 
     
    7876   
    7977  
    80   //QApplication *app = NULL; 
     78  QApplication *app = NULL; 
    8179 
    8280  if (p->mUseGlRenderer || p->mUseGlDebugger) { 
    83           cout << "here1111" << endl; 
     81         
    8482        // create a qt application first (must be created before any opengl widget... 
    85         //app = new QApplication(argc, argv); 
    86           cout << "here1112" << endl; 
     83        app = new QApplication(argc, argv); 
     84         
    8785        if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) { 
    88                 cout << "here1133" << endl;cout.flush(); 
    8986          QMessageBox::information(0, "OpenGL pbuffers",  
    9087                                                           "This system does not support OpenGL/pbuffers.", 
     
    9289          return -1; 
    9390        } 
    94           cout << "here1119" << endl; 
    9591  } 
    96    cout << "here1123" << endl; 
     92   
    9793  preprocessor = p; 
    9894   
     
    10399  p->BuildKdTree(); 
    104100  p->KdTreeStatistics(cout); 
    105    cout << "here1199" << endl; 
     101  
    106102  // parse view cells related options 
    107103  p->PrepareViewCells(); 
    108104   
    109  cout << "here1117" << endl; 
     105 
    110106  // create a preprocessor thread 
    111107  PreprocessorThread *pt = new PreprocessorThread(p, app); 
     
    116112    p->Export(filename + "-kdtree.x3d", false, true, false);     
    117113  } 
    118  cout << "here1118" << endl; 
     114 
    119115  if (p->mUseGlRenderer) { 
    120           cout << "here1114" << endl; 
     116          
    121117        rendererWidget = new GlRendererWidget(p->mSceneGraph, p->mViewCellsManager, p->mKdTree); 
    122118        //  renderer->resize(640, 480); 
    123          cout << "here1115" << endl; 
     119          
    124120        rendererWidget->resize(640, 480); 
    125121        rendererWidget->show(); 
    126           cout << "here1113" << endl; 
     122         
    127123        if (p->GetRenderer()) { 
    128124           
Note: See TracChangeset for help on using the changeset viewer.