%% deep_delete
%    deletes an entire grid as well as all the subgrids associated
%    with it.
% inputs:
%   object:Grid - current Grid object
% outputs:
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = deep_delete(object)
% loop through each cell and delete the associated result
% cells and call delete_Cell on each of the cells, which will
% then call deep_delete on its subgrids.
for i=size(object.cells,2):-1:1
    object.rGrid.delete_g2s(object.cells(i));
    object.cells(i).delete_Cell;
    %object.cells(i) = [];
end
delete(object.new_cell_pb);
delete(object.delete_cell_pb);
object.new_cell_pb = [];
object.delete_cell_pb = [];

end

