Changeset 2753 for GTP


Ignore:
Timestamp:
06/10/08 23:21:11 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/CHC_revisited
Files:
4 added
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/CHC_revisited/Bvh.h

    r2752 r2753  
    559559        int PostProcessLeaves(BvhLeafContainer &leaves); 
    560560 
    561         //bool CreateTighterBoundsForLeaf(BvhLeaf *leaf, Point3f *triangles, int triangleCount); 
    562  
    563         ///Point3f *CollectTriangles(BvhLeaf *leaf, int &triangleCount); 
    564561 
    565562        int     IsWithinViewFrustumLocal(BvhNode *node); 
  • GTP/trunk/App/Demos/Vis/CHC_revisited/RenderTraverser.h

    r2751 r2753  
    1414namespace CHCDemo 
    1515{ 
    16  
    17 typedef stack<HierarchyNode *> TraversalStack; 
    18 typedef queue<HierarchyNode *> QueryQueue; 
    19 typedef priority_queue<HierarchyNode *, vector<HierarchyNode *>, myless<vector<HierarchyNode *>::value_type> > PriorityQueue; 
    2016 
    2117class RenderTraverser 
  • GTP/trunk/App/Demos/Vis/CHC_revisited/Vector3.h

    r2752 r2753  
    4444        Vector3() { } 
    4545 
    46         Vector3(float x, float y, float z): 
    47         x(x), y(y), z(z) 
    48         { 
    49         } 
    50         Vector3(float v): 
    51         x(v), y(v), z(v) 
    52         { 
    53         } 
     46        Vector3(float x, float y, float z): x(x), y(y), z(z) 
     47        {} 
     48 
     49        Vector3(float v): x(v), y(v), z(v) 
     50        {} 
    5451        /** Copy constructor. 
    5552        */ 
  • GTP/trunk/App/Demos/Vis/CHC_revisited/chc_revisited.vcproj

    r2751 r2753  
    193193                        </File> 
    194194                        <File 
     195                                RelativePath=".\Camera.cpp" 
     196                                > 
     197                        </File> 
     198                        <File 
     199                                RelativePath=".\chcdemo.cpp" 
     200                                > 
     201                        </File> 
     202                        <File 
    195203                                RelativePath=".\Geometry.cpp" 
    196204                                > 
    197205                        </File> 
    198206                        <File 
    199                                 RelativePath=".\occquery.cpp" 
     207                                RelativePath=".\OcclusionQuery.cpp" 
    200208                                > 
    201209                        </File> 
     
    211219                        </File> 
    212220                        <File 
     221                                RelativePath=".\Camera.h" 
     222                                > 
     223                        </File> 
     224                        <File 
    213225                                RelativePath=".\Geometry.h" 
    214226                                > 
     
    216228                        <File 
    217229                                RelativePath=".\Material.h" 
     230                                > 
     231                        </File> 
     232                        <File 
     233                                RelativePath=".\OcclusionQuery.h" 
    218234                                > 
    219235                        </File> 
  • GTP/trunk/App/Demos/Vis/CHC_revisited/common.cpp

    r2751 r2753  
    177177} 
    178178 
    179 char * 
    180 TimeString() 
     179char *TimeString() 
    181180{ 
    182181        time_t t; 
    183182        time(&t); 
     183 
    184184        return ctime(&t); 
    185185} 
    186186 
    187 char * 
    188 GetAbsPath(char *name) 
     187 
     188char *GetAbsPath(char *name) 
    189189{ 
    190190        //  char *url = new char[strlen(name)+1]; 
     
    192192 
    193193        // get the absolute path 
    194         int c = strlen(name); 
    195         int i = c-1; 
     194        size_t c = strlen(name); 
     195        int i = c - 1; 
    196196        bool wasDot = false; 
     197 
    197198        // search for double dot 
    198         for (;i>=0;i--)  
    199                 if (name[i]=='.') { 
     199        for (; i >= 0; -- i)  
     200        { 
     201                if (name[i]=='.')  
     202                { 
    200203                        if (wasDot) 
    201204                                break; 
    202205                        wasDot = true; 
    203                 } else 
     206                }  
     207                else 
    204208                        wasDot = false; 
    205  
    206                 if (i>0) 
    207                         i+=3; 
    208                 if (i<0) 
    209                         i=0; 
    210  
    211                 char *url = new char[c-i+1]; 
    212                 int j=0; 
    213                 for (;i<c;i++,j++) 
    214                         url[j] = name[i]; 
    215                 url[j]=0; 
    216  
    217                 return url; 
     209        } 
     210 
     211        if (i>0) 
     212                i+=3; 
     213        if (i<0) 
     214                i=0; 
     215 
     216        char *url = new char[c-i+1]; 
     217 
     218        int j=0; 
     219 
     220        for (;i<c;i++,j++) 
     221                url[j] = name[i]; 
     222 
     223        url[j]=0; 
     224 
     225        return url; 
    218226} 
    219227 
     
    230238char *GetPath(const char *s) 
    231239{ 
    232         int i=strlen(s); 
    233         for (; i>0; i--) { 
     240        size_t i = strlen(s); 
     241        for (; i > 0; -- i)  
     242        { 
    234243                if (s[i]=='/' || s[i]=='\\') 
    235244                        break; 
  • GTP/trunk/App/Demos/Vis/CHC_revisited/common.h

    r2752 r2753  
    1414#include <limits.h> 
    1515#include <vector> 
     16#include <queue> 
     17 
    1618 
    1719 
     
    2224class BvhNode; 
    2325class BvhLeaf; 
     26class OcclusionQuery; 
    2427 
    2528 
     
    465468typedef std::vector<Triangle3> TriangleContainer; 
    466469 
    467  
    468 } 
    469  
    470 #endif 
    471  
    472  
    473  
    474  
    475  
    476  
    477  
    478  
     470typedef std::queue<OcclusionQuery *> QueryQueue; 
     471//typedef std::priority_queue<BvhNode *, vector<BvhNode *>, myless<vector<BvhNode *>::value_type> > TraversalQueue; 
     472 
     473} 
     474 
     475#endif 
     476 
     477 
     478 
     479 
     480 
     481 
     482 
     483 
Note: See TracChangeset for help on using the changeset viewer.