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.6 by greg, Sat Feb 22 02:07:25 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1998 Silicon Graphics, Inc. */
2 <
3 < /* SCCSid "$SunId$ SGI" */
4 <
1 > /* RCSid: $Id$ */
2   /*
3   *  sm_stree.h - header file for spherical quadtree code:
4   *            
# Line 21 | Line 18
18  
19   typedef struct _STREE {
20    QUADTREE   qt[2];  /* root[0]= top four faces, root[1]=bottom 4 faces*/
24  FVECT      center;   /* sphere center */
21  
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
22   }STREE;
23  
24  
# Line 44 | Line 31 | typedef struct _STREE {
31   #define ST_TOP_QT_PTR(s)     (&ST_TOP_QT(s)) /* ptr to top qt */
32   #define ST_BOTTOM_QT_PTR(s)  (&ST_BOTTOM_QT(s)) /* ptr to bottom qt*/
33  
34 <
34 > #define ST_NTH_V(s,n,w)        (stDefault_base[stBase_verts[n][w]])
35   #define ST_ROOT_QT(s,n)        QT_NTH_CHILD(ST_QT(s,n),ST_INDEX(n))
36  
37   #define ST_CLEAR_QT(st)      (ST_TOP_QT(st)=EMPTY,ST_BOTTOM_QT(st)=EMPTY)
38   #define ST_INIT_QT(st)      (QT_CLEAR_CHILDREN(ST_TOP_QT(st)), \
39                                  QT_CLEAR_CHILDREN(ST_BOTTOM_QT(st)))
40  
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))
41   #define ST_CLEAR_FLAGS(s)       qtClearAllFlags()
42  
43   /* Point location based on coordinate signs */
44   #define stLocate_root(p) (((p)[2]>0.0?0:4)|((p)[1]>0.0?0:2)|((p)[0]>0.0?0:1))
45 + #define stClear(st)    stInit(st)
46  
47   #define ST_CLIP_VERTS 16
48   /* STREE functions
# Line 88 | Line 53 | void stInit(STREE *st,FVECT  center)
53   STREE *stAlloc(STREE *st)
54           Allocates a stree structure  and creates octahedron base
55  
91 void stClear(STREE *st)
92         Frees any existing root children and clears roots
56          
57   QUADTREE stPoint_locate(STREE *st,FVECT p)
58           Returns quadtree leaf node containing point 'p'.
# Line 114 | Line 77 | int stApply_to_tri(STREE *st,FVECT t0,t1,t2,int (*edge
77   */
78  
79   extern int stBase_verts[8][3];
80 + extern FVECT stDefault_base[6];
81   extern STREE *stAlloc();
82   extern QUADTREE stPoint_locate();
83  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines