function t_tile_overlay_plot ( tile_w, tile_p, tile_c )

%*****************************************************************************80
%
%% t_tile_overlay_plot() overlays the image of a tile on a region plot.
%
%  Discussion:
%
%    A region has been plotted as a network of triangles, each outlined 
%    in black.
%
%    A tile is to be laid on the region, covering some of the triangles.
%
%    This function uses color to display the triangles corresponding
%    to this tile.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 March 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    character TILE_W, the boundary word for the tile.
%
%    integer TILE_P(1,2), the IJ coordinates of the base point.
%
%    integer TILE_C, an index that allows us to pick the color for this tile.
%
  node_number = false;
%
%  Retrieve the node coordinates.
%
  w_ij = node_ij ( tile_w, tile_p );

  wn = size ( w_ij, 1 );
%
%  Retrieve the indices of the nodes making up each triangle.
%
  [ tile_tri, tile_type, tile_xy ] = object_elements ( tile_w, tile_p );

% [ tk, tt, w2_ij ] = triangle_k ( w, p_ij );

  tile_tri_num = size ( tile_tri, 1 );

  hold ( 'on' );

  for ti = 1 : tile_tri_num

    a = tile_tri(ti,1);
    b = tile_tri(ti,2);
    c = tile_tri(ti,3);

    if ( a < 1 | b < 1 | c < 1 )
      fprintf ( 1, '\n' );
      fprintf ( 1, 't_tile_overlay_plot: Warning!\n' );
      fprintf ( 1, '  Illegal vertex indices in triangle %d\n', ti );
      fprintf ( 1, '  30=%d, 60=%d, 90=%d\n', a, b, c );
      continue;
    end

    x = [ tile_xy(a,1), tile_xy(b,1), tile_xy(c,1) ];
    y = [ tile_xy(a,2), tile_xy(b,2), tile_xy(c,2) ];
    rgb = t_color_rgb ( tile_c );
    fill ( x, y, rgb );

    if ( node_number )
      xc = ( tile_xy(a,1) + tile_xy(b,1) + tile_xy(c,1) ) / 3.0;
      yc = ( tile_xy(a,2) + tile_xy(b,2) + tile_xy(c,2) ) / 3.0;
      lc = sprintf ( '%d', ti );
      text ( xc, yc, lc, 'HorizontalAlignment', 'Center' );
    end

  end

  hold ( 'off' );

  grid ( 'on' );
  axis ( 'square' );

  return
end     

