Changeset 871


Ignore:
Timestamp:
05/02/06 11:14:52 (18 years ago)
Author:
bittner
Message:

RenderSampler?

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

Legend:

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

    r863 r871  
    16731673                                   "true"); 
    16741674 
     1675        RegisterOption("Preprocessor.exportVisibility", 
     1676                                   optBool, 
     1677                                   "preprocessor_export_visibility", 
     1678                                   "true"); 
     1679 
     1680        RegisterOption("Preprocessor.visibilityFile", 
     1681                                   optString, 
     1682                                   "preprocessor_visibility_file=", 
     1683                                   "visibility.xml"); 
     1684 
     1685        RegisterOption("Preprocessor.applyVisibilityFilter", 
     1686                                   optBool, 
     1687                                   "preprocessor_apply_filter", 
     1688                                   "true"); 
     1689 
     1690 
    16751691 
    16761692        /**************************************************************************************/ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r863 r871  
    841841  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    842842   
    843   ViewCell *viewcell; 
     843  ViewCell *viewcell = NULL; 
    844844 
    845845  PrVs prvs; 
    846846   
    847   if (!useFilter) 
     847  if (!useFilter) { 
    848848        viewcell = mViewCellsManager->GetViewCell(mViewPoint); 
    849   else { 
     849  } else { 
    850850        //  mViewCellsManager->SetMaxFilterSize(1); 
    851851        mViewCellsManager->GetPrVS(mViewPoint, prvs); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r859 r871  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: út 25. IV 12:50:38 2006 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: út 2. V 11:07:44 2006 
    44# Project:  preprocessor.pro 
    55# Template: app 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r870 r871  
    127127        environment->GetBoolValue("Preprocessor.computeVisibility", mComputeVisibility); 
    128128        environment->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace); 
    129  
     129        environment->GetBoolValue("Preprocessor.exportVisibility", mExportVisibility ); 
     130 
     131        char buffer[256]; 
     132        environment->GetStringValue("Preprocessor.visibilityFile",  buffer); 
     133        mVisibilityFileName = buffer; 
     134        environment->GetBoolValue("Preprocessor.visibilityFile", mApplyVisibilityFilter ); 
     135         
    130136        Debug << "detect empty view space=" << mDetectEmptyViewSpace << endl; 
    131137        Debug << "load polygons as meshes: " << mLoadPolygonsAsMeshes << endl; 
     
    255261Preprocessor::ExportPreprocessedData(const string filename) 
    256262{ 
    257   return false; 
    258 } 
     263   
     264  mViewCellsManager->ExportViewCells(filename, 
     265                                                                         true); 
     266   
     267  return true; 
     268} 
     269 
     270bool 
     271Preprocessor::PostProcessVisibility() 
     272{ 
     273   
     274  if (mApplyVisibilityFilter) { 
     275        cout<<"Applying visibility filter..."; 
     276        mViewCellsManager->ApplyFilter(mKdTree, 
     277                                                                   0.05f, 
     278                                                                   0.05f); 
     279        cout<<"done."; 
     280  } 
     281   
     282  // export the preprocessed information to a file 
     283  if (mExportVisibility) 
     284        ExportPreprocessedData(mVisibilityFileName); 
     285   
     286  return true; 
     287} 
     288 
    259289 
    260290bool 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r860 r871  
    6969    */ 
    7070  virtual bool ComputeVisibility() = 0; 
    71    
     71 
     72  /** Post Process the computed visibility. By default applys the visibility filter 
     73          (if specified in the environment and export the preprocessed data */ 
     74  virtual bool PostProcessVisibility(); 
     75 
    7276  /** View cells are either loaded or prepared for generation, according to the chosen environment 
    7377      object. Important evironment options are, e.g, the view cell type. 
     
    163167  bool mComputeVisibility; 
    164168 
     169  bool mExportVisibility; 
     170  string mVisibilityFileName; 
     171   
     172  bool mApplyVisibilityFilter; 
     173   
    165174  GlRendererBuffer *GetRenderer() { return renderer;} 
    166175   
  • GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.cpp

    r863 r871  
    2626    mPreprocessor->ComputeVisibility(); 
    2727        //      mPreprocessor->ExportPreprocessedData("scene.vis"); 
     28        mPreprocessor->PostProcessVisibility(); 
    2829  } 
    2930   
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp

    r863 r871  
    512512        SimpleRayContainer rays; 
    513513 
    514         cout<<"Generating initial rays..."<<endl; 
     514        cout<<"Generating initial rays..."<<endl<<flush; 
     515 
    515516        GenerateRays(mInitialSamples/4, SPATIAL_BOX_BASED_DISTRIBUTION, rays); 
    516517        GenerateRays(mInitialSamples/4, OBJECT_BASED_DISTRIBUTION, rays); 
     
    518519        GenerateRays(mInitialSamples/4, OBJECT_DIRECTION_BASED_DISTRIBUTION, rays); 
    519520         
    520         cout<<"Casting initial rays..."<<endl; 
     521        cout<<"Casting initial rays..."<<endl<<flush; 
    521522        CastRays(rays, mVssRays); 
    522523 
     
    546547  if (mUseViewcells) { 
    547548 
    548         cout<<"Computing sample contributions..."<<endl; 
     549        cout<<"Computing sample contributions..."<<endl<<flush; 
    549550        // evaluate contributions of the intitial rays 
    550551        mViewCellsManager->ComputeSampleContributions(mVssRays, true, false); 
    551         cout<<"done.\n"; 
     552        cout<<"done.\n"<<flush; 
    552553         
    553554        mStats << 
     
    802803 
    803804 
    804   cout<<"Applying visibility filter..."; 
    805   mViewCellsManager->ApplyFilter(mKdTree, 
    806                                                                  0.05f, 
    807                                                                  0.05f); 
    808   cout<<"done."; 
     805  //  mViewCellsManager->ExportViewCells("visibility.xml", 
     806  //                                                                     true); 
     807   
    809808   
    810809  return true; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r870 r871  
    18561856 
    18571857 
    1858 bool ViewCellsManager::ExportViewCells(const string filename) 
     1858bool ViewCellsManager::ExportViewCells(const string filename, const bool exportPvs) 
    18591859{ 
    18601860        return false; 
     
    22722272                char filename[100]; 
    22732273                environment->GetStringValue("ViewCells.filename", filename); 
    2274                 ExportViewCells(filename); 
     2274                ExportViewCells(filename, mExportPvs); 
    22752275        } 
    22762276         
     
    27192719 
    27202720 
    2721 bool BspViewCellsManager::ExportViewCells(const string filename) 
     2721bool BspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs) 
    27222722{ 
    27232723        cout << "exporting view cells to xml ... "; 
     
    27452745        stream << "<ViewCells>" << endl; 
    27462746 
    2747         mViewCellsTree->Export(stream, mExportPvs); 
     2747        mViewCellsTree->Export(stream, exportPvs); 
    27482748 
    27492749        stream << "</ViewCells>" << endl; 
     
    39643964                char filename[100]; 
    39653965                environment->GetStringValue("ViewCells.filename", filename); 
    3966                 ExportViewCells(filename); 
     3966                ExportViewCells(filename, mExportPvs); 
    39673967        } 
    39683968 
     
    47104710 
    47114711 
    4712 bool VspBspViewCellsManager::ExportViewCells(const string filename) 
     4712bool VspBspViewCellsManager::ExportViewCells(const string filename, const bool exportPvs) 
    47134713{ 
    47144714        cout << "exporting view cells to xml ... "; 
     
    47354735        stream << "<ViewCells>" << endl; 
    47364736         
    4737         mViewCellsTree->Export(stream, mExportPvs); 
     4737        mViewCellsTree->Export(stream, exportPvs); 
    47384738 
    47394739        stream << "</ViewCells>" << endl; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r870 r871  
    307307        /** Writes view cells to disc. 
    308308        */ 
    309         virtual bool ExportViewCells(const string filename); 
     309        virtual bool ExportViewCells(const string filename, const bool exportPvs); 
    310310 
    311311        /** Casts beam to collect view cells. 
     
    435435        bool LoadBoundingBoxes(const string filename, IndexedBoundingBoxContainer &boxes) const; 
    436436 
     437  bool GetExportPvs() const { 
     438        return mExportPvs; 
     439  } 
    437440 
    438441        /** Loads view cells from file. The view cells manager is created with  
     
    678681        void Finalize(ViewCell *viewCell, const bool createMesh); 
    679682 
    680         bool ExportViewCells(const string filename); 
     683        bool ExportViewCells(const string filename, const bool exportPvs); 
    681684 
    682685        /** Constructs merge hierarchy which corresponds to the spatial hierarchy. 
     
    886889        void CreateMesh(ViewCell *vc); 
    887890 
    888         bool ExportViewCells(const string filename); 
     891        bool ExportViewCells(const string filename, const bool exportPvs); 
    889892 
    890893        int CastBeam(Beam &beam); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp

    r863 r871  
    627627          VssRayContainer dummies; 
    628628          mViewCellsManager->Visualize(mObjects, dummies); 
    629           mViewCellsManager->ExportViewCells("test.xml"); 
     629          mViewCellsManager->ExportViewCells("test.xml", mViewCellsManager->GetExportPvs()); 
    630630  } 
    631631 
  • GTP/trunk/Lib/Vis/Preprocessing/src/default.env

    r859 r871  
    99#       filename vienna.x3d 
    1010# filename ../data/vienna/vienna-simple.x3d 
    11 #filename ../data/vienna/vienna-buildings.x3d 
     11filename ../data/vienna/vienna-buildings.x3d 
    1212#filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-plane.x3d;../data/vienna/vienna-roads.x3d 
    1313# filename ../data/vienna/viewcells-25-sel.x3d 
    14 filename ../data/atlanta/atlanta2.x3d 
     14#filename ../data/atlanta/atlanta2.x3d 
    1515#filename ../data/soda/soda.dat 
    1616#filename ../data/soda/soda5.dat 
     
    8989 
    9090RssPreprocessor { 
    91         samplesPerPass 1000000 
     91        samplesPerPass 500000 
    9292        initialSamples 1000000 
    93         vssSamples 1000000 
     93        vssSamples 2000000 
    9494        vssSamplesPerPass 1000000 
    9595        useImportanceSampling false 
     
    274274#       filename ../scripts/viewcells_atlanta.xml 
    275275#       filename ../data/soda/soda5-viewcells2.xml 
    276         filename ../data/atlanta/viewcells_atlanta3.xml 
    277 #       filename ../data/vienna/viewcells_vienna.xml 
     276#       filename ../data/atlanta/viewcells_atlanta3.xml 
     277        filename ../data/vienna/viewcells_vienna.xml 
    278278#       filename ../data/PowerPlant/power_plant_viewcells_all3.xml 
    279279} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r863 r871  
    6363                else 
    6464                  if (preprocessorType == "render") 
    65 ;//                     p = new RenderSampler(); 
     65                        p = new RenderSampler(); 
    6666                  else { 
    6767                        cerr<<"Unknown preprocessor type"<<endl; 
Note: See TracChangeset for help on using the changeset viewer.