%%  Wrapper function that assures the existence of a MATLAB workspace fea
%%  Object and then retrieves it and calls "isolineslice" with the first 
%%  argument as fea. This function is in file "isolineslice_.m".
%%  
%%  Usage: isolineslice_ (evalexpr, orthoplane, val, lvl, cmap, viewdim, addcolors)
%%      evalexpr:	the mathematical expression to be evaluated and plotted
%%                  such as 's_dc*sqrt(Vx^2+Vy^2+Vz^2)', current density A/m^2
%%      orthoplane:	'XY', 'YZ', or 'XZ' to denote orientation of slice plane
%%      val:        value of the invariant coordinate in the plane
%%                      (e.g., for 'XY', z is invariant) e.g., 0.5
%%      lvls:       the number of iso levels to plot on the plane, e.g., 20
%%      cmap:       the color map to be used (for both 3D and 2D plots)
%%                  e.g., 'jet'
%%      viewdim:    (==2 for 2D, ==3 for 3D; actually <3 for 2D & ~<3 for 3D)
%%      addcolors:  (==1) Add colored gradient contour bands.
%%
%%      Example:	isolineslice_('s_dc*sqrt(Vx^2+Vy^2+Vz^2)', 'XY', 0.0, 15, 'jet', 2, 1)
%%  Note:       Use single quotes,'sometext',(not double quotes "sometext")
%%              surrounding ascii/text/string/character data.
%%  See also:   "isolineslice.m".
%%

function isolineslice_ (evalexpr, orthoplane, val, lvls, ...
    cmap, viewdim, addcolors)

%  If fea does not exist in the base workspace, then export it from 
%  current FEATool session.

if( ~evalin('base','exist(''fea'',''var'')') )
    % disp( "Info: isolineslice.m, fea exported from current FEATool session");
	h_menu_item = findall( 0, 'Label', 'Export FEA Struct To MATLAB' );
	cbf = get( h_menu_item, 'Callback' );
	cbf{1}( h_menu_item, [], cbf{2:end} );
end

% Now fea is assured to exists in base workspace so retrieve it into 
% local_fea.
local_fea = evalin('base','fea');

isolineslice (local_fea, evalexpr, orthoplane, val, lvls, ...
    cmap, viewdim, addcolors);
