%% delete_Cell
%    deletes the current cell, will recursively delete any subgrids
%    if they exist.
% inputs:
%   object:Cell - Current Cell Object
% outputs;
%   none
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [] = delete_Cell(object)
if(isempty(object.subgrid))
    delete(object.grid_pb);
    delete(object.cond);
    object.cond = [];
    object.grid_pb = [];
    %delete(object);
else
    % delete the subgrid
    object.subgrid.deep_delete;
    if(ishghandle(object.grid_pb))
        delete(object.grid_pb);
    end
    delete(object.cond);
    object.cond = [];
    object.grid_pb = [];
    %delete(object);
end
end

