source: tags/initial/CAT/cat_tree.hxx

Last change on this file was 2, checked in by oldcode, 23 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1#ifndef cat_tree_hxx_included
2#define cat_tree_hxx_included
3
4#ifndef GB_INCLUDED
5struct GBDATA;
6#endif
7
8enum {                          // COLOR SCHEME (orable)
9        T2J_COLOR_UNKNOWN = 0,
10        T2J_COLOR_YES = 1,
11        T2J_COLOR_NO = 2,
12        T2J_COLOR_BOTH = 3
13};
14
15
16enum CAT_FIELDS {
17        CAT_FIELD_NAME,         // internal id
18        CAT_FIELD_FULL_NAME,    // fullname
19        CAT_FIELD_GROUP_NAME,   // name of internal nodes
20        CAT_FIELD_ACC,          // accession number
21        CAT_FIELD_STRAIN,       // first strain word
22        CAT_FIELD_MAX
23};
24
25#define CAT_INIT_STRING_FILE_SIZE 10000
26
27typedef enum {
28        CAT_TRUE = 1,
29        CAT_FALSE = 0
30}       CAT_BOOL;
31
32typedef long CAT_node_id;
33
34typedef enum {
35        CAT_NUMBERING_LEAFS_ONLY,
36        CAT_NUMBERING_LEVELS,
37        CAT_NUMBERING_MAX
38} CAT_NUMBERING;
39
40class CAT_node {
41        public:
42        CAT_node_id             father;         // == 0 if root
43        CAT_node_id             leftson;        // == 0 if leaf
44        CAT_node_id             rightson;
45        long            nleafs;                 // count all the leafs
46        long            numbering[CAT_NUMBERING_MAX];   // all leafes are numbered from left to right
47        long            deep;
48        unsigned char   color_in;               // imported from ARB
49        unsigned char   is_grouped_in;          // imported from ARB !!! 0 expanded  1 grouped
50        unsigned char   color; 
51        unsigned char   is_grouped;             // 0 expanded  1 grouped
52        unsigned char   branch_length_byte;
53        float           branch_length_float;
54        long            field_offsets[CAT_FIELD_MAX];   // offset in
55                                // CAT_tree->data
56        char            *user_data;
57};
58
59struct CAT_tree {
60
61        public:
62        /********* READ ONLY *************/
63        char    data[4];                        // array of strings, holds
64                                                // all the words
65        int nnodes;
66        CAT_node nodes[1];                      // array of nodes (note 1 is
67                                                // replaced by nnodes !!!
68                                                // data is organized as nlr
69};
70
71CAT_tree *new_CAT_tree(int size);
72
73
74inline CAT_tree *load_CAT_tree(const char *path){
75        return (CAT_tree *)GB_map_file(path,1);
76}
77
78typedef struct gbt_tree_struct  GBT_TREE;
79
80
81const char *create_and_save_CAT_tree(GBDATA *gb_main, const char *tree_name, const char *path);
82const char *create_and_save_CAT_tree(GBT_TREE *tree, const char *path);
83
84
85
86
87#endif
Note: See TracBrowser for help on using the repository browser.