%
%  Name: fastedit.m
% 
%  Usage: fastedit
% 
%  Description:
%    allows for faster imputing of geometry
%
%  Version PJC960421
%
%  Author(s): Phillip Cornwell, cornwell@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%		ESA-EA
%
%  Copyright (c) 1996, The Regents of the University
%     	of California. (See top level of code for
%

%
%  See if node information is available and put in text form
%
if exist('Nodes')==1,
    nodetext=num2txt(Nodes,1);
else,
    nodetext=[];
end;
if exist('Bars')==1,
    bartext=num2txt(Bars,2);
else,
    bartext=[];
end;


ffe=figure( ...
	'Name','DIAMOND: Fast Edit', ...
	'NumberTitle','off', ...
	'Units','normal', ...
	'Position',[0.6 0.125 0.4 0.66]);

%
% node information
%
uicontrol('style','text', ...
	'units','normal', ...
	'pos',[0 .95 .49 .05], ...
	'string','Nodes (No.,x,y,z)');

hnodefe=uicontrol('style','edit', ...
	'units','normal', ...
	'pos',[0 .1 .49 .85], ...
	'HorizontalAlignment','left',...
	'max',2, ...
	'string',nodetext);

%
%  Bar information
%

uicontrol('style','text', ...
	'units','normal', ...
	'pos',[.51 .95 .49 .05], ...
	'string','Bars (No.,node1,node2)');

hbarfe=uicontrol('style','edit', ...
	'units','normal', ...
	'pos',[.51 .1 .49 .85], ...
	'HorizontalAlignment','left',...
	'max',2, ...
	'string',bartext);

%
% update geometry button
%
  uicontrol('style','push', ...
	'units','normal', ...
	'pos',[.05 .01 .4 .05], ...
	'string','Update Geometry', ...
	'callback',['nodetext=get(hnodefe,''string'');', ...
		'bartext=get(hbarfe,''string'');', ...
		'Nodes=text2nums(Nodes,nodetext,1);', ...
		'Bars=text2nums(Bars,bartext,2);', ...
		'figure(fh);', ...
		'updtgeom(''-'',ibarlab,inodelab,Nodes,Bars,hageom);']);

%
% Close button
%
  uicontrol('style','push', ...
	'units','normal', ...
	'pos',[.55 .01 .4 .05], ...
	'string','Close', ...
	'callback','close(ffe)');
	
