ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/sm_stree.h
(Generate patch)

Comparing ray/src/hd/sm_stree.h (file contents):
Revision 3.4 by gwlarson, Mon Dec 28 18:07:36 1998 UTC vs.
Revision 3.5 by gwlarson, Thu Jun 10 15:22:24 1999 UTC

# Line 21 | Line 21
21  
22   typedef struct _STREE {
23    QUADTREE   qt[2];  /* root[0]= top four faces, root[1]=bottom 4 faces*/
24  FVECT      center;   /* sphere center */
24  
26  /* will go **************************************************/
27  FVECT      base[6];  /* 6 vertices on sphere that define base octahedron:
28                          in canonical form: origin(0,0,0) points (1,0,0),
29                          (0,1,0),(0,0,1),(-1,0,0),(0,-1,0),(0,0,-1) */
30  FPEQ      fplane[8];     /* Face plane equations */
31        
32  FVECT enorms[8][3];  /* Edge normals: For plane through edge and origin*/
33  /* gone ****************************************************************/
34
25   }STREE;
26  
27  
# Line 44 | Line 34 | typedef struct _STREE {
34   #define ST_TOP_QT_PTR(s)     (&ST_TOP_QT(s)) /* ptr to top qt */
35   #define ST_BOTTOM_QT_PTR(s)  (&ST_BOTTOM_QT(s)) /* ptr to bottom qt*/
36  
37 <
37 > #define ST_NTH_V(s,n,w)        (stDefault_base[stBase_verts[n][w]])
38   #define ST_ROOT_QT(s,n)        QT_NTH_CHILD(ST_QT(s,n),ST_INDEX(n))
39  
40   #define ST_CLEAR_QT(st)      (ST_TOP_QT(st)=EMPTY,ST_BOTTOM_QT(st)=EMPTY)
41   #define ST_INIT_QT(st)      (QT_CLEAR_CHILDREN(ST_TOP_QT(st)), \
42                                  QT_CLEAR_CHILDREN(ST_BOTTOM_QT(st)))
43  
54
55
56     /* Will go *****************************************************/
57 #define ST_BASE(s)             ((s)->base)
58 #define ST_NTH_BASE(s,n)       ((s)->base[(n)])
59 #define ST_NTH_V(s,n,i)        ST_NTH_BASE(s,stBase_verts[(n)][(i)])
60 #define ST_SET_NTH_BASE(s,n,b) VCOPY(ST_NTH_BASE(s,n),b)
61 #define ST_SET_BASE(s,b)       (VCOPY(ST_NTH_BASE(s,0),(b)[0]), \
62                                VCOPY(ST_NTH_BASE(s,1),(b)[1]), \
63                                VCOPY(ST_NTH_BASE(s,2),(b)[2]), \
64                                VCOPY(ST_NTH_BASE(s,3),(b)[3]), \
65                                VCOPY(ST_NTH_BASE(s,4),(b)[4]), \
66                                VCOPY(ST_NTH_BASE(s,5),(b)[5]))
67 #define ST_NTH_PLANE(s,i)        ((s)->fplane[(i)])
68 #define ST_NTH_NORM(s,i)         (ST_NTH_PLANE(s,i).n)
69 #define ST_NTH_D(s,i)            (ST_NTH_PLANE(s,i).d)
70 #define ST_EDGE_NORM(s,i,n)      ((s)->enorms[(i)][(n)])
71 /* gone *****************************************************/
72
73 #define ST_CENTER(s)           ((s)->center)
74 #define ST_SET_CENTER(s,b)     VCOPY(ST_CENTER(s),b)
75
76 #define ST_COORD(s,p,r)         VSUB(r,p,ST_CENTER(s))
44   #define ST_CLEAR_FLAGS(s)       qtClearAllFlags()
45  
46   /* Point location based on coordinate signs */
47   #define stLocate_root(p) (((p)[2]>0.0?0:4)|((p)[1]>0.0?0:2)|((p)[0]>0.0?0:1))
48 + #define stClear(st)    stInit(st)
49  
50   #define ST_CLIP_VERTS 16
51   /* STREE functions
# Line 88 | Line 56 | void stInit(STREE *st,FVECT  center)
56   STREE *stAlloc(STREE *st)
57           Allocates a stree structure  and creates octahedron base
58  
91 void stClear(STREE *st)
92         Frees any existing root children and clears roots
59          
60   QUADTREE stPoint_locate(STREE *st,FVECT p)
61           Returns quadtree leaf node containing point 'p'.
# Line 114 | Line 80 | int stApply_to_tri(STREE *st,FVECT t0,t1,t2,int (*edge
80   */
81  
82   extern int stBase_verts[8][3];
83 + extern FVECT stDefault_base[6];
84   extern STREE *stAlloc();
85   extern QUADTREE stPoint_locate();
86  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines