GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
qtree.h
Go to the documentation of this file.
1 /*!
2  * \file qtree.c
3  *
4  * \author
5  * H. Mitasova, I. Kosinovsky, D. Gerdes, Fall 1993,
6  * University of Illinois and
7  * US Army Construction Engineering Research Lab
8  *
9  * \author H. Mitasova (University of Illinois),
10  * \author I. Kosinovsky, (USA-CERL)
11  * \author D.Gerdes (USA-CERL)
12  *
13  * \author updated/checked by Mitasova Nov. 96 (no changes necessary)
14  *
15  * \copyright
16  * (C) 1993-1996 by Helena Mitasova and the GRASS Development Team
17  *
18  * \copyright
19  * This program is free software under the
20  * GNU General Public License (>=v2).
21  * Read the file COPYING that comes with GRASS for details.
22  */
23 
24 #ifndef TREE_H
25 
26 #define TREE_H
27 
28 #define VOID_T char
29 
30 /*!
31  * Function table for a tree
32  *
33  * From object oriented point of view, this structure represents
34  * a class or a virtual table of functions/methods for a class.
35  */
36 struct multfunc {
37  int (*compare)(struct triple *, struct quaddata *);
38  struct quaddata **(*divide_data)(struct quaddata *, int, double);
39  int (*add_data)(struct triple *, struct quaddata *, double);
40  int (*intersect)(struct quaddata *, struct quaddata *);
41  int (*division_check)(struct quaddata *, int);
42  int (*get_points)(struct quaddata *, struct quaddata *, int);
43 };
44 
45 struct tree_info {
47  double dmin;
48  int kmax;
49  struct multtree *root;
50 };
51 
52 struct multtree {
53  struct quaddata *data;
54  struct multtree **leafs;
55  struct multtree *parent;
56  int multant;
57 };
58 
59 struct multfunc *
60 MT_functions_new(int (*)(struct triple *, struct quaddata *),
61  struct quaddata **(*)(struct quaddata *, int, double),
62  int (*)(struct triple *, struct quaddata *, double),
63  int (*)(struct quaddata *, struct quaddata *),
64  int (*)(struct quaddata *, int),
65  int (*)(struct quaddata *, struct quaddata *, int));
66 struct tree_info *MT_tree_info_new(struct multtree *, struct multfunc *, double,
67  int);
68 struct multtree *MT_tree_new(struct quaddata *, struct multtree **,
69  struct multtree *, int);
70 int MT_insert(struct triple *, struct tree_info *, struct multtree *, int);
71 int MT_divide(struct tree_info *, struct multtree *, int);
72 int MT_region_data(struct tree_info *, struct multtree *, struct quaddata *,
73  int, int);
74 
75 #endif
int MT_divide(struct tree_info *, struct multtree *, int)
Definition: qtree.c:154
struct tree_info * MT_tree_info_new(struct multtree *, struct multfunc *, double, int)
Definition: qtree.c:55
struct multfunc * MT_functions_new(int(*)(struct triple *, struct quaddata *), struct quaddata **(*)(struct quaddata *, int, double), int(*)(struct triple *, struct quaddata *, double), int(*)(struct quaddata *, struct quaddata *), int(*)(struct quaddata *, int), int(*)(struct quaddata *, struct quaddata *, int))
struct multtree * MT_tree_new(struct quaddata *, struct multtree **, struct multtree *, int)
Definition: qtree.c:72
int MT_insert(struct triple *, struct tree_info *, struct multtree *, int)
Definition: qtree.c:103
int MT_region_data(struct tree_info *, struct multtree *, struct quaddata *, int, int)
Definition: qtree.c:186
Definition: qtree.h:36
int(* compare)(struct triple *, struct quaddata *)
Definition: qtree.h:37
int(* division_check)(struct quaddata *, int)
Definition: qtree.h:41
int(* get_points)(struct quaddata *, struct quaddata *, int)
Definition: qtree.h:42
int(* add_data)(struct triple *, struct quaddata *, double)
Definition: qtree.h:39
int(* intersect)(struct quaddata *, struct quaddata *)
Definition: qtree.h:40
Definition: qtree.h:52
struct multtree ** leafs
Definition: qtree.h:54
struct quaddata * data
Definition: qtree.h:53
struct multtree * parent
Definition: qtree.h:55
int multant
Definition: qtree.h:56
struct multtree * root
Definition: qtree.h:49
int kmax
Definition: qtree.h:48
struct multfunc * functions
Definition: qtree.h:46
double dmin
Definition: qtree.h:47