function ph = drawtree(d, level, axish, mu)
% function printtree(s)
%
% A simple method that shows the general structure of your tree
%
% Dr. A. I. Hanna (2007)
if nargin==1
    level = [];
    axish = gca;
    mu = getdata(getchild(d, level));
    mu = mu.mu;
end
hold(axish, 'on');
child = getchild(d, level);
q = {};
q{1} = child;
parent_handle = [];
uimenu_info = uicontextmenu('Parent', gcf);
uimenu(uimenu_info,'Label','Show Data','callback',{@shownode});
ph = [];
while ~isempty(q)

    node = q{1};
    q(1) = [];
    ph = cat(2, ph, drawnode(node, axish, uimenu_info));
    ph = cat(2, ph, drawEdge(node, 1, axish));
    ph = cat(2, ph, drawEdge(node, 2, axish));
    ph = cat(2, ph, drawEdge(node, 3, axish));
    ph = cat(2, ph, drawEdge(node, 4, axish));
    children = getchildren(node);
    for i=1:length(children)
        q{end+1} = children{i};
    end
end
%axis(axish, 'ij', 'vis3d');
%view(3);
return;
%%%
%
%%%
function shownode(node, evd)
node = get(gco, 'UserData');
data = getdata(node);
disp(data);
return