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

Comparing ray/src/common/octree.h (file contents):
Revision 2.2 by greg, Fri Sep 3 16:32:29 1993 UTC vs.
Revision 2.9 by schorsch, Fri Jun 6 16:38:47 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3   *  octree.h - header file for routines using octrees.
7 *
8 *     7/28/85
4   */
5 + #ifndef _RAD_OCTREE_H_
6 + #define _RAD_OCTREE_H_
7 + #ifdef __cplusplus
8 + extern "C" {
9 + #endif
10  
11 + #include "copyright.h"
12 +
13   /*
14   *      An octree is expressed as an integer which is either
15   *      an index to eight other nodes, the empty tree, or an index
# Line 31 | Line 33
33   #define  istree(ot)     ((ot) > EMPTY)
34  
35   #define  oseti(ot)      (-(ot)-2)       /* object set index */
36 < #define  octbi(ot)      ((ot)>>8)       /* octree block index */
37 < #define  octti(ot)      (((ot)&0377)<<3)/* octree index in block */
36 > #define  OCTBLKSIZ      04000           /* octree block size */
37 > #define  octbi(ot)      ((ot)>>11)      /* octree block index */
38 > #define  octti(ot)      (((ot)&03777)<<3)/* octree index in block */
39  
40   #ifndef  MAXOBLK
41 < #ifdef  BIGMEM
39 < #define  MAXOBLK        16383           /* maximum octree block */
40 < #else
41 > #ifdef  SMLMEM
42   #define  MAXOBLK        4095            /* maximum octree block */
43 + #else
44 + #define  MAXOBLK        32767           /* maximum octree block */
45   #endif
46   #endif
47  
# Line 46 | Line 49 | extern OCTREE  *octblock[MAXOBLK];     /* octree blocks */
49  
50   #define  octkid(ot,br)  (octblock[octbi(ot)][octti(ot)+br])
51  
49 extern OCTREE  octalloc(), combine(), fullnode();
50
52   /*
53   *      The cube structure is used to hold an octree and its cubic
54   *      boundaries.
# Line 82 | Line 83 | extern CUBE  thescene;                 /* the main scene */
83   #define  O_MISS         0               /* no intersection */
84   #define  O_HIT          1               /* intersection */
85   #define  O_IN           2               /* cube contained entirely */
86 +
87 +
88 + extern OCTREE   octalloc(void);
89 + extern void     octfree(OCTREE ot);
90 + extern void     octdone(void);
91 + extern OCTREE   combine(OCTREE ot);
92 + extern void     culocate(CUBE *cu, FVECT pt);
93 + extern void     cucopy(CUBE *cu1, CUBE *cu2);
94 + extern int      incube(CUBE *cu, FVECT pt);
95 +
96 + extern int      readoct(char *fname, int load, CUBE *scene, char *ofn[]);
97 +
98 + extern void     readscene(FILE *fp, int objsiz);
99 + extern void     writescene(int firstobj, int nobjs, FILE *fp);
100 +
101 +
102 + #ifdef __cplusplus
103 + }
104 + #endif
105 + #endif /* _RAD_OCTREE_H_ */
106 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines