function slide=getcurv2
%GETCURV2 This is a slideshow file for use with playshow.m and makeshow.m
%   To see it run, type 'playshow getcurv2',

%   Copyright 1987-2000 by C. de Boor and The MathWorks, Inc. 
%   $Revision: 1.8 $

%  cb: updated slideshow version of GETCURVE

if nargout<1,
  playshow getcurv2
else
  %========== Slide 1 ==========

  slide(1).code={
   'w = [-1 1 -1 1]; axis(w), plot(w([1 2]),w([3 4]),''.k'',''linew'',.1)',
   'hold on, axis square, grid on',
   'maxpnts=100; xy = zeros(2,maxpnts);',
   'pts = line(''Xdata'',NaN,''Ydata'',NaN,''marker'',''o'',''erase'',''none'');'};
  slide(1).text={
   'Here''s your chance to design a curve, showing your profile, or an',
   'elaborate version of the first letter of your last name, or whatever.',
   ' ',
   'Using mouse clicks, you''ll be placing points into the gridded window above.',
   'The spline toolbox will draw a smooth curve through those points, in the order',
   'in which they are received.',
   '',
   'Push  Start>>  to get started.'};

  %========== Slide 2 ==========

  slide(2).code={
   'while 1',
   'for j=1:maxpnts',
   '   [x,y]=ginput(1);',
   '   if x<w(1)|x>w(2)|y<w(3)|y>w(4) break,end',
   '   xy(:,j) = [x;y];', 
   '   if j>1, set(pts,''Xdata'',xy(1,[j-1 j]),''Ydata'',xy(2,[j-1 j]))'
   '   else, set(pts,''Xdata'',x,''Ydata'',y), end, drawnow',
   'end, if j>1, break, end, end',
   'if norm(xy(:,1)-xy(:,j-1))<.05 xy(:,j-1)=xy(:,1); end',
   'set(pts,''Xdata'',NaN,''Ydata'',NaN)',
   'fnplt(cscvn(xy(:,1:j-1)),''r'',2)',
   'hold off' };
  slide(2).text={
   'In the window above, click on the point locations in the order in which you want',
   'the curve to pass through them. Repeated points become corners.',
   '',
   'Click at least once INSIDE the window. After that, a click anywhere OUTSIDE '
   'that window finishes the input, with the points stored in the array  xy .',
   '',
   'The curve is constructed by',
   '>> cv = cscvn(xy);',
   'and plotted by',
   '>> fnplt(cv,''r'',2)'};
end
