]> git.llucax.com Git - z.facultad/75.52/treemulator.git/blobdiff - viewer/view_btree.h
Mas linda la muestra RAW en la GUI.
[z.facultad/75.52/treemulator.git] / viewer / view_btree.h
index 8227609835b0ff2233398f2cc3432b63be937453..894bf5d03a49dd2c124436b97ad790166e79a738 100644 (file)
@@ -6,17 +6,22 @@
 #include <string>
 
 #include "btree.h"
 #include <string>
 
 #include "btree.h"
-
-#define NODE_WIDTH 500
-#define NODE_HEIGHT 50
+#include "view_node.h"
 
 using namespace Gnome;
 
 
 using namespace Gnome;
 
+class ViewNode;
+
 class ViewBTree : public Canvas::Group, public BTree {
        public:
 class ViewBTree : public Canvas::Group, public BTree {
        public:
-               ViewBTree (Canvas::Group *parent, std::string filename);
+               ViewBTree (Canvas::Group *parent, std::string filename, uint block_size, int tree_type, int type);
+
+               void Clear ();
+               void HighliteKey (Clave &k);
 
                static double byte_to_pixels;
 
                static double byte_to_pixels;
+               static double node_width;
+               static double node_height;
 
                typedef SigC::Signal2<void, BTreeData *, BTreeNodeHeader&> type_signal_selected;
                type_signal_selected signal_selected ();
 
                typedef SigC::Signal2<void, BTreeData *, BTreeNodeHeader&> type_signal_selected;
                type_signal_selected signal_selected ();
@@ -29,24 +34,12 @@ class ViewBTree : public Canvas::Group, public BTree {
                /* Un nodo que quiera ser puesto 2 veces es un bug :) */
                std::map<uint,bool> node_placed;
 
                /* Un nodo que quiera ser puesto 2 veces es un bug :) */
                std::map<uint,bool> node_placed;
 
-               void AddNode (uint num);
-               void on_item_selected (BTreeData *, uint);
-
-};
-
-class ViewNode : public Canvas::Group {
        public:
        public:
-               ViewNode (Canvas::Group *parent, uint num, BTreeNodeHeader &header, std::list<BTreeData *> &keys);
-
-               std::list<uint>& getChilds () { return hijos; } 
+               void AddNode (uint num, uint padre = 0);
+               void on_item_selected (BTreeData *, uint, ViewNode *);
+               void on_item_activated (BTreeData *, uint, ViewNode *);
 
 
-               typedef SigC::Signal2<void, BTreeData *, uint> type_signal_selected;
-               type_signal_selected signal_selected ();
-       private:
-               void on_item_clicked (BTreeData *data);
-               std::list<uint> hijos;
-               type_signal_selected m_signal_selected;
-               uint num;
+               ViewNode *last_selected;
 };
 
 #endif
 };
 
 #endif