]> git.llucax.com Git - z.facultad/75.52/treemulator.git/blob - viewer/view_btree.h
bd4f22cdcb53505aa2afc8d32608c900b13ed3b8
[z.facultad/75.52/treemulator.git] / viewer / view_btree.h
1
2 #ifndef _VIEW_BTREE_H_
3 #define _VIEW_BTREE_H_
4
5 #include <libgnomecanvasmm.h>
6 #include <string>
7
8 #include "btree.h"
9
10 #define NODE_WIDTH 500
11 #define NODE_HEIGHT 50
12
13 using namespace Gnome;
14
15 class ViewBTree : public Canvas::Group, public BTree {
16         public:
17                 ViewBTree (Canvas::Group *parent, std::string filename);
18
19                 static double byte_to_pixels;
20         protected:
21                 int max_level; /* Lo saco de la raiz */
22                 /* Posicion X por nivel */
23                 std::map<uint,double> pos_x;
24
25                 void AddNode (uint num);
26
27 };
28
29 class ViewNode : public Canvas::Group {
30         public:
31                 ViewNode (Canvas::Group *parent, uint num, BTreeNodeHeader &header, std::list<BTreeData *> &keys);
32
33                 std::list<uint>& getChilds () { return hijos; } 
34         private:
35                 std::list<uint> hijos;
36 };
37
38 #endif
39