Changeset 2015


Ignore:
Timestamp:
01/22/07 20:25:06 (17 years ago)
Author:
bittner
Message:

pvs efficiency tuning

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
10 added
15 edited

Legend:

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

    r2012 r2015  
    1414#include "RayCaster.h" 
    1515 
     16#include "PerfTimer.h" 
     17 
    1618 
    1719namespace GtpVisibilityPreprocessor { 
     20 
     21  extern PerfTimer viewCellCastTimer; 
     22  extern PerfTimer pvsTimer; 
     23  extern PerfTimer objTimer; 
    1824 
    1925const bool pruneInvalidRays = true; 
     
    8894        mMixtureDistribution->ComputeContributions(vssRays); 
    8995 
     96        cout<<"view cell cast time:"<<viewCellCastTimer.TotalTime()<<" s"<<endl; 
     97        cout<<"pvs time:"<<pvsTimer.TotalTime()<<" s"<<endl; 
     98        cout<<"obj time:"<<objTimer.TotalTime()<<" s"<<endl; 
     99 
    90100        if (mExportRays) { 
    91101          Debug<<"Exporting rays..."<<endl<<flush; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp

    r2014 r2015  
    744744{ 
    745745        int hits = 0; 
    746  
    747746        float mint = 0.0f, maxt = 1.0f; 
    748747        const Vector3 dir = termination - origin; 
     
    765764        while (1) 
    766765        { 
    767                 if (!node->IsLeaf()) 
     766          if (!node->IsLeaf()) { 
     767                KdInterior *in = (KdInterior *)node; 
     768                position = in->mPosition; 
     769                axis = in->mAxis; 
     770                 
     771                if (entp[axis] <= position) 
     772                  { 
     773                        if (extp[axis] <= position) 
     774                          { 
     775                                node = in->mBack; 
     776                                // cases N1,N2,N3,P5,Z2,Z3 
     777                                continue; 
     778                          }  
     779                        else 
     780                          { 
     781                                // case N4 
     782                                node = in->mBack; 
     783                                farChild = in->mFront; 
     784                          } 
     785                  } 
     786                else 
     787                  { 
     788                        if (position <= extp[axis]) 
     789                          { 
     790                                node = in->mFront; 
     791                                // cases P1,P2,P3,N5,Z1 
     792                                continue; 
     793                          } 
     794                        else 
     795                          { 
     796                                node = in->mFront; 
     797                                farChild = in->mBack; 
     798                                // case P4 
     799                          } 
     800                  } 
     801                 
     802                // $$ modification 3.5.2004 - hints from Kamil Ghais 
     803                // case N4 or P4 
     804                float tdist = (position - origin[axis]) / dir[axis]; 
     805                //tStack.push(RayTraversalData(farChild, extp, maxt)); //TODO 
     806                extp = origin + dir * tdist; 
     807                maxt = tdist; 
     808          } 
     809          else 
    768810                { 
    769                         KdInterior *in = (KdInterior *)node; 
    770                         position = in->mPosition; 
    771                         axis = in->mAxis; 
    772  
    773                         if (entp[axis] <= position) 
    774                         { 
    775                                 if (extp[axis] <= position) 
    776                                 { 
    777                                         node = in->mBack; 
    778                                         // cases N1,N2,N3,P5,Z2,Z3 
    779                                         continue; 
    780                                 }  
    781                                 else 
    782                                 { 
    783                                         // case N4 
    784                                         node = in->mBack; 
    785                                         farChild = in->mFront; 
    786                                 } 
    787                         } 
    788                         else 
    789                         { 
    790                                 if (position <= extp[axis]) 
    791                                 { 
    792                                         node = in->mFront; 
    793                                         // cases P1,P2,P3,N5,Z1 
    794                                         continue; 
    795                                 } 
    796                                 else 
    797                                 { 
    798                                         node = in->mFront; 
    799                                         farChild = in->mBack; 
    800                                         // case P4 
    801                                 } 
    802                         } 
    803  
    804                         // $$ modification 3.5.2004 - hints from Kamil Ghais 
    805                         // case N4 or P4 
    806                         float tdist = (position - origin[axis]) / dir[axis]; 
    807                         //tStack.push(RayTraversalData(farChild, extp, maxt)); //TODO 
    808                         extp = origin + dir * tdist; 
    809                         maxt = tdist; 
    810                 } 
    811                 else 
    812                 { 
    813                         // compute intersection with all objects in this leaf 
     811                  // compute intersection with all objects in this leaf 
    814812                  KdLeaf *leaf = (KdLeaf *)node; 
    815  
    816                         // add view cell to intersections 
    817                         ViewCell *vc = leaf->mViewCell; 
    818  
    819                         if (!vc->Mailed()) 
    820                         { 
    821                                 vc->Mail(); 
    822                                 viewcells.push_back(vc); 
    823                                 ++ hits; 
    824                         } 
    825  
    826                         // get the next node from the stack 
    827                         if (tStack.empty()) 
    828                                 break; 
    829  
    830                         entp = extp; 
    831                         mint = maxt; 
    832                          
    833                         RayTraversalData &s  = tStack.top(); 
    834                         node = s.mNode; 
    835                         extp = s.mExitPoint; 
    836                         maxt = s.mMaxT; 
    837                         tStack.pop(); 
     813                   
     814                  // add view cell to intersections 
     815                  ViewCell *vc = leaf->mViewCell; 
     816                   
     817                  if (!vc->Mailed()) { 
     818                        vc->Mail(); 
     819                        viewcells.push_back(vc); 
     820                        ++ hits; 
     821                  } 
     822                   
     823                  // get the next node from the stack 
     824                  if (tStack.empty()) 
     825                        break; 
     826                   
     827                  entp = extp; 
     828                  mint = maxt; 
     829                   
     830                  RayTraversalData &s  = tStack.top(); 
     831                  node = s.mNode; 
     832                  extp = s.mExitPoint; 
     833                  maxt = s.mMaxT; 
     834                  tStack.pop(); 
    838835                } 
    839836        } 
    840  
     837         
    841838        return hits; 
    842839} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r2014 r2015  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: po 22. I 16:16:03 2007 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: po 22. I 17:10:45 2007 
    44# Project:  preprocessor.pro 
    55# Template: app 
     
    6363        $(MAKE) -f $(MAKEFILE).Debug uninstall 
    6464 
    65 Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc2005\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
     65Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
    6666                C:\Qt\4.1.2\mkspecs\features\qt_config.prf \ 
    6767                C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h

    r1998 r2015  
    310310        bool RequiresResort() const 
    311311        { 
    312                 // the last part should not be more than log of the sorted part. this 
    313                 // way we can achieve logarithmic behaviour for insertion and find 
    314                 const int dirtySize = (int)mEntries.size() - mLastSorted; 
    315                 return dirtySize > 4*(int)(log((double)mEntries.size()) / log(2.0)); 
    316         } 
    317  
    318  
     312          // the last part should not be more than log of the sorted part. this 
     313          // way we can achieve logarithmic behaviour for insertion and find 
     314          const int dirtySize = (int)mEntries.size() - mLastSorted; 
     315          return dirtySize > 500; 
     316          //              4*(int)(log((double)mEntries.size()) / log(2.0)); 
     317        } 
     318 
     319  bool RequiresResortLog() const 
     320  { 
     321        // the last part should not be more than log of the sorted part. this 
     322        // way we can achieve logarithmic behaviour for insertion and find 
     323        const int dirtySize = (int)mEntries.size() - mLastSorted; 
     324        return dirtySize > 4*(int)(log((double)mEntries.size()) / log(2.0)); 
     325  } 
     326   
     327   
    319328        int GetLastSorted() const 
    320329        { 
     
    600609                                         const bool checkDirty) 
    601610{ 
    602   bool found = false; 
    603    
    604611  PvsEntry<T, S> dummy(sample, PvsData()); 
    605612   
     
    611618   
    612619  if ((it != mEntries.end()) && ((*it).mObject == sample)) 
    613         found = true; 
     620        //  if (it != sorted_end) 
     621        return true; 
    614622   
    615623  // sample not found yet => search further in the unsorted part 
    616   if (!found && checkDirty) { 
     624  if (checkDirty) { 
    617625         
    618626        for (it = sorted_end; (it != mEntries.end()) && ((*it).mObject != sample); ++ it) ; 
    619627         
    620628        if (it != mEntries.end()) 
    621           found = true; 
     629          return true; 
    622630  } 
    623631   
    624   return found; 
     632  return false; 
    625633} 
    626634 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r2010 r2015  
    77#include "RssTree.h" 
    88#include "Mutation.h" 
     9#include "PerfTimer.h" 
    910 
    1011namespace GtpVisibilityPreprocessor { 
     12 
     13extern PerfTimer pvsTimer; 
    1114 
    1215//HaltonSequence SamplingStrategy::sHalton; 
     
    545548  } 
    546549 
     550  pvsTimer.Entry(); 
     551  // resort pvss 
     552  mPreprocessor.mViewCellsManager->SortViewCellPvs(); 
     553  pvsTimer.Exit(); 
    547554   
    548555  UpdateRatios(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp

    r2003 r2015  
    149149const ObjectPvs &ViewCell::GetPvs() const 
    150150{ 
    151         return mPvs; 
     151  return mPvs; 
    152152} 
    153153 
     
    155155ObjectPvs &ViewCell::GetPvs() 
    156156{ 
    157         return mPvs; 
     157  return mPvs; 
    158158} 
    159159 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2014 r2015  
    2828 
    2929 
     30 
    3031#define USE_RAY_LENGTH_AS_CONTRIBUTION 0 
    3132#define DIST_WEIGHTED_CONTRIBUTION 0 
     
    3738namespace GtpVisibilityPreprocessor { 
    3839 
     40 
     41PerfTimer viewCellCastTimer; 
     42PerfTimer pvsTimer; 
     43PerfTimer objTimer; 
    3944 
    4045// HACK 
     
    16941699 
    16951700  VssRayContainer::const_iterator it, it_end = rays.end(); 
    1696    
     1701 
    16971702  for (it = rays.begin(); it != it_end; ++ it)  
    16981703        { 
     
    17071712        } 
    17081713 
     1714  cout<<"view cell cast time:"<<viewCellCastTimer.TotalTime()<<" s"<<endl; 
     1715  cout<<"pvs time:"<<pvsTimer.TotalTime()<<" s"<<endl; 
     1716   
    17091717  return sum; 
    17101718} 
     
    22352243 
    22362244 
     2245void 
     2246ViewCellsManager::SortViewCellPvs() 
     2247{ 
     2248 
     2249  ViewCellContainer::iterator it, it_end = mViewCells.end(); 
     2250  for (it = mViewCells.begin(); it != it_end; ++ it) { 
     2251        ObjectPvs &pvs = (*it)->GetPvs(); 
     2252        if (pvs.RequiresResortLog()) 
     2253          pvs.Sort(); 
     2254  } 
     2255} 
     2256 
    22372257void ViewCellsManager::ComputeViewCellContribution(ViewCell *viewCell, 
    22382258                                                                                                   VssRay &ray,  
     
    22422262{ 
    22432263  // check if we are outside of view space 
    2244         if (!obj || !viewCell->GetValid()) 
    2245                 return; 
    2246          
    2247         // if ray not outside of view space 
    2248         float relContribution = 0.0f; 
    2249         float absContribution = 0.0f; 
    2250          
    2251         if (obj)  
    2252           { 
    2253                 // todo: maybe not correct for kd node pvs 
    2254                 if (addRays)  
    2255                 { 
    2256                         float pdf = viewCell->GetPvs().AddSampleDirtyCheck(obj, ray.mPdf); 
    2257                          
    2258                         if (pdf == ray.mPdf)  
    2259                         { 
    2260                                 absContribution = 1.0f; 
    2261                                 if (viewCell->GetPvs().RequiresResort())  
    2262                                         viewCell->GetPvs().SimpleSort(); 
    2263                         } 
    2264                 }  
    2265                 else  
    2266                 { 
    2267                         if (viewCell->GetPvs().GetSampleContribution( 
    2268                                                                                                                  obj, 
    2269                                                                                                                  ray.mPdf, 
    2270                                                                                                                  relContribution)) 
    2271                         { 
    2272                                 absContribution = 1.0f; 
    2273                         } 
    2274                 } 
    2275  
    2276                 // $$ clear the relative contribution as it is currently not correct anyway 
    2277                 relContribution = 0.0f; 
    2278                  
    2279                 if (absContribution == 1.0f)  
    2280                 { 
    2281                   ++ ray.mPvsContribution; 
    2282                   relContribution = 1.0f; 
    2283                    
    2284                    
     2264  // $$JB tmp commented to speedup up computations 
     2265#if 0 
     2266  if (!obj || !viewCell->GetValid()) 
     2267        return; 
     2268#endif 
     2269   
     2270   
     2271  // if ray not outside of view space 
     2272  float relContribution = 0.0f; 
     2273  float absContribution = 0.0f; 
     2274  bool hasAbsContribution; 
     2275   
     2276  // todo: maybe not correct for kd node pvs 
     2277  if (addRays) { 
     2278        hasAbsContribution = viewCell->GetPvs().AddSampleDirtyCheck(obj, 
     2279                                                                                                                                ray.mPdf); 
     2280  } 
     2281  else { 
     2282        hasAbsContribution = viewCell->GetPvs().GetSampleContribution( 
     2283                                                                                                                                  obj, 
     2284                                                                                                                                  ray.mPdf, 
     2285                                                                                                                                  relContribution); 
     2286  } 
     2287   
     2288  // $$ clear the relative contribution as it is currently not correct anyway 
     2289  //  relContribution = 0.0f; 
     2290   
     2291  if (hasAbsContribution)  { 
     2292        ++ ray.mPvsContribution; 
     2293        absContribution = relContribution = 1.0f; 
     2294        if (viewCell->GetPvs().RequiresResort())  
     2295          viewCell->GetPvs().SimpleSort(); 
     2296 
    22852297#if CONTRIBUTION_RELATIVE_TO_PVS_SIZE 
    2286                   relContribution /= viewcell->GetPvs().GetSize(); 
     2298        relContribution /= viewcell->GetPvs().GetSize(); 
    22872299#endif 
    2288                    
     2300         
    22892301#if DIST_WEIGHTED_CONTRIBUTION  
    2290                   // recalculate the contribution - weight the 1.0f contribution by the sqr distance to the 
    2291                   // object-> a new contribution in the proximity of the viewcell has a larger weight! 
    2292                   relContribution /= SqrDistance(GetViewCellBox(viewcell).Center(), 
    2293                                                                                 ray.mTermination); 
    2294                    
     2302        // recalculate the contribution - weight the 1.0f contribution by the sqr distance to the 
     2303        // object-> a new contribution in the proximity of the viewcell has a larger weight! 
     2304        relContribution /= SqrDistance(GetViewCellBox(viewcell).Center(), 
     2305                                                                  ray.mTermination); 
     2306         
    22952307#endif 
    2296                 } 
    2297                  
     2308        } 
     2309   
    22982310#if SUM_RAY_CONTRIBUTIONS || AVG_RAY_CONTRIBUTIONS 
    2299                 ray.mRelativePvsContribution += relContribution; 
     2311  ray.mRelativePvsContribution += relContribution; 
    23002312#else 
    2301                 // recalculate relative contribution - use max of Rel Contribution 
    2302                 if (ray.mRelativePvsContribution < relContribution) 
    2303                   ray.mRelativePvsContribution = relContribution; 
     2313  // recalculate relative contribution - use max of Rel Contribution 
     2314  if (ray.mRelativePvsContribution < relContribution) 
     2315        ray.mRelativePvsContribution = relContribution; 
    23042316#endif 
    2305           } 
    2306          
    2307 } 
     2317} 
     2318 
     2319 
    23082320 
    23092321 
     
    23652377         
    23662378        if (!ray.mTerminationObject) 
    2367                 return 0.0f; 
    2368  
    2369         static ViewCellContainer viewCells; 
    2370  
    2371            
     2379          return 0.0f; 
     2380         
    23722381        static Ray hray; 
    23732382        hray.Init(ray); 
     
    23822391        Vector3 origin = hray.Extrap(tmin); 
    23832392        Vector3 termination = hray.Extrap(tmax); 
    2384  
     2393         
    23852394        ViewCell::NewMail(); 
    2386  
    2387         viewCells.clear(); 
    2388          
    2389         // traverse the view space subdivision 
    2390         CastLineSegment(origin, termination, viewCells); 
     2395         
     2396        viewCellCastTimer.Entry(); 
     2397 
     2398        static ViewCellContainer viewCells; 
     2399        static VssRay *lastVssRay = NULL; 
     2400         
     2401        if (lastVssRay == NULL || 
     2402                !(ray.mOrigin == lastVssRay->mTermination) || 
     2403                !(ray.mTermination == lastVssRay->mOrigin)) { 
     2404          viewCells.clear(); 
     2405          // traverse the view space subdivision 
     2406          CastLineSegment(origin, termination, viewCells); 
     2407          lastVssRay = &ray; 
     2408        } 
     2409         
     2410        viewCellCastTimer.Exit(); 
    23912411 
    23922412        mSamplesStat.mViewCells += (int)viewCells.size(); 
     
    23942414        if (storeViewCells) 
    23952415        {        
     2416          cerr<<"Store viewcells should not be used in the test!"<<endl; 
    23962417          // copy viewcells memory efficiently 
    23972418#if VSS_STORE_VIEWCELLS 
     
    24032424#endif 
    24042425        } 
    2405  
     2426         
    24062427        Intersectable *terminationObj; 
     2428         
     2429        objTimer.Entry(); 
    24072430 
    24082431        // obtain pvs entry (can be different from hit object) 
    24092432        if (!useHitObjects) 
    2410                 terminationObj = GetIntersectable(ray, true); 
     2433          terminationObj = GetIntersectable(ray, true); 
    24112434        else 
    2412                 terminationObj = ray.mTerminationObject; 
     2435          terminationObj = ray.mTerminationObject; 
     2436         
     2437        objTimer.Exit(); 
     2438         
     2439        pvsTimer.Entry(); 
    24132440 
    24142441        ViewCellContainer::const_iterator it = viewCells.begin(); 
     
    24222449                                                                        addRays); 
    24232450        } 
     2451 
     2452        pvsTimer.Exit(); 
    24242453 
    24252454        mSamplesStat.mPvsContributions += ray.mPvsContribution; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r1990 r2015  
    4444 
    4545 
     46 
     47 
    4648  struct PvsFilterStatistics { 
    4749        PvsFilterStatistics():  
     
    373375                                                           int maxPvsSize) const; 
    374376 
    375          
     377 
     378  // resort pvss after a pass of the algorithm 
     379  void 
     380  SortViewCellPvs(); 
     381 
    376382        /** Sets validity of view cell 
    377383        */ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r1789 r2015  
    34473447        float t; 
    34483448        const float thresh = 1e-6f; // matt: change this to adjustable value 
    3449          
     3449 
    34503450        while (1) 
    34513451        { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.cpp

    r1012 r2015  
    299299} 
    300300 
    301 VspKdViewCell *VspKdLeaf::GetViewCell() 
    302 { 
    303         return mViewCell; 
    304 } 
    305301 
    306302void VspKdLeaf::SetViewCell(VspKdViewCell *viewCell) 
     
    20982094        int axis; 
    20992095 
     2096        cerr<<"HERE"<<endl; 
    21002097        while (1) 
    21012098        { 
    21022099                if (!node->IsLeaf()) 
    21032100                { 
    2104                         VspKdInterior *in = dynamic_cast<VspKdInterior *>(node); 
     2101                        VspKdInterior *in = (VspKdInterior *)node; 
    21052102                        position = in->mPosition; 
    21062103                        axis = in->mAxis; 
     
    21462143                { 
    21472144                        // compute intersection with all objects in this leaf 
    2148                         VspKdLeaf *leaf = dynamic_cast<VspKdLeaf *>(node); 
     2145                        VspKdLeaf *leaf = (VspKdLeaf *)node; 
    21492146                        ViewCell *vc = leaf->GetViewCell(); 
    21502147 
     
    21562153                        } 
    21572154 
     2155#if 0                    
    21582156                        if (0) //matt TODO: REMOVE LATER 
    2159                                 leaf->mRays.push_back(RayInfo(new VssRay(origin, termination, NULL, NULL, 0))); 
    2160  
     2157                          leaf->mRays.push_back(RayInfo(new VssRay(origin, termination, NULL, NULL, 0))); 
     2158#endif 
     2159                         
    21612160                        // get the next node from the stack 
    21622161                        if (tStack.empty()) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.h

    r1112 r2015  
    433433        /** Returns view cell associated with this leaf. 
    434434        */ 
    435         VspKdViewCell *GetViewCell(); 
     435  VspKdViewCell *GetViewCell() { 
     436        return mViewCell; 
     437  } 
    436438 
    437439        /** Returns number of times the max cost ratio was missed until 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r2003 r2015  
    268268 
    269269 
    270 bool VspInterior::IsLeaf() const 
    271 {  
    272         return false;  
    273 } 
    274  
    275  
    276 VspNode *VspInterior::GetBack()  
    277 { 
    278         return mBack; 
    279 } 
    280  
    281  
    282 VspNode *VspInterior::GetFront()  
    283 { 
    284         return mFront; 
    285 } 
    286  
    287  
    288 AxisAlignedPlane VspInterior::GetPlane() const 
    289 { 
    290         return mPlane; 
    291 } 
    292  
    293  
    294 float VspInterior::GetPosition() const 
    295 { 
    296         return mPlane.mPosition; 
    297 } 
    298  
    299  
    300 int VspInterior::GetAxis() const 
    301 { 
    302         return mPlane.mAxis; 
    303 } 
     270 
     271 
    304272 
    305273 
     
    388356 
    389357 
    390 ViewCellLeaf *VspLeaf::GetViewCell() const 
    391 { 
    392         return mViewCell; 
    393 } 
    394358 
    395359 
     
    400364 
    401365 
    402 bool VspLeaf::IsLeaf() const  
    403 {  
    404         return true;  
    405 } 
    406366 
    407367 
     
    23762336        int axis; 
    23772337 
     2338        ViewCell::NewMail(); 
     2339         
    23782340        while (1) 
    23792341        { 
    23802342                if (!node->IsLeaf()) 
    23812343                { 
    2382                         VspInterior *in = dynamic_cast<VspInterior *>(node); 
     2344                        VspInterior *in = (VspInterior *)node; 
    23832345                        position = in->GetPosition(); 
    23842346                        axis = in->GetAxis(); 
     
    24252387                { 
    24262388                        // compute intersection with all objects in this leaf 
    2427                         VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 
     2389                        VspLeaf *leaf = (VspLeaf *)node; 
    24282390                        ViewCell *viewCell; 
    2429                         if (0) 
    2430                                 viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 
    2431                         else 
    2432                                 viewCell = leaf->GetViewCell(); 
    2433  
     2391                        //                      if (0) 
     2392                        //                              viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 
     2393                        //                      else 
     2394 
     2395                        viewCell = leaf->GetViewCell(); 
     2396                         
    24342397                        // don't have to mail if each view cell belongs to exactly one leaf 
    2435                         if (!useMailboxing || !viewCell->Mailed()) 
    2436                         { 
    2437                                 if (useMailboxing) 
    2438                                         viewCell->Mail(); 
    2439  
    2440                                 viewcells.push_back(viewCell); 
    2441                                 ++ hits; 
    2442                         } 
    2443  
     2398                        // $$ JB -> always mailbox so that we have less conditions 
     2399                        if (!viewCell->Mailed()) { 
     2400                          viewCell->Mail(); 
     2401                           
     2402                          viewcells.push_back(viewCell); 
     2403                          ++ hits; 
     2404                        } 
     2405                         
    24442406                        // get the next node from the stack 
    24452407                        if (tStack.empty()) 
    2446                                 break; 
    2447  
     2408                          break; 
     2409                         
    24482410                        entp = extp; 
    24492411                        mint = maxt; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h

    r2003 r2015  
    235235        /** @return false since it is an interior node  
    236236        */ 
    237         bool IsLeaf() const; 
     237  bool IsLeaf() const { 
     238        return false;  
     239  } 
     240 
    238241 
    239242        int Type() const; 
    240243 
    241         VspNode *GetBack(); 
    242         VspNode *GetFront(); 
     244  VspNode *GetBack() { 
     245        return mBack; 
     246  } 
     247 
     248 
     249  VspNode *GetFront() { 
     250        return mFront; 
     251  } 
    243252 
    244253        /** Returns split plane. 
    245254        */ 
    246         AxisAlignedPlane GetPlane() const; 
     255  AxisAlignedPlane GetPlane() const { 
     256        return mPlane; 
     257  } 
     258   
    247259 
    248260        /** Returns position of split plane. 
    249261        */ 
    250         float GetPosition() const; 
     262  float GetPosition() const { 
     263        return mPlane.mPosition; 
     264  } 
    251265 
    252266        /** Returns split axis. 
    253267        */ 
    254         int GetAxis() const; 
     268  int GetAxis() const { 
     269        return mPlane.mAxis; 
     270  } 
    255271 
    256272        /** Replace front or back child with new child. 
     
    308324        /** @return true since it is an interior node  
    309325        */ 
    310         bool IsLeaf() const; 
     326  bool IsLeaf() const { 
     327        return true; 
     328  } 
    311329         
    312330        int Type() const; 
     
    314332        /** Returns pointer of view cell. 
    315333        */ 
    316         ViewCellLeaf *GetViewCell() const; 
     334  ViewCellLeaf *GetViewCell() const { 
     335        return mViewCell; 
     336  } 
     337 
    317338        /** Sets pointer to view cell. 
    318339        */ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro

    r2014 r2015  
    112112Mailable.cpp \ 
    113113CombinedPreprocessor.cpp Vector2.cpp GlobalLinesRenderer.cpp \ 
    114 RenderTexture.cpp Mutation.cpp 
     114RenderTexture.cpp Mutation.cpp Timer/RDTSCTimer.cpp Timer/BenchTimer.cpp Timer/merror.cpp 
    115115 
    116116SOURCES += BoostPreprocessorThread.cpp  
  • GTP/trunk/Lib/Vis/Preprocessing/src/run_test2

    r2014 r2015  
    5252 -view_cells_use_kd_pvs- -af_use_kd_pvs- \ 
    5353 -preprocessor_visibility_file=$PREFIX-i-mixed-bvh-n4i.xml \ 
    54  -preprocessor_stats=$PREFIX-i-mixed-b1-n4i.log \ 
     54 -preprocessor_stats=$PREFIX-i-mixed-bvh-n4i.log \ 
    5555 -preprocessor_histogram_file=$PREFIX-i-mixed-bvh-n4i.hlog 
     56 
    5657 
    5758#$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 
Note: See TracChangeset for help on using the changeset viewer.