// drawFlags.cpp   A main program that uses the drawings.h library
//                 to draw flags
// P. Conrad   Fall 2004, CISC181


#include <iostream>
#include <fstream>
#include "drawings.h"
using namespace std;

int main(void)
{
  writeGnuplotFile("drawFlags.gnuplot", 
		   "drawFlags.dat",
		   "drawFlags.png",
		   20.0, 20.0);

  ofstream outfile("drawFlags.dat",ios::out); // an ofstream can also be used
                                              // as an ostream.
                                              // because of inheritance

  // "cout" is an example of something that is an ostream, but is not
  // an ofstream.    Every ofstream is also an ostream.  But the reverse
  // is not true.   ofstream is a "subclass" of ostream.

  if (!outfile)
    {
      cerr << "Couldn't open file; sorry!" << endl;
      exit(-1);
    }


  drawFlagPole(outfile,0,2,10);
  drawUSFlag(outfile,0,10,2);

  drawFlagPole(outfile,5,2,10);
  drawGermanFlag(outfile,5,10,2);

  drawFlagPole(outfile,10,2,10);
  // @@@ add call to drawFrenchFlag;


  drawFlagPole(outfile,15,2,10);
  drawTexasFlag(outfile,15,10,2);

  outfile.close();

  return 0;
  
}
