function solution_test ( )

%*****************************************************************************80
%
%% solution_test() tests gpl_squares() on SOLUTION.GPL.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 July 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'SOLUTION_TEST:\n' );
  fprintf ( 1, '  Read a GPL file that describes a 3D surface using\n' );
  fprintf ( 1, '  quadrilateral patches, and display it.\n' );

  filename = 'solution.gpl';
%
%  Determine the number of rectangles, N.
%
  n = gpl_squares_count ( filename );
%
%  Get the (4,N) arrays X, Y and Z associated with the rectangles.
%
  [ x, y, z ] = gpl_squares ( filename, n );
%
%  Draw the surface as a collection of rectangles.
%
  clf

  patch ( x, y, z, z, 'FaceColor', 'interp', 'EdgeColor', 'None' );

  xlabel ( '<---X-->', 'Fontsize', 16 );
  ylabel ( '<---Y--->', 'Fontsize', 16 );
  zlabel ( '<---Z(X,Y)--->', 'Fontsize', 16 );
  grid on
  title ( filename, 'Fontsize', 24 )
  azimuth = -45.0;
  elevation = 45.0;
  view ( azimuth, elevation );

  png_filename = 'solution.png';
  print ( '-dpng', png_filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Saving PNG snapshot as "%s"\n', png_filename );

  return
end
