00001 #ifndef HWTREE_H
00002 #define HWTREE_H
00003
00004 #include <hwWidget.h>
00005 #include <map>
00006 #include <vector>
00007
00008 using namespace std;
00009
00010 class hwTree : public hwWidget
00011 {
00012 public:
00013
00014 hwTree();
00015
00016 string draw();
00017
00018 void addNode(hwWidget* parent, hwWidget* child);
00019
00020 hwWidget* getNode(int node)
00021 {
00022 return myNodeLookup[node];
00023 }
00024
00025 private:
00026
00027 string drawNode(hwWidget* node, int& count, int level);
00028
00029 map<hwWidget*,vector<hwWidget*> > myNodes;
00030 map<int,hwWidget*> myNodeLookup;
00031 hwWidget* myRoot;
00032 };
00033
00034 #endif
00035