Ignore:
Timestamp:
01/09/08 11:14:26 (16 years ago)
Author:
bittner
Message:

Havran Ray Caster compiles and links, but still does not work

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
26 added
21 edited

Legend:

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

    r2575 r2582  
    15521552  // from the sphere center 
    15531553 
    1554   const float *minp = &(mMin[0]); 
    1555   const float *maxp = &(mMax[0]); 
    1556   const float *pcenter = &(point[0]); 
     1554  const float *minp = &(mMin.x); 
     1555  const float *maxp = &(mMax.x); 
     1556  const float *pcenter = &(point.x); 
    15571557   
    15581558  // for x-axis 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r2575 r2582  
    29782978        result = false; 
    29792979  } 
    2980   delete envFilename; 
     2980  delete [] envFilename; 
    29812981 
    29822982  // Parse the command line; options given on the command line subsume 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r2575 r2582  
    376376        Vector3 up(0,1,0); 
    377377 
    378         if (abs(DotProd(mViewDirection, up)) > 0.99f) 
    379                 up = Vector3(1, 0, 0); 
     378        if (fabs(DotProd(mViewDirection, up)) > 0.99f) 
     379          up = Vector3(1, 0, 0); 
    380380 
    381381        glLoadIdentity(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.cpp

    r2575 r2582  
    6060} 
    6161 
    62  
    63 int IntelRayCaster::CastRay( 
    64                             const SimpleRay &simpleRay, 
    65                             VssRayContainer &vssRays, 
    66                             const AxisAlignedBox3 &box, 
    67                             const bool castDoubleRay, 
    68                             const bool pruneInvalidRays 
    69                             ) 
     62// Using packet of 4 rays supposing that these are coherent 
     63// We give a box to which each ray is clipped to before the 
     64// ray shooting is computed ! 
     65void IntelRayCaster::CastRaysPacket4(const Vector3 &minBox, 
     66                                                                         const Vector3 &maxBox, 
     67                                                                         const Vector3 origin4[], 
     68                                                                         const Vector3 dirs4[], 
     69                                                                         int     result4[], 
     70                                                                         float   dist4[]) 
     71{ 
     72  for (int i = 0; i < 4; i++) { 
     73    mlrtaStoreRayASEye4(&origin4[i].x, &dirs4[i].x, i); 
     74  } 
     75   
     76  mlrtaTraverseGroupASEye4(&minBox.x, &maxBox.x, result4, dist4); 
     77  return; 
     78} 
     79 
     80 
     81   
     82int IntelRayCaster::CastRay(const SimpleRay &simpleRay, 
     83                                                        VssRayContainer &vssRays, 
     84                                                        const AxisAlignedBox3 &box, 
     85                                                        const bool castDoubleRay, 
     86                                                        const bool pruneInvalidRays 
     87                                                        ) 
    7088 
    7189  //cout << "intel ray" << endl; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.h

    r2176 r2582  
    3838        } 
    3939 
     40        // Using packet of 4 rays supposing that these are coherent 
     41        // We give a box to which each ray is clipped to before the 
     42        // ray shooting is computed ! 
     43  virtual void CastRaysPacket4(const Vector3 &minBox, 
     44                                                           const Vector3 &maxBox, 
     45                                                           const Vector3 origin4[], 
     46                                                           const Vector3 direction4[], 
     47                                                           int result4[], 
     48                                                           float dist4[]); 
     49   
    4050        virtual int CastRay(const SimpleRay &simpleRay, 
    4151                                                VssRayContainer &vssRays, 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.cpp

    r2575 r2582  
    11#include "Intersectable.h" 
    22#include "SimpleRay.h" 
    3 //#include "ktbconf.h" 
    43 
    54using namespace std; 
     
    87#define ALIGN16 __declspec(align(16)) 
    98#else 
    10 ALIGN16 GALIGN16 
     9#ifdef USE_HAVRAN_RAYCASTER  
     10#include "ktbconf.h" 
     11#define ALIGN16 GALIGN16 
     12#else 
     13#define ALIGN16 
     14#endif 
    1115#endif 
    1216 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r2575 r2582  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 3. I 15:47:31 2008 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: st 9. I 11:11:49 2008 
    44# Project:  preprocessor.pro 
    55# Template: app 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp

    r2574 r2582  
    2727  //#define Q_SEARCH_STEPS 3 
    2828 
    29 #define SORT_RAY_ENTRIES 1 
     29  // VH - commened out !!!!! 8/1/2008 
     30  // #define SORT_RAY_ENTRIES 1 
    3031 
    3132// use avg ray contribution as importance 
     
    367368  static Vector3 dirs[packetSize]; 
    368369  static Vector3 shifts[packetSize]; 
     370  static Vector3 origs[packetSize]; 
    369371  // now find the silhouette along the line 
    370372  int i; 
     
    378380          shifts[i] = r*line; 
    379381          dirs[i] = Normalize(newPivot + shifts[i] - termination ); 
    380           mlrtaStoreRayASEye4(&termination.x, 
    381                                                   &dirs[i].x, 
    382                                                   i); 
    383         } 
    384          
    385         mlrtaTraverseGroupASEye4(&box.Min().x, 
    386                                                          &box.Max().x, 
    387                                                          hit_triangles, 
    388                                                          dist); 
     382          origs[i] = termination; 
     383          // mlrtaStoreRayASEye4(&termination.x, &dirs[i].x, i); 
     384        } 
     385 
     386        // mlrtaTraverseGroupASEye4(&box.Min().x, &box.Max().x, hit_triangles, dist); 
     387        assert(preprocessor->mRayCaster); 
     388        preprocessor->mRayCaster->CastRaysPacket4(box.Min(), 
     389                                                                                          box.Max(), 
     390                                                                                          origs, dirs, 
     391                                                                                          hit_triangles, 
     392                                                                                          dist);        
    389393         
    390394        for (i=0; i < packetSize; i++) { 
    391395          if (hit_triangles[i] == -1) { 
    392                 // break on first passing ray 
    393                 break; 
     396            // break on first passing ray 
     397            break; 
    394398          } 
    395399        } 
     
    473477  static Vector3 dirs[packetSize]; 
    474478  static Vector3 shifts[packetSize]; 
     479  static Vector3 origs[packetSize]; 
    475480  // mutate the  
    476481  float alpha = RandomValue(0.0f, Real(2.0*M_PI)); 
     
    491496          shifts[i] = r*line; 
    492497          dirs[i] = Normalize(ray.mTermination + shifts[i] - origin ); 
    493           mlrtaStoreRayASEye4(&origin.x, 
    494                                                   &dirs[i].x, 
    495                                                   i); 
    496         } 
    497          
    498         mlrtaTraverseGroupASEye4(&box.Min().x, 
    499                                                          &box.Max().x, 
    500                                                          hit_triangles, 
    501                                                          dist); 
     498          origs[i] = origin; 
     499          //mlrtaStoreRayASEye4(&origin.x, &dirs[i].x, i); 
     500        } 
     501         
     502        // mlrtaTraverseGroupASEye4(&box.Min().x, &box.Max().x, hit_triangles, dist); 
     503        assert(preprocessor->mRayCaster); 
     504        preprocessor->mRayCaster->CastRaysPacket4(box.Min(), box.Max(), 
     505                                                  origs, dirs, hit_triangles, dist);        
    502506         
    503507        for (i=0; i < packetSize; i++) { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2580 r2582  
    589589 
    590590  mKdTree->Construct(); 
     591  sceneBox = mKdTree->GetBox(); 
    591592 
    592593  cout << "finished kd tree construction in " << TimeDiff(startTime, GetTime()) * 1e-3  
     
    11031104 
    11041105bool Preprocessor::InitRayCast(const string &externKdTree,  
    1105                                                            const string &internKdTree) 
     1106                               const string &internKdTree) 
    11061107{ 
    11071108        // always try to load the kd tree 
     
    12201221 
    12211222        const long t1 = GetTime(); 
    1222          
    1223         if (rays.size() > 10000) 
    1224         { 
    1225  
    1226                 mRayCaster->SortRays(rays); 
     1223 
     1224        // !!!!!!!!!!!!!!!! VH no sorting 
     1225        if (0 && 
     1226            rays.size() > 10000) 
     1227        { 
     1228 
     1229          mRayCaster->SortRays(rays); 
    12271230                cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl; 
    12281231        } 
     
    12601263#endif 
    12611264        } 
    1262         cerr<<"Deternmining PVS objects"<<endl; 
     1265        // cerr<<"Determining PVS objects"<<endl; 
    12631266        DeterminePvsObjects(vssRays); 
    12641267} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r2580 r2582  
    208208        /// kD-tree organizing the scene graph (occluders + occludees) + viewcells 
    209209        KdTree *mKdTree; 
     210        AxisAlignedBox3 sceneBox; 
    210211        /// View space partition bsp tree 
    211212        VspBspTree *mVspBspTree; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h

    r2570 r2582  
    55#include "common.h" 
    66#include <math.h> 
     7//#include "PvsBB.h" 
    78#include "PvsBase.h" 
    8  
     9#include "ObjectPvs.h" 
    910 
    1011 
    1112namespace GtpVisibilityPreprocessor { 
    1213 
    13  
    14 /** Iterator over the pvs. 
    15 */ 
    16 template<typename T, typename S> 
    17 class PvsIterator 
    18 { 
    19 public: 
    20         PvsIterator<T, S>(){} 
    21         PvsIterator<T, S>(const typename vector<PvsEntry<T, S> >::const_iterator &itCurrent, 
    22                                           const typename vector<PvsEntry<T, S> >::const_iterator &itEnd): 
    23         mItCurrent(itCurrent), mItEnd(itEnd) 
    24         { 
    25         } 
    26  
    27         inline bool HasMoreEntries() const { return (mItCurrent != mItEnd);     } 
    28  
    29         inline T Next(S &pdf) { 
    30                 pdf = (*mItCurrent).mData; 
    31                 return (*(mItCurrent ++)).mObject; 
    32         } 
    33  
    34         inline T Next() { return (*(mItCurrent ++)).mObject; } 
    35  
    36  
    37 private: 
    38          
    39         typename vector<PvsEntry<T, S> >::const_iterator mItCurrent; 
    40         typename vector<PvsEntry<T, S> >::const_iterator mItEnd; 
    41 }; 
    42  
    43  
    44 struct VerbosePvsStats 
    45 { 
    46         VerbosePvsStats(): mDistanceWeightedTriangles(0), mDistanceWeightedPvs(0), mWeightedTriangles(0) 
    47         {} 
    48  
    49         float mDistanceWeightedTriangles; 
    50         float mDistanceWeightedPvs; 
    51         float mWeightedTriangles; 
    52 }; 
    53  
    54  
    55 /** Template class representing the Potentially Visible Set (PVS)  
    56         mainly from a view cell, but also e.g., from objects. 
    57 */ 
    58 template<typename T, typename S> 
    59 class VerbosePvs 
    60 { 
    61         template<typename T, typename S> friend class PvsIterator; 
    62  
    63 public: 
    64  
    65         VerbosePvs(): mSamples(0), mEntries(), mLastSorted(0), mQueriesSinceSort(0)  
    66         {} 
    67  
    68         /** creates pvs and initializes it with the given entries.  
    69                 Assumes that entries are sorted. 
    70         */ 
    71         VerbosePvs(const vector<PvsEntry<T, S> > &samples); 
    72         virtual ~VerbosePvs() {}; 
    73  
    74         /** Compresses PVS lossless or lossy. 
    75         */ 
    76         int Compress() { return 0; } 
    77          
    78         inline int GetSize() const { return (int)mEntries.size(); } 
    79          
    80         inline bool Empty() const { return mEntries.empty(); } 
    81  
    82         inline void Reserve(const int n) { mEntries.reserve(n); } 
    83         /** Normalize the visibility of entries in order to get  
    84                 comparable results. 
    85         */ 
    86         void NormalizeMaximum(); 
    87         /** Merges pvs of a into this pvs. 
    88                 Warning: very slow! 
    89         */ 
    90         void MergeInPlace(const VerbosePvs<T, S> &a); 
    91         /** Difference of pvs to pvs b. 
    92         @returns number of different entries. 
    93         */ 
    94         int Diff(const VerbosePvs<T, S> &b); 
    95         /** Finds sample in PVS. 
    96                 @param checkDirty if dirty part of the pvs should be checked for entry  
    97                 (warning: linear runtime in dirty part) 
    98                 @returns iterator on the sample if found, else the place where  
    99                 it would be added in the sorted vector. 
    100         */ 
    101         bool Find(T sample, 
    102                           typename vector<PvsEntry<T, S> >::iterator &it, 
    103                           const bool checkDirty = true); 
    104  
    105         bool GetSampleContribution(T sample, const float pdf, float &contribution); 
    106         /** Adds sample to PVS. 
    107                 @returns contribution of sample (0 or 1) 
    108         */ 
    109         float AddSample(T sample, const float pdf); 
    110         /** Adds sample to PVS without checking for presence of the sample 
    111                 warning: pvs remains unsorted! 
    112         */ 
    113         void AddSampleDirty(T sample, const float pdf); 
    114         /** Adds sample dirty (on the end of the vector) but 
    115                 first checks if sample is already in clean part of the pvs. 
    116         */ 
    117         bool AddSampleDirtyCheck(T sample, const float pdf); 
    118         /** Sort pvs entries. This should always be called after a 
    119                 sequence of AddSampleDirty calls  
    120         */ 
    121         void Sort(); 
    122         /** Sort pvs entries assume that the pvs contains unique entries 
    123         */ 
    124         void SimpleSort(); 
    125         /** Adds sample to PVS. 
    126                 @returns PvsData 
    127         */ 
    128         typename std::vector<PvsEntry<T, S> >::iterator  
    129                 AddSample2(T sample, const float pdf); 
    130         /** Subtracts one pvs from another one. 
    131                 WARNING: could contains bugs 
    132                 @returns new pvs size 
    133         */ 
    134         int SubtractPvs(const VerbosePvs<T, S> &pvs); 
    135  
    136         /** Returns PVS data, i.e., how often it was seen from the view cell,  
    137                 and the object itsef. 
    138         */ 
    139         void GetData(const int index, T &entry, S &data); 
    140  
    141         /** Collects the PVS entries and returns them in the vector. 
    142         */ 
    143         void CollectEntries(std::vector<T> &entries); 
    144  
    145         /** Removes sample from PVS if reference count is zero. 
    146         @param visibleSamples number of references to be removed 
    147         */ 
    148         bool RemoveSample(T sample, const float pdf); 
    149  
    150         /** Compute continuous PVS difference  
    151         */ 
    152         void ComputeContinuousPvsDifference(VerbosePvs<T, S> &pvs,  
    153                                                                                 float &pvsReduction, 
    154                                                                                 float &pvsEnlargement); 
    155  
    156         /** Clears the pvs. 
    157         */ 
    158         void Clear(const bool trim = true); 
    159         /** Trim the vector containing the pvs. 
    160         */ 
    161         void Trim(); 
    162  
    163         static int GetEntrySizeByte();  
    164         static float GetEntrySize(); 
    165  
    166         /** Compute continuous PVS difference  
    167         */ 
    168         float GetPvsHomogenity(VerbosePvs<T, S> &pvs); 
    169  
    170         static void Merge(VerbosePvs<T, S> &mergedPvs,  
    171                                           const VerbosePvs<T, S> &a,  
    172                                           const VerbosePvs<T, S> &b); 
    173  
    174         inline int GetSamples() const { return mSamples; } 
    175  
    176         /** If there is an unsorted part in the pvs. 
    177         */ 
    178         bool IsDirty() const { return mLastSorted < mEntries.size(); } 
    179  
    180         /** If this pvs requires a resort to stay efficient. 
    181         */ 
    182         bool RequiresResort() const 
    183         { 
    184                 // the last part should not be more than log of the sorted part. this 
    185                 // way we can achieve logarithmic behaviour for insertion and find 
    186                 const int n = mEntries.size(); 
    187                 const int dirtySize = n - mLastSorted; 
    188  
    189                 const double LOG2E = 1.442695040f; 
    190  
    191                 const float logN = log((float)max(1, n))/LOG2E; 
    192                 const float logS = log((float)max(1, mLastSorted))/LOG2E; 
    193                 const float logD = log((float)max(1, dirtySize))/LOG2E; 
    194  
    195                 if (8*(n + 2*dirtySize*logD) < 
    196                         mQueriesSinceSort*((mLastSorted*logS + dirtySize*dirtySize/2)/n - logN))  
    197                 { 
    198                         // cout<<"Q="<<mQueriesSinceSort<<" N="<<n<<" D="<<dirtySize<<endl; 
    199                         return true; 
    200                 } 
    201                  
    202                 return false; 
    203         } 
    204  
    205         /** If this pvs requires a resort to stay efficient. 
    206         */ 
    207         bool RequiresResortLog() const 
    208         { 
    209                 // the last part should not be more than log of the sorted part. this 
    210                 // way we can achieve logarithmic behaviour for insertion and find 
    211                 const int dirtySize = (int)mEntries.size() - mLastSorted; 
    212                 return dirtySize > 4 * (int)(log((double)mEntries.size()) / log(2.0)); 
    213         } 
    214  
    215         inline int GetLastSorted() const { return mLastSorted; } 
    216  
    217         typename PvsIterator<T, S> GetIterator() const; 
    218  
    219         VerbosePvsStats mStats; 
    220  
    221 protected: 
    222  
    223         /** Merge pvs 1 from begin iterator to end iterator with 
    224                 pvs 2 from begin iterator to end iterator. 
    225         */ 
    226         static void Merge(VerbosePvs<T, S> &mergedPvs,  
    227                                           const typename std::vector<PvsEntry<T, S> >::const_iterator &aBegin, 
    228                                           const typename std::vector<PvsEntry<T, S> >::const_iterator &aEnd, 
    229                                           const typename std::vector<PvsEntry<T, S> >::const_iterator &bBegin, 
    230                                           const typename std::vector<PvsEntry<T, S> >::const_iterator &bEnd, 
    231                                           const int aSamples,  
    232                                           const int bSamples); 
    233  
    234  
    235         ////////////////////////////// 
    236  
    237         /// vector of PVS entries 
    238         vector<PvsEntry<T, S> > mEntries;  
    239  
    240         /// Number of samples used to create the PVS 
    241         int mSamples; 
    242  
    243         /// Last sorted entry in the pvs (important for find and merge) 
    244         int mLastSorted; 
    245  
    246         int mQueriesSinceSort; 
    247 }; 
    248  
     14inline int operator< (PvsEntry<Intersectable*, PvsData> const &a, 
     15                      PvsEntry<Intersectable*, PvsData> const &b) 
     16{ 
     17  return a.mObject < b.mObject; 
     18}  
    24919 
    25020template <typename T, typename S> 
     
    26131void VerbosePvs<T, S>::Sort() 
    26232{ 
    263         vector<PvsEntry<T, S> >::iterator it = mEntries.begin() + mLastSorted; 
    264         vector<PvsEntry<T, S> >::iterator it_end = mEntries.end(); 
     33        typename vector<PvsEntry<T, S> >::iterator it = mEntries.begin() + mLastSorted; 
     34        typename vector<PvsEntry<T, S> >::iterator it_end = mEntries.end(); 
    26535 
    26636        // throw out double entries 
    267         std::vector<PvsEntry<T, S> >::iterator newEnd = unique(it, it_end); 
     37        typename std::vector<PvsEntry<T, S> >::iterator newEnd = unique(it, it_end); 
    26838        sort(it, newEnd); 
    26939         
     
    28757{ 
    28858        //  sort(mEntries.begin(), mEntries.end()); 
    289         vector<PvsEntry<T, S> >::iterator it = mEntries.begin() + mLastSorted; 
     59        typename vector<PvsEntry<T, S> >::iterator it = mEntries.begin() + mLastSorted; 
    29060 
    29161        sort(it, mEntries.end()); 
     
    31282 
    31383        // Uses sum of log differences, which corresponds to entropy 
    314         vector<PvsEntry<T, S> >::iterator it; 
     84        typename vector<PvsEntry<T, S> >::iterator it; 
    31585 
    31686        for (it = b.mEntries.begin(); it != b.mEntries.end(); ++ it)  
     
    31989                float aSumPdf = 0.0f; 
    32090 
    321                 vector<PvsEntry<T, S> >::iterator oit; 
     91                typename vector<PvsEntry<T, S> >::iterator oit; 
    32292                const bool entryFound = Find((*it).mObject, oit);                
    32393 
     
    361131                else  
    362132                { 
    363                         vector<PvsEntry<T, S> >::iterator oit; 
     133                        typename vector<PvsEntry<T, S> >::iterator oit; 
    364134                 
    365135                        const bool entryFound = b.Find((*it).mObject, oit); 
     
    391161        int dif = 0; 
    392162 
    393         std::vector<PvsEntry<T, S> >::const_iterator it; 
     163        typename std::vector<PvsEntry<T, S> >::const_iterator it; 
    394164 
    395165        for (it = b.mEntries.begin(); it != b.mEntries.end(); ++ it) 
    396166        { 
    397                 vector<PvsEntry<T, S> >::iterator bit; 
     167                typename vector<PvsEntry<T, S> >::iterator bit; 
    398168                const bool entryFound = Find((*it).first, bit); 
    399169 
     
    436206                                                         const VerbosePvs<T, S> &b) 
    437207{ 
    438         std::vector<PvsEntry<T, S> >::const_iterator ait =  
     208        typename std::vector<PvsEntry<T, S> >::const_iterator ait =  
    439209                a.mEntries.begin(), ait_end = a.mEntries.end(); 
    440         std::vector<PvsEntry<T, S> >::const_iterator bit =  
     210        typename std::vector<PvsEntry<T, S> >::const_iterator bit =  
    441211                b.mEntries.begin(), bit_end = b.mEntries.end(); 
    442212         
     
    458228                                          const int bSamples) 
    459229{ 
    460         std::vector<PvsEntry<T, S> >::const_iterator ait = aBegin; 
    461         std::vector<PvsEntry<T, S> >::const_iterator bit = bBegin; 
     230        typename std::vector<PvsEntry<T, S> >::const_iterator ait = aBegin; 
     231        typename std::vector<PvsEntry<T, S> >::const_iterator bit = bBegin; 
    462232         
    463233        for (; (ait != aEnd); ++ ait) 
     
    525295template <typename T, typename S>  
    526296bool VerbosePvs<T, S>::Find(T sample, 
    527                                         typename vector<PvsEntry<T, S> >::iterator &it, 
    528                                         const bool checkDirty) 
     297                            typename vector<PvsEntry<T, S> >::iterator &it, 
     298                            const bool checkDirty) 
    529299{ 
    530300        bool found = false; 
     
    533303 
    534304        // only check clean part 
    535         vector<PvsEntry<T, S> >::iterator sorted_end = mEntries.begin() + mLastSorted; 
     305        typename vector<PvsEntry<T, S> >::iterator sorted_end = mEntries.begin() + mLastSorted; 
    536306        mQueriesSinceSort++; 
    537307 
     
    545315        if (!found && checkDirty)  
    546316        { 
    547                 vector<PvsEntry<T, S> >::iterator dit, dit_end = mEntries.end(); 
     317            typename vector<PvsEntry<T, S> >::iterator dit, dit_end = mEntries.end(); 
    548318 
    549319        for (dit = sorted_end; (dit != dit_end) && ((*dit).mObject != sample); ++ dit); 
     
    563333void VerbosePvs<T, S>::GetData(const int index, T &entry, S &data) 
    564334{ 
    565         std::vector<PvsEntry<T, S> >::iterator i = mEntries.begin(); 
     335        typename std::vector<PvsEntry<T, S> >::iterator i = mEntries.begin(); 
    566336        for (int k = 0; k != index && i != mEntries.end(); ++ i, ++ k); 
    567337 
     
    576346        ++ mSamples; 
    577347         
    578         vector<PvsEntry<T, S> >::iterator it; 
     348        typename vector<PvsEntry<T, S> >::iterator it; 
    579349        const bool entryFound = Find(sample, it);                
    580350 
     
    609379        ++ mSamples; 
    610380         
    611         vector<PvsEntry<T, S> >::iterator it; 
     381        typename vector<PvsEntry<T, S> >::iterator it; 
    612382        const bool entryFound = Find(sample, it); 
    613383 
     
    633403        ++ mSamples; 
    634404 
    635         vector<PvsEntry<T, S> >::iterator it; 
     405        typename vector<PvsEntry<T, S> >::iterator it; 
    636406        const bool entryFound = Find(sample, it); 
    637407 
     
    656426                                                                          float &contribution)  
    657427{ 
    658         vector<PvsEntry<T, S> >::iterator it; 
     428        typename vector<PvsEntry<T, S> >::iterator it; 
    659429        const bool entryFound = Find(sample, it); 
    660430 
     
    678448        -- mSamples; 
    679449         
    680         vector<PvsEntry<T, S> >::iterator it; 
     450        typename vector<PvsEntry<T, S> >::iterator it; 
    681451        const bool entryFound = Find(sample, it); 
    682452 
     
    703473        const int samples = mSamples - pvs.mSamples; 
    704474 
    705         std::vector<PvsEntry<T, S> >:: 
    706                 const_iterator it, it_end = pvs.mEntries.end(); 
     475        typename std::vector<PvsEntry<T, S> >:: 
     476          const_iterator it, it_end = pvs.mEntries.end(); 
    707477 
    708478        // output PVS of view cell 
     
    719489void VerbosePvs<T, S>::CollectEntries(std::vector<T> &entries) 
    720490{ 
    721         std::vector<PvsEntry<T, S> >:: 
    722                 const_iterator it, it_end = mEntries.end(); 
     491        typename std::vector<PvsEntry<T, S> >:: 
     492           const_iterator it, it_end = mEntries.end(); 
    723493 
    724494        // output PVS of view cell 
     
    731501void VerbosePvs<T, S>::NormalizeMaximum() 
    732502{ 
    733         std::vector<PvsEntry<T, S> >:: 
     503        typename std::vector<PvsEntry<T, S> >:: 
    734504                const_iterator it, it_end = mEntries.end(); 
    735505 
     
    739509        for (it = mEntries.begin(); it != it_end; ++ it) { 
    740510                float sum = (*it)->second.sumPdf; 
    741                 if (sum > maxSum) 
    742                         maxSum = sum; 
    743         } 
    744  
    745         maxSum = 1.0f / maxSum; 
     511                if (sum > maxPdfSum) 
     512                        maxPdfSum = sum; 
     513        } 
     514 
     515        maxPdfSum = 1.0f / maxPdfSum; 
    746516 
    747517        for (it = mEntries.begin(); it != it_end; ++ it) { 
    748                 (*it)->second.sumPdf *= maxSum; 
     518                (*it)->second.sumPdf *= maxPdfSum; 
    749519        } 
    750520} 
     
    776546 
    777547template <typename T, typename S> 
    778 typename PvsIterator<T, S> VerbosePvs<T, S>::GetIterator() const 
     548PvsIterator<T, S> VerbosePvs<T, S>::GetIterator() const 
    779549{ 
    780550        PvsIterator<T, S> pit(mEntries.begin(), mEntries.end()); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/PvsBase.h

    r2530 r2582  
    66 
    77 
    8  
    98namespace GtpVisibilityPreprocessor { 
    10  
    119 
    1210/** Information stored with a PVS entry. Consists of the number 
    1311        the object was seen from the view cell. 
    1412*/ 
     13struct PvsData  
     14{ 
     15public: 
     16        PvsData() {} 
     17        PvsData(const float sumPdf): 
     18        mSumPdf(sumPdf) {} 
     19         
     20        // $$JB in order to return meaningfull values 
     21        // it assumes that the sum pdf has been normalized somehow!!! 
     22        inline float GetVisibility() { return mSumPdf; } 
     23 
     24        /// sum of probability density of visible sample rays 
     25        float mSumPdf; 
     26}; 
     27 
     28 
     29class MailablePvsData  
     30{ 
     31public: 
     32        // sum of probability density of visible sample rays 
     33        float mSumPdf; 
     34        int mCounter; 
     35 
     36        MailablePvsData() {} 
     37        MailablePvsData(const float sumPdf): 
     38        mSumPdf(sumPdf) {} 
     39 
     40        // $$JB in order to return meaningfull values 
     41        // it assumes that the sum pdf has been normalized somehow!!! 
     42        inline float GetVisibility() { return mSumPdf; } 
     43 
     44 
     45        /////////////// 
     46        //  Mailing stuff 
     47 
     48        // last mail id -> warning not thread safe! 
     49        // both mailId and mailbox should be unique for each thread!!! 
     50        static int sMailId; 
     51        static int sReservedMailboxes; 
     52 
     53        static void NewMail(const int reserve = 1)  
     54        { 
     55                sMailId += sReservedMailboxes; 
     56                sReservedMailboxes = reserve; 
     57        } 
     58 
     59        void Mail() { mMailbox = sMailId; } 
     60        bool Mailed() const { return mMailbox == sMailId; } 
     61 
     62        void Mail(const int mailbox) { mMailbox = sMailId + mailbox; } 
     63        bool Mailed(const int mailbox) const { return mMailbox == sMailId + mailbox; } 
     64 
     65        int IncMail() { return ++ mMailbox - sMailId; } 
     66         
     67        ////////////////////////////////////////// 
     68 
     69protected: 
     70 
     71        int mMailbox; 
     72 
     73}; 
     74 
     75 
     76/** Information stored with a PVS entry. Consists of the number 
     77        the object was seen from the view cell. 
     78*/ 
    1579template<typename T, typename S> 
    1680struct PvsEntry  
     
    2589        S mData; 
    2690 
    27         template<typename T, typename S> 
    28         friend int operator< (const PvsEntry<T, S> &a, const PvsEntry<T, S> &b); 
    29         template<typename T, typename S> 
    30         friend int operator== (const PvsEntry<T, S> &a, const PvsEntry<T, S> &b); 
     91  //template<typename T, typename S> 
     92  friend int operator< (const PvsEntry<T, S> &a, const PvsEntry<T, S> &b); 
     93  //template<typename T, typename S> 
     94  friend int operator== (const PvsEntry<T, S> &a, const PvsEntry<T, S> &b); 
    3195}; 
    3296 
     
    60124}  
    61125 
    62 /** Information stored with a PVS entry. Consists of the number 
    63         the object was seen from the view cell. 
     126 
     127/** Iterator over the pvs. 
    64128*/ 
    65 struct PvsData  
    66 { 
    67 public: 
    68         PvsData() {} 
    69         PvsData(const float sumPdf): 
    70         mSumPdf(sumPdf) {} 
    71          
    72         // $$JB in order to return meaningfull values 
    73         // it assumes that the sum pdf has been normalized somehow!!! 
    74         inline float GetVisibility() { return mSumPdf; } 
    75  
    76         /// sum of probability density of visible sample rays 
    77         float mSumPdf; 
    78 }; 
    79  
    80  
    81 class MailablePvsData  
    82 { 
    83 public: 
    84         // sum of probability density of visible sample rays 
    85         float mSumPdf; 
    86         int mCounter; 
    87  
    88         MailablePvsData() {} 
    89         MailablePvsData(const float sumPdf): 
    90         mSumPdf(sumPdf) {} 
    91  
    92         // $$JB in order to return meaningfull values 
    93         // it assumes that the sum pdf has been normalized somehow!!! 
    94         inline float GetVisibility() { return mSumPdf; } 
    95  
    96  
    97         /////////////// 
    98         //  Mailing stuff 
    99  
    100         // last mail id -> warning not thread safe! 
    101         // both mailId and mailbox should be unique for each thread!!! 
    102         static int sMailId; 
    103         static int sReservedMailboxes; 
    104  
    105         static void NewMail(const int reserve = 1)  
     129template<typename T, typename S> 
     130class PvsIterator 
     131{ 
     132public: 
     133        PvsIterator<T, S>(){} 
     134        PvsIterator<T, S>(const typename vector<PvsEntry<T, S> >::const_iterator &itCurrent, 
     135                                          const typename vector<PvsEntry<T, S> >::const_iterator &itEnd): 
     136        mItCurrent(itCurrent), mItEnd(itEnd) 
    106137        { 
    107                 sMailId += sReservedMailboxes; 
    108                 sReservedMailboxes = reserve; 
    109         } 
    110  
    111         void Mail() { mMailbox = sMailId; } 
    112         bool Mailed() const { return mMailbox == sMailId; } 
    113  
    114         void Mail(const int mailbox) { mMailbox = sMailId + mailbox; } 
    115         bool Mailed(const int mailbox) const { return mMailbox == sMailId + mailbox; } 
    116  
    117         int IncMail() { return ++ mMailbox - sMailId; } 
    118          
    119         ////////////////////////////////////////// 
     138        } 
     139   
     140        inline bool HasMoreEntries() const { return (mItCurrent != mItEnd);     } 
     141 
     142        inline T Next(S &pdf) { 
     143                pdf = (*mItCurrent).mData; 
     144                return (*(mItCurrent ++)).mObject; 
     145        } 
     146 
     147        inline T Next() { return (*(mItCurrent ++)).mObject; } 
     148 
     149 
     150private: 
     151         
     152        typename vector<PvsEntry<T, S> >::const_iterator mItCurrent; 
     153        typename vector<PvsEntry<T, S> >::const_iterator mItEnd; 
     154}; 
     155 
     156 
     157 
     158 
     159struct VerbosePvsStats 
     160{ 
     161        VerbosePvsStats(): mDistanceWeightedTriangles(0), mDistanceWeightedPvs(0), mWeightedTriangles(0) 
     162        {} 
     163 
     164        float mDistanceWeightedTriangles; 
     165        float mDistanceWeightedPvs; 
     166        float mWeightedTriangles; 
     167}; 
     168 
     169 
     170/** Template class representing the Potentially Visible Set (PVS)  
     171        mainly from a view cell, but also e.g., from objects. 
     172*/ 
     173template<typename T, typename S> 
     174class VerbosePvs 
     175{ 
     176  template<typename T1, typename S1> friend class PvsIterator; 
     177 
     178public: 
     179 
     180        VerbosePvs(): mSamples(0), mEntries(), mLastSorted(0), mQueriesSinceSort(0)  
     181        {} 
     182 
     183        /** creates pvs and initializes it with the given entries.  
     184                Assumes that entries are sorted. 
     185        */ 
     186        VerbosePvs(const vector<PvsEntry<T, S> > &samples); 
     187        virtual ~VerbosePvs() {}; 
     188 
     189        /** Compresses PVS lossless or lossy. 
     190        */ 
     191        int Compress() { return 0; } 
     192         
     193        inline int GetSize() const { return (int)mEntries.size(); } 
     194         
     195        inline bool Empty() const { return mEntries.empty(); } 
     196 
     197        inline void Reserve(const int n) { mEntries.reserve(n); } 
     198        /** Normalize the visibility of entries in order to get  
     199                comparable results. 
     200        */ 
     201        void NormalizeMaximum(); 
     202        /** Merges pvs of a into this pvs. 
     203                Warning: very slow! 
     204        */ 
     205        void MergeInPlace(const VerbosePvs<T, S> &a); 
     206        /** Difference of pvs to pvs b. 
     207        @returns number of different entries. 
     208        */ 
     209        int Diff(const VerbosePvs<T, S> &b); 
     210        /** Finds sample in PVS. 
     211                @param checkDirty if dirty part of the pvs should be checked for entry  
     212                (warning: linear runtime in dirty part) 
     213                @returns iterator on the sample if found, else the place where  
     214                it would be added in the sorted vector. 
     215        */ 
     216        bool Find(T sample, 
     217                          typename vector<PvsEntry<T, S> >::iterator &it, 
     218                          const bool checkDirty = true); 
     219 
     220        bool GetSampleContribution(T sample, const float pdf, float &contribution); 
     221        /** Adds sample to PVS. 
     222                @returns contribution of sample (0 or 1) 
     223        */ 
     224        float AddSample(T sample, const float pdf); 
     225        /** Adds sample to PVS without checking for presence of the sample 
     226                warning: pvs remains unsorted! 
     227        */ 
     228        void AddSampleDirty(T sample, const float pdf); 
     229        /** Adds sample dirty (on the end of the vector) but 
     230                first checks if sample is already in clean part of the pvs. 
     231        */ 
     232        bool AddSampleDirtyCheck(T sample, const float pdf); 
     233        /** Sort pvs entries. This should always be called after a 
     234                sequence of AddSampleDirty calls  
     235        */ 
     236        void Sort(); 
     237        /** Sort pvs entries assume that the pvs contains unique entries 
     238        */ 
     239        void SimpleSort(); 
     240        /** Adds sample to PVS. 
     241                @returns PvsData 
     242        */ 
     243        typename std::vector<PvsEntry<T, S> >::iterator  
     244                AddSample2(T sample, const float pdf); 
     245        /** Subtracts one pvs from another one. 
     246                WARNING: could contains bugs 
     247                @returns new pvs size 
     248        */ 
     249        int SubtractPvs(const VerbosePvs<T, S> &pvs); 
     250 
     251        /** Returns PVS data, i.e., how often it was seen from the view cell,  
     252                and the object itsef. 
     253        */ 
     254        void GetData(const int index, T &entry, S &data); 
     255 
     256        /** Collects the PVS entries and returns them in the vector. 
     257        */ 
     258        void CollectEntries(std::vector<T> &entries); 
     259 
     260        /** Removes sample from PVS if reference count is zero. 
     261        @param visibleSamples number of references to be removed 
     262        */ 
     263        bool RemoveSample(T sample, const float pdf); 
     264 
     265        /** Compute continuous PVS difference  
     266        */ 
     267        void ComputeContinuousPvsDifference(VerbosePvs<T, S> &pvs,  
     268                                                                                float &pvsReduction, 
     269                                                                                float &pvsEnlargement); 
     270 
     271        /** Clears the pvs. 
     272        */ 
     273        void Clear(const bool trim = true); 
     274        /** Trim the vector containing the pvs. 
     275        */ 
     276        void Trim(); 
     277 
     278        static int GetEntrySizeByte();  
     279        static float GetEntrySize(); 
     280 
     281        /** Compute continuous PVS difference  
     282        */ 
     283        float GetPvsHomogenity(VerbosePvs<T, S> &pvs); 
     284 
     285        static void Merge(VerbosePvs<T, S> &mergedPvs,  
     286                                          const VerbosePvs<T, S> &a,  
     287                                          const VerbosePvs<T, S> &b); 
     288 
     289        inline int GetSamples() const { return mSamples; } 
     290 
     291        /** If there is an unsorted part in the pvs. 
     292        */ 
     293        bool IsDirty() const { return mLastSorted < mEntries.size(); } 
     294 
     295        /** If this pvs requires a resort to stay efficient. 
     296        */ 
     297        bool RequiresResort() const 
     298        { 
     299                // the last part should not be more than log of the sorted part. this 
     300                // way we can achieve logarithmic behaviour for insertion and find 
     301                const int n = mEntries.size(); 
     302                const int dirtySize = n - mLastSorted; 
     303 
     304                const double LOG2E = 1.442695040f; 
     305 
     306                const float logN = log((float) Max(1, n))/LOG2E; 
     307                const float logS = log((float) Max(1, mLastSorted))/LOG2E; 
     308                const float logD = log((float) Max(1, dirtySize))/LOG2E; 
     309 
     310                if (8*(n + 2*dirtySize*logD) < 
     311                        mQueriesSinceSort*((mLastSorted*logS + dirtySize*dirtySize/2)/n - logN))  
     312                { 
     313                        // cout<<"Q="<<mQueriesSinceSort<<" N="<<n<<" D="<<dirtySize<<endl; 
     314                        return true; 
     315                } 
     316                 
     317                return false; 
     318        } 
     319 
     320        /** If this pvs requires a resort to stay efficient. 
     321        */ 
     322        bool RequiresResortLog() const 
     323        { 
     324                // the last part should not be more than log of the sorted part. this 
     325                // way we can achieve logarithmic behaviour for insertion and find 
     326                const int dirtySize = (int)mEntries.size() - mLastSorted; 
     327                return dirtySize > 4 * (int)(log((double)mEntries.size()) / log(2.0)); 
     328        } 
     329 
     330        inline int GetLastSorted() const { return mLastSorted; } 
     331 
     332  PvsIterator<T, S> GetIterator() const; 
     333 
     334        VerbosePvsStats mStats; 
    120335 
    121336protected: 
    122337 
    123         int mMailbox; 
    124  
    125 }; 
     338        /** Merge pvs 1 from begin iterator to end iterator with 
     339                pvs 2 from begin iterator to end iterator. 
     340        */ 
     341        static void Merge(VerbosePvs<T, S> &mergedPvs,  
     342                                          const typename std::vector<PvsEntry<T, S> >::const_iterator &aBegin, 
     343                                          const typename std::vector<PvsEntry<T, S> >::const_iterator &aEnd, 
     344                                          const typename std::vector<PvsEntry<T, S> >::const_iterator &bBegin, 
     345                                          const typename std::vector<PvsEntry<T, S> >::const_iterator &bEnd, 
     346                                          const int aSamples,  
     347                                          const int bSamples); 
     348 
     349 
     350        ////////////////////////////// 
     351 
     352        /// vector of PVS entries 
     353        vector<PvsEntry<T, S> > mEntries;  
     354 
     355        /// Number of samples used to create the PVS 
     356        int mSamples; 
     357 
     358        /// Last sorted entry in the pvs (important for find and merge) 
     359        int mLastSorted; 
     360 
     361        int mQueriesSinceSort; 
     362}; 
     363 
    126364 
    127365} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h

    r2575 r2582  
    6767                        const bool pruneInvalidRays = true); 
    6868 
     69  // Using packet of 4 rays supposing that these are coherent 
     70  virtual void CastRaysPacket4(Vector3 origin4[], 
     71                               Vector3 direction4[], 
     72                               int     result4[], 
     73                               float   dist4[]) {  } 
     74 
     75  // Using packet of 4 rays supposing that these are coherent 
     76  // We give a box to which each ray is clipped to before the 
     77  // ray shooting is computed ! 
     78  virtual void CastRaysPacket4(const Vector3 &minBox, 
     79                                                           const Vector3 &maxBox, 
     80                                                           const Vector3 origin4[], 
     81                                                           const Vector3 direction4[], 
     82                                                           int result4[], 
     83                                                           float dist4[]) {  } 
     84   
    6985  // Just for testing concept 
    7086  virtual void CastRaysPacket2x2(RayPacket2x2 &raysPack, 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ReverseGvs.cpp

    r2546 r2582  
    361361  static float dist[packetSize]; 
    362362  static Vector3 dirs[packetSize]; 
     363  static Vector3 origs[packetSize]; 
    363364  static Vector3 shifts[packetSize]; 
    364365  // now find the silhouette along the line 
     
    373374          shifts[i] = r*line; 
    374375          dirs[i] = Normalize(newPivot + shifts[i] - termination ); 
    375           mlrtaStoreRayASEye4(&termination.x, 
    376                                                   &dirs[i].x, 
    377                                                   i); 
    378         } 
    379          
    380         mlrtaTraverseGroupASEye4(&box.Min().x, 
    381                                                          &box.Max().x, 
    382                                                          hit_triangles, 
    383                                                          dist); 
     376          origs[i] = termination; 
     377          // mlrtaStoreRayASEye4(&termination.x, &dirs[i].x, i); 
     378        } 
     379         
     380        // mlrtaTraverseGroupASEye4(&box.Min().x, &box.Max().x, hit_triangles, dist); 
     381        assert(preprocessor->mRayCaster); 
     382        preprocessor->mRayCaster->CastRaysPacket4(&box.Min(), &box.Max(), origs, 
     383                                                  dirs, hit_triangles, dist); 
    384384         
    385385        for (i=0; i < packetSize; i++) { 
     
    467467  static float dist[packetSize]; 
    468468  static Vector3 dirs[packetSize]; 
     469  static Vector3 origs[packetSize]; 
    469470  static Vector3 shifts[packetSize]; 
    470471  // mutate the  
     
    486487          shifts[i] = r*line; 
    487488          dirs[i] = Normalize(ray.mTermination + shifts[i] - origin ); 
    488           mlrtaStoreRayASEye4(&origin.x, 
    489                                                   &dirs[i].x, 
    490                                                   i); 
    491         } 
    492          
    493         mlrtaTraverseGroupASEye4(&box.Min().x, 
    494                                                          &box.Max().x, 
    495                                                          hit_triangles, 
    496                                                          dist); 
     489          // mlrtaStoreRayASEye4(&origin.x, &dirs[i].x, i); 
     490          origs[i] = origin; 
     491        } 
     492         
     493        // mlrtaTraverseGroupASEye4(&box.Min().x, &box.Max().x, hit_triangles, dist);    
     494        assert(preprocessor->mRayCaster); 
     495        preprocessor->mRayCaster->CastRaysPacket4(box.Min(), box.Max(), origs, 
     496                                                  dirs, hit_triangles, dist); 
    497497         
    498498        for (i=0; i < packetSize; i++) { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r2580 r2582  
    227227                                                                                                                                  r[2])); 
    228228 
    229         direction = mPreprocessor.mKdTree->GetBox().GetRandomPoint(Vector3(r[3], 
     229        direction = mPreprocessor.sceneBox.GetRandomPoint(Vector3(r[3], 
    230230                                                                                                                                           r[4], 
    231231                                                                                                                                           r[5]) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.h

    r2575 r2582  
    4141 
    4242  // Functions to get at the std::vector components 
    43   float& operator[] (int inx) { 
     43  float& operator[] (const int inx) { 
    4444#ifndef __VECTOR_HACK 
    4545    if (inx == 0) 
     
    6060#endif 
    6161 
    62   const float& operator[] (int inx) const { 
     62  const float &operator[] (const int inx) const { 
    6363#ifndef __VECTOR_HACK 
    6464    if (inx == 0) 
     
    6666    else 
    6767      if (inx == 1) 
    68         return y; 
     68                return y; 
    6969      else 
    70         return z; 
     70                return z; 
    7171#else 
    7272    return *(&x+inx); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/common.h

    r2575 r2582  
    2222 
    2323// use perftimer 
    24 #define PERFTIMER 
     24// #define PERFTIMER 
     25 
     26#define USE_HAVRAN_RAYCASTER 
    2527 
    2628namespace GtpVisibilityPreprocessor { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/default.env

    r2574 r2582  
    5252        useGlRenderer true 
    5353        useGlDebugger false 
    54 # 0 = INTERNAL          1 = MLRT 
     54# 0 = INTERNAL  1 = MLRT 2 = HAVRAN 
    5555        rayCastMethod 1 
    5656         
     
    280280 
    281281#       filename ../data/Arena/viewcells-5000.xml 
    282 filename ../data/Arena/viewcells-20000.xml 
     282#   filename ../data/Arena/viewcells-20000.xml 
    283283 
    284284#       filename ../data/atlanta/atlanta_viewcells_large.x3d 
     
    511511} 
    512512 
     513# settings for havran ray caster 
     514TestDoubleRays  true 
     515 
     516BSP { 
     517  termCrit        auto 
     518  #termCrit       auto2 
     519  #termCrit       adhoc 
     520  # For Arena 
     521  #maxDepthAllowed 15 
     522  #maxListLength    8 
     523  # For Vienna 
     524  #maxDepthAllowed 22 
     525  #maxListLength    6 
     526} 
     527 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r2579 r2582  
    2626#include "GlobalLinesRenderer.h" 
    2727#include "RayCaster.h" 
    28 //#include "testrt.h" 
     28//#include "vlastimil/testrt.h" 
    2929 
    3030#include "ViewCellsManager.h" 
     
    177177  //be ignored. Use it as you will! 
    178178  //note: from GDNet Direct [3.8.04 - 3.14.04] void detectMemoryLeaks() { 
     179 
     180//#define _CRT_SET 
     181 
    179182#ifdef _CRT_SET 
    180183  _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF); 
     
    218221        } 
    219222 
     223         
    220224        //Debug << "using pvs type " << PVS_TYPE << endl; 
    221225 
  • GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro

    r2575 r2582  
    11CONFIG += release 
     2#CONFIG += debug 
    23CONFIG += console warn_off thread mlrt qt 
    34 
    45TEMPLATE = app 
     6 
     7#CONFIG -= qt 
    58 
    69TARGET = preprocessor 
     
    8285CONFIG(qt) { 
    8386win32:LIBS += cg.lib cgGL.lib 
    84 DEFINES += USE_QT 
     87#DEFINES += USE_QT 
    8588} 
    8689 
     
    117120Timer/BenchTimer.cpp Timer/merror.cpp \ 
    118121Intersectable.cpp TraversalTree.cpp ObjectPvs.cpp ObjectsParser.cpp \ 
    119 FilterBasedDistribution.cpp DifferenceSampling.cpp HavranRayCaster.cpp 
     122FilterBasedDistribution.cpp DifferenceSampling.cpp HavranRayCaster.cpp \ 
     123OcclusionQuery.cpp  
    120124 
    121125 
    122126SOURCES += BoostPreprocessorThread.cpp  
    123127 
     128INCLUDEPATH+=havran 
     129SOURCES += havran/allocgo2.cpp havran/ktbai.cpp havran/ktbtrav.cpp \ 
     130havran/ktb.cpp havran/ktball.cpp havran/sbbox.cpp \ 
     131havran/ktb8b.cpp havran/ktbftrav.cpp havran/timer.cpp 
     132 
     133 
    124134CONFIG(qt) { 
    125135HEADERS += QtInterface/QtPreprocessorThread.h QtInterface/QtGlRenderer.h \ 
    126136QtInterface/QtGlViewer.h 
    127 SOURCES += OcclusionQuery.cpp QtInterface/QtPreprocessorThread.cpp \ 
     137SOURCES += QtInterface/QtPreprocessorThread.cpp \ 
    128138QtInterface/QtGlRenderer.cpp QtInterface/QtGlViewer.cpp  
     139SOURCES +=  QtInterface/LogReader.cpp QtInterface/LogWriter.cpp 
    129140} else { 
    130 SOURCES += BoostPreprocessorThread.cpp  
     141#SOURCES += BoostPreprocessorThread.cpp  
    131142} 
    132143 
  • GTP/trunk/Lib/Vis/Preprocessing/src/run_test2

    r2575 r2582  
    2929#VIEWCELLS=../data/test1/test-viewcells.xml 
    3030 
    31 SCENE=../data/Arena/arena-high-lods.obj 
    32 VIEWCELLS=../data/Arena/viewcells-5000.xml.gz 
     31#SCENE=../data/Arena/arena-high-lods.obj 
     32#VIEWCELLS=../data/Arena/viewcells-5000.xml.gz 
    3333 
    3434 
    35 #SCENE=../data/vienna/vienna_cropped.obj 
    36 #VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 
     35SCENE=../data/vienna/vienna_cropped.obj 
     36VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 
    3737#VIEWCELLS=../data/vienna/vienna-sequential-30000-single-viewcell.xml 
    3838 
Note: See TracChangeset for help on using the changeset viewer.