/* mouseExample.cpp is a simple example using mouse-clicks.
 * ...
 */
 
#include "CartesianSystem.h"
#include <sstream>
using namespace std;

void plotPoint(double x, double y, int column, int row, CartesianSystem& cs);

int main()
{
  CartesianSystem grid;
 
  cout << "\nClick the mouse 5 times in different places on the grid.\n";
  double x, y; int row, column;
  for (int i = 0; i < 5; i++)
  {
     grid.waitForMouseClick(x, y, column, row);
     plotPoint(x, y, column, row, grid);
  }
}

void plotPoint(double x, double y, int column, int row, CartesianSystem& cs)
{
  ostringstream sout;
  sout << setprecision(DEFAULT_PRECISION)
       << '(' << x << ',' << y << ") : ["
       << column << ',' << row << ']';
  cs.drawString(x, y, sout.str());
}