function handles = pdeicon(action)
%PDEICON Icon library for the PDE Toolbox.
%       Options
%       -------
%       plot
%       circle
%       deltaomega
%       ellipc
%       ellip
%       equal
%       eraser
%       littlezoom
%       pde
%       polygon
%       polyline
%       rect
%       rectc
%       triangle
%       triangle2
%       zoom
%

%       Steven L. Eddins, September 1994, AFP 11-1-94
%       Copyright 1994-2003 The MathWorks, Inc.
%       $Revision: 1.11.4.1 $  $Date: 2003/11/18 03:11:27 $

action = lower(action);

if (strcmp(action, 'plot'))

  xx = [0.4408    0.5256    0.6105    0.6954    0.7803    0.8651    0.9500
        0.3756    0.4605    0.5454    0.6303    0.7151    0.8000    0.8849
        0.3105    0.3954    0.4803    0.5651    0.6500    0.7349    0.8197
        0.2454    0.3303    0.4151    0.5000    0.5849    0.6697    0.7546
        0.1803    0.2651    0.3500    0.4349    0.5197    0.6046    0.6895
        0.1151    0.2000    0.2849    0.3697    0.4546    0.5395    0.6244
        0.0500    0.1349    0.2197    0.3046    0.3895    0.4744    0.5592];


  yy = [0.0500    0.0889    0.1830    0.2874    0.3277    0.2713    0.1836
        0.2217    0.3411    0.5152    0.6859    0.7424    0.6057    0.3570
        0.3070    0.4266    0.5933    0.8025    0.9500    0.8281    0.4991
        0.2851    0.3223    0.3595    0.3967    0.8882    0.8573    0.5445
        0.3336    0.3708    0.4080    0.4452    0.7647    0.7722    0.5258
        0.3821    0.4193    0.4565    0.4937    0.6837    0.6839    0.5174
        0.4306    0.4678    0.5050    0.5422    0.6497    0.6501    0.5641];


  zz = [0.2047    0.2696   0.3019   0.3281      0.3922    0.5134   0.6531
        0.2179    0.2352   0.2203   0.2074      0.2619    0.4304   0.6652
        0.2820    0.2992   0.2887   0.2530      0.2538    0.4137   0.6958
        0.4094    0.4753   0.5412   0.6071      0.4048    0.5109   0.7835
        0.4953    0.5612   0.6271   0.6930      0.5923    0.6757   0.9091
        0.5812    0.6471   0.7130   0.7789      0.7546    0.8423   1.0285
        0.6671    0.7330   0.7989   0.8648      0.8892    0.9768   1.1154];

  handles = surface('XData', xx,...
      'YData', yy,...
      'ZData', zz,...
      'CData',zz,...
      'FaceColor', 'none',...
      'EdgeColor', 'k');


elseif (strcmp(action, 'circle'))
  v = -.1:.1:2*pi;
  handles = line(.35*sin(v)+.5,.4*cos(v)+.5,'Color','k');


elseif (strcmp(action, 'deltaomega'))
  if strcmp(computer,'PCWIN')
    verticalalign = 'middle';
  else
    verticalalign = 'cap';
  end
  handles = text('String',char([182 87]),'Position',[.5 .5],'Color','k', ...
   'Horiz','center','Vertical',verticalalign,'FontUnits','pixels',...
   'FontName','Symbol','FontWeight','normal','FontSize',15);


elseif (strcmp(action, 'ellip'))

  w = 0:pi/32:2*pi;
  a = .4;
  b = .3;
  x = a*cos(w) + .5;
  y = b*sin(w) + .5;
  handles = line('XData',x,'YData',y,'ZData',ones(size(x)),'Color','k');

elseif (strcmp(action, 'ellipc'))

  w = 0:pi/32:2*pi;
  a = .4;
  b = .3;
  x = a*cos(w) + .5;
  y = b*sin(w) + .5;
  handles = [ ...
    line('XData',x,'YData',y,'ZData',ones(size(x)),'Color','k');
    line('XData',.5,'YData',.5,'ZData',1,'Color','k',...
        'LineStyle','none','Marker','+')];

elseif (strcmp(action, 'equal'))
  handles = [line([.3 .7],[.4 .4],'color','k','LineWidth',1.5) ; ...
             line([.3 .7],[.6 .6],'color','k','LineWidth',1.5)];

elseif (strcmp(action, 'eraser'))
  handles = line([.2 .5 .5 .2 .2 .5 .8 .8 .5 .5 .8], ...
                 [.3 .3 .2 .2 .3 .8 .8 .7 .2 .3 .8],'color','k');


elseif (strcmp(action, 'littlezoom'))

  xx = [0.4408    0.5256    0.6105    0.6954    0.7803    0.8651    0.9500
        0.3756    0.4605    0.5454    0.6303    0.7151    0.8000    0.8849
        0.3105    0.3954    0.4803    0.5651    0.6500    0.7349    0.8197
        0.2454    0.3303    0.4151    0.5000    0.5849    0.6697    0.7546
        0.1803    0.2651    0.3500    0.4349    0.5197    0.6046    0.6895
        0.1151    0.2000    0.2849    0.3697    0.4546    0.5395    0.6244
        0.0500    0.1349    0.2197    0.3046    0.3895    0.4744    0.5592];


  yy = [0.0500    0.0889    0.1830    0.2874    0.3277    0.2713    0.1836
        0.2217    0.3411    0.5152    0.6859    0.7424    0.6057    0.3570
        0.3070    0.4266    0.5933    0.8025    0.9500    0.8281    0.4991
        0.2851    0.3223    0.3595    0.3967    0.8882    0.8573    0.5445
        0.3336    0.3708    0.4080    0.4452    0.7647    0.7722    0.5258
        0.3821    0.4193    0.4565    0.4937    0.6837    0.6839    0.5174
        0.4306    0.4678    0.5050    0.5422    0.6497    0.6501    0.5641];


  zz = [-0.2047   -0.2696   -0.3019   -0.3281   -0.3922   -0.5134   -0.6531
        -0.2179   -0.2352   -0.2203   -0.2074   -0.2619   -0.4304   -0.6652
        -0.2820   -0.2992   -0.2887   -0.2530   -0.2538   -0.4137   -0.6958
        -0.4094   -0.4753   -0.5412   -0.6071   -0.4048   -0.5109   -0.7835
        -0.4953   -0.5612   -0.6271   -0.6930   -0.5923   -0.6757   -0.9091
        -0.5812   -0.6471   -0.7130   -0.7789   -0.7546   -0.8423   -1.0285
        -0.6671   -0.7330   -0.7989   -0.8648   -0.8892   -0.9768   -1.1154];

  xx = (xx - .5)*.5 + .5;
  yy = (yy - .5)*.5 + .5;

  handles = surface('XData', xx, 'YData', yy, 'ZData', zz, ...
    'FaceColor', 'none', 'EdgeColor', 'k');

elseif (strcmp(action, 'pde'))
  handles = text('String','PDE','Position',[.5 .44],'Color','k', ...
   'Horiz','center','Vertical','middle',...
   'FontUnits','pixels','FontSize',12,'FontWeight','normal');

elseif (strcmp(action, 'polygon'))

  x = [.5 .2 .6 .7 .3 .5];
  y = [.5 .8 .7 .4 .15 .5];
  z = [1 1 1 1 1 1];
  handles = line(x,y,z,'Color','k');

elseif (strcmp(action, 'polyline'))

  x = [.5 .2 .6 .7 .3];
  y = [.5 .8 .7 .4 .15];
  z = [1 1 1 1 1];
  handles = line(x,y,z,'Color','k');

elseif (strcmp(action, 'rect'))
  handles = line([.2 .8 .8 .2 .2], [.2 .2 .8 .8 .2], ...
    ones(1,5), 'Color', 'k') ;

elseif (strcmp(action, 'rectc'))
  handles = [line([.2 .8 .8 .2 .2], [.2 .2 .8 .8 .2], ...
    ones(1,5), 'Color', 'k') ;
    line(.5,.5,1,'LineStyle','none','Marker','+','Color','k')];

elseif (strcmp(action, 'triangle'))
   handles = line([.1 .9 .5 .1],[.2 .2 .9 .2],'Color','k');

elseif (strcmp(action, 'triangle2'))
   handles = [line([.1 .9 .5 .1],[.2 .2 .9 .2],'Color','k') ; ...
              line([.5 .3 .7 .5],[.2 .55 .55 .2],'Color','k')];

elseif (strcmp(action, 'zoom'))

  x1 = [ 0.0917    0.1250    0.1583    0.1917    0.2250    0.2917    0.3583, ...
      0.4250    0.4583    0.4917    0.5250    0.5250    0.5583    0.5917, ...
      0.6250    0.6583    0.6917    0.7250    0.7583    0.7917    0.8250, ...
      0.8917    0.9250    0.9250    0.8917    0.8583    0.8250    0.7917, ...
      0.7583    0.7250    0.6917    0.6583    0.6250    0.5583    0.5250, ...
      0.5583    0.5917    0.5917    0.5917    0.5917    0.5583    0.5250, ...
      0.4917    0.4583    0.4250    0.3583    0.2917    0.2250    0.1917, ...
      0.1583    0.1250    0.0917    0.0583    0.0583    0.0583    0.0583, ...
      0.0917    0.1250    0.1250    0.1250    0.1250    0.1583    0.1917, ...
      0.2250    0.2917    0.3583    0.4250    0.4583    0.4917    0.5250, ...
      0.5250    0.5250    0.5250    0.4917    0.4583    0.4250    0.3583, ...
      0.2917    0.2250    0.1917    0.1583    0.1583    0.1250];

  y1 = [0.5417    0.5083    0.4750    0.4417    0.4083    0.4083    0.4083, ...
      0.4083    0.4417    0.4750    0.4417    0.3750    0.3417    0.3083, ...
      0.2750    0.2417    0.2083    0.1750    0.1417    0.1083    0.0750, ...
      0.0750    0.1083    0.1750    0.2083    0.2417    0.2750    0.3083, ...
      0.3417    0.3750    0.4083    0.4417    0.4750    0.4750    0.5083, ...
      0.5417    0.5750    0.6417    0.7083    0.7750    0.8083    0.8417, ...
      0.8750    0.9083    0.9417    0.9417    0.9417    0.9417    0.9083, ...
      0.8750    0.8417    0.8083    0.7750    0.7083    0.6417    0.5750, ...
      0.5417    0.5750    0.6417    0.7083    0.7750    0.8083    0.8417, ...
      0.8750    0.8750    0.8750    0.8750    0.8417    0.8083    0.7750, ...
      0.7083    0.6417    0.5750    0.5417    0.5083    0.4750    0.4750, ...
      0.4750    0.4750    0.5083    0.5417    0.5417    0.5750];

  x2 = [0.2917    0.3583    0.3917    0.3917    0.3583    0.2917    0.2583, ...
          0.2583    0.2917];

  y2 = [0.6083    0.6083    0.6417    0.7083    0.7417    0.7417    0.7083, ...
          0.6417    0.6083];

  patch1 = patch('XData', x1, 'YData', y1, 'ZData', ones(size(x1)), ...
      'EdgeColor', 'none', 'FaceColor', 'k');

  patch2 = patch('XData', x2, 'YData', y2, 'ZData', ones(size(x2)), ...
      'EdgeColor', 'none', 'FaceColor', 'k');

  handles = [patch1 patch2]';

else
  handles = text('String','???','Position',[.5 .5],'Color','k', ...
   'FontUnits','pixels','Horiz','center','Vertical','middle');

end

% end btnicon
