%% cal_height
%    calculates the height in number of cells of the current cell.
%    if the cell does not have a subgrid the height will be 1, else
%    it will be the height of the subgrid.
% inputs:
%   object:Cell - Current Cell Object
%   edit:boolean - 0 when not in edit mode, 1 in edit mode
% outputs;
%   h:double - height in number of cells
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function h = cal_height(object,edit)
h = 0;
if (isempty(object.subgrid))
    h = 1;
else
    for i=1:size(object.subgrid.cells,2)
        h = h + cal_height(object.subgrid.cells(i),edit);
    end
    % edit button is half a cell high, if in edit mode increase
    % by 0.5
    if (edit == 1)
        h = h + 0.5;
    end
    
end
end
