GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
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 * SPDX-FileCopyrightText: 1993-1996 Helena Mitasova
16 * SPDX-FileCopyrightText: GRASS Development Team
17 * SPDX-License-Identifier: GPL-2.0-or-later
18 */
19
20#ifndef TREE_H
21
22#define TREE_H
23
24#define VOID_T char
25
26/*!
27 * Function table for a tree
28 *
29 * From object oriented point of view, this structure represents
30 * a class or a virtual table of functions/methods for a class.
31 */
32struct multfunc {
33 int (*compare)(struct triple *, struct quaddata *);
34 struct quaddata **(*divide_data)(struct quaddata *, int, double);
35 int (*add_data)(struct triple *, struct quaddata *, double);
36 int (*intersect)(struct quaddata *, struct quaddata *);
38 int (*get_points)(struct quaddata *, struct quaddata *, int);
39};
40
41struct tree_info {
43 double dmin;
44 int kmax;
45 struct multtree *root;
46};
47
48struct multtree {
49 struct quaddata *data;
50 struct multtree **leafs;
53};
54
55struct multfunc *
56MT_functions_new(int (*)(struct triple *, struct quaddata *),
57 struct quaddata **(*)(struct quaddata *, int, double),
58 int (*)(struct triple *, struct quaddata *, double),
59 int (*)(struct quaddata *, struct quaddata *),
60 int (*)(struct quaddata *, int),
61 int (*)(struct quaddata *, struct quaddata *, int));
62struct tree_info *MT_tree_info_new(struct multtree *, struct multfunc *, double,
63 int);
64struct multtree *MT_tree_new(struct quaddata *, struct multtree **,
65 struct multtree *, int);
66int MT_insert(struct triple *, struct tree_info *, struct multtree *, int);
67int MT_divide(struct tree_info *, struct multtree *, int);
68int MT_region_data(struct tree_info *, struct multtree *, struct quaddata *,
69 int, int);
70
71#endif
struct tree_info * MT_tree_info_new(struct multtree *, struct multfunc *, double, int)
Definition qtree.c:51
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))
int MT_divide(struct tree_info *, struct multtree *, int)
Definition qtree.c:150
int MT_insert(struct triple *, struct tree_info *, struct multtree *, int)
Definition qtree.c:99
int MT_region_data(struct tree_info *, struct multtree *, struct quaddata *, int, int)
Definition qtree.c:182
struct multtree * MT_tree_new(struct quaddata *, struct multtree **, struct multtree *, int)
Definition qtree.c:68
int(* compare)(struct triple *, struct quaddata *)
Definition qtree.h:33
int(* division_check)(struct quaddata *, int)
Definition qtree.h:37
int(* get_points)(struct quaddata *, struct quaddata *, int)
Definition qtree.h:38
int(* add_data)(struct triple *, struct quaddata *, double)
Definition qtree.h:35
int(* intersect)(struct quaddata *, struct quaddata *)
Definition qtree.h:36
struct multtree ** leafs
Definition qtree.h:50
struct quaddata * data
Definition qtree.h:49
struct multtree * parent
Definition qtree.h:51
int multant
Definition qtree.h:52
struct multtree * root
Definition qtree.h:45
int kmax
Definition qtree.h:44
struct multfunc * functions
Definition qtree.h:42
double dmin
Definition qtree.h:43