File: quad.h

package info (click to toggle)
ted 2.11-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 11,064 kB
  • ctags: 13,935
  • sloc: ansic: 120,446; makefile: 7,469; sh: 253
file content (34 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/************************************************************************/
/*  Quad Tree basic definitions.					*/
/************************************************************************/

typedef struct qn_s
    {
    int			qn_x;
    int			qn_y;
    struct qn_s *	qn_parent;
    struct qn_s *	qn_nw;
    struct qn_s *	qn_ne;
    struct qn_s *	qn_sw;
    struct qn_s *	qn_se;

    int			qn_nval;
    void **		qn_vals;
    } QuadNode;

typedef struct qt_s
    {
    QuadNode *		qt_root;
    int			qt_x0;
    int			qt_x1;
    int			qt_y0;
    int			qt_y1;
    } QuadTree;

extern QuadTree *	qtmake( int x0, int x1, int y0, int y1 );
extern int		qtput( QuadTree * qt, int x, int y, void * data );
extern int		qtget( QuadTree * qt, int x, int y,
				void ** pvals, int * pnval );
extern int		qtall( QuadTree * qt, int x0, int x1, int y0, int y1,
				int (*fun)( void *, void * ), void * );
extern void		qtclose( QuadTree * qt );