Ignore:
Timestamp:
07/26/06 09:22:09 (18 years ago)
Author:
mattausch
Message:

added support for kd pvs sampling

File:
1 edited

Legend:

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

    r1151 r1155  
    5454mMaxPvsRatio(1.0), 
    5555mViewCellPvsIsUpdated(false), 
    56 mPreprocessor(NULL) 
     56mPreprocessor(NULL), 
     57mStoreKdPvs(false) 
    5758{ 
    5859        mViewSpaceBox.Initialize(); 
     
    13611362float 
    13621363ViewCellsManager::ComputeSampleContributions(const VssRayContainer &rays, 
    1363                                                                                          const bool addRays, 
     1364                                                                                         const bool addRays,                                                                     
    13641365                                                                                         const bool storeViewCells 
    13651366                                                                                         ) 
     
    13721373 
    13731374  float sum = 0.0f; 
     1375 
    13741376  for (it = rays.begin(); it != it_end; ++ it)  
    13751377  { 
    13761378          sum += ComputeSampleContributions(*(*it), addRays, storeViewCells); 
    1377           //ComputeSampleContributions(*(*it), addRays); 
    1378           //    sum += (*it)->mPvsContribution; 
    13791379  } 
    13801380 
     
    18671867        CastLineSegment(origin, termination, viewcells); 
    18681868 
    1869         //const bool storeViewcells = !addRays; 
    1870 //return 0; 
    18711869        if (storeViewCells) 
    1872         { 
    1873                 // copy viewcells memory efficiently 
     1870        {       // copy viewcells memory efficiently 
    18741871                ray.mViewCells.reserve(viewcells.size()); 
    18751872                ray.mViewCells = viewcells; 
     
    19091906        } 
    19101907 
    1911          
     1908        // if addrays is true, sampled entities are stored in the pvs 
    19121909        if (addRays) 
    19131910        { 
     
    19191916                        { 
    19201917                                // if ray not outside of view space 
    1921                                  if (ray.mTerminationObject) 
    1922                                          viewcell->GetPvs().AddSample(ray.mTerminationObject, ray.mPdf); 
    1923  
     1918 
     1919                                // add kd cell 
     1920                                if (ray.mTerminationObject) 
     1921                                { 
     1922                                        if (!mStoreKdPvs) 
     1923                                        { 
     1924                                                viewcell->GetPvs().AddSample(ray.mTerminationObject, ray.mPdf); 
     1925                                        } 
     1926                                        else 
     1927                                        { 
     1928                                                // todo 
     1929                                                //viewcell->GetPvs().AddSample(ray.mTerminationNode, ray.mPdf); 
     1930                                        } 
     1931                                } 
     1932                                 
    19241933#if 0 
    19251934                                 if (ray.mOriginObject) 
     
    24462455 
    24472456 
     2457void ViewCellsManager::SetStoreKdPvs(const bool storeKdPvs) 
     2458{ 
     2459        mStoreKdPvs = storeKdPvs; 
     2460} 
     2461 
     2462 
     2463bool ViewCellsManager::GetStoreKdPVs() const 
     2464{ 
     2465        return mStoreKdPvs; 
     2466} 
     2467 
    24482468 
    24492469/*******************************************************************/ 
Note: See TracChangeset for help on using the changeset viewer.