%
%  Name: updtbars
% 
%  Usage: updtbars
% 
%   Description:
%	Updates the bar list from the 
%	interactive geometry function
%	'generategeom'
%

%  Version SWD960321
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally     %
% developed as part of "DIAMOND" at          %
% Los Alamos National Laboratory. It may     %
% be copied, modified, and distributed in    %
% any form, provided:                        %
%  a) This notice accompanies the files and  %
%     appears near the top of all source     %
%     code files.                            %
%  b) No payment or commercial services are  %
%     received in exchange for the code.     %
%                                            %
% Original copyright is reserved by the      %
% Regents of the University of California,   %
% in addition to Scott W. Doebling, Phillip  %
% J. Cornwell, Erik G. Straser, and Charles  %
% R. Farrar.                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%


ibar = str2num(get(hibar,'string'));
inode1 = str2num(get(hinode1,'string'));
inode2 = str2num(get(hinode2,'string'));

 if ibardel == 1,
     ibard = find(Bars(:,1) == ibar);
     if ~isempty(ibard),
       Bars(ibard,:) = [];
       disp(['Bar #',num2str(ibar),' deleted']);
     else
       disp(['Bar #',num2str(ibar),' not in list -- cannot delete']);
     end
     set(hbardel,'Value',0);
     ibardel=0;
  else
     Bars = addbars(Bars,ibar,inode1,inode2);
  end

return
