GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71806
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
25 #ifndef TREE_H
26 
27 #define TREE_H
28 
29 #define VOID_T char
30 
31 
32 /*!
33  * Function table for a tree
34  *
35  * From object oriented point of view, this structure represents
36  * a class or a virtual table of functions/methods for a class.
37  */
38 struct multfunc
39 {
40  int (*compare) ();
41  struct quaddata **(*divide_data) ();
42  int (*add_data) ();
43  int (*intersect) ();
45  int (*get_points) ();
46 };
47 
48 struct tree_info
49 {
51  double dmin;
52  int kmax;
53  struct multtree *root;
54 };
55 
56 struct multtree
57 {
58  struct quaddata *data;
59  struct multtree **leafs;
60  struct multtree *parent;
61  int multant;
62 };
63 
64 struct multfunc *MT_functions_new(int (*)(struct triple *, struct quaddata *),
65  struct quaddata **(*)(struct quaddata *,
66  int, double),
67  int (*)(struct triple *, struct quaddata *,
68  double), int (*)(struct quaddata *,
69  struct quaddata *),
70  int (*)(struct quaddata *, int),
71  int (*)(struct quaddata *,
72  struct quaddata *, int));
73 struct tree_info *MT_tree_info_new(struct multtree *, struct multfunc *,
74  double, int);
75 struct multtree *MT_tree_new(struct quaddata *, struct multtree **,
76  struct multtree *, int);
77 int MT_insert(struct triple *, struct tree_info *, struct multtree *, int);
78 int MT_divide(struct tree_info *, struct multtree *, int);
79 int MT_region_data(struct tree_info *, struct multtree *, struct quaddata *,
80  int, int);
81 
82 #endif
int(* intersect)()
Definition: qtree.h:43
struct tree_info * MT_tree_info_new(struct multtree *root, struct multfunc *functions, double dmin, int kmax)
Definition: qtree.c:57
int(* get_points)()
Definition: qtree.h:45
int(* compare)()
Definition: qtree.h:40
struct quaddata * data
Definition: qtree.h:58
double dmin
Definition: qtree.h:51
struct multfunc * MT_functions_new(int(*compare)(struct triple *, struct quaddata *), struct quaddata **(*divide_data)(struct quaddata *, int, double), int(*add_data)(struct triple *, struct quaddata *, double), int(*intersect)(struct quaddata *, struct quaddata *), int(*division_check)(struct quaddata *, int), int(*get_points)(struct quaddata *, struct quaddata *, int))
Definition: qtree.c:33
int(* add_data)()
Definition: qtree.h:42
struct multtree * MT_tree_new(struct quaddata *data, struct multtree **leafs, struct multtree *parent, int multant)
Definition: qtree.c:73
struct multfunc * functions
Definition: qtree.h:50
Definition: qtree.h:38
int kmax
Definition: qtree.h:52
int MT_region_data(struct tree_info *info, struct multtree *tree, struct quaddata *data, int MAX, int n_leafs)
Definition: qtree.c:194
int MT_insert(struct triple *point, struct tree_info *info, struct multtree *tree, int n_leafs)
Definition: qtree.c:105
Definition: qtree.h:56
struct multtree * parent
Definition: qtree.h:60
int
Reads the categories file for map name in mapset and stores the categories in the pcats structure...
struct multtree * root
Definition: qtree.h:53
int(* division_check)()
Definition: qtree.h:44
int MT_divide(struct tree_info *info, struct multtree *tree, int n_leafs)
Definition: qtree.c:158
struct multtree ** leafs
Definition: qtree.h:59
int multant
Definition: qtree.h:61