Simple elements


#include "visual/Whiteboard.h"

#include "visual/Color.h"

#include "visual/Axes.h"

#include <iostream>

int main( int argc, char** argv )
{
 
  // create the whiteboard
  ns_whiteboard::whiteboard board;

  // create the output graphics file, and a stream to it
  string outFile = "tmp.ps";
  ofstream outStream(outFile.c_str());


  // set the boundaries for the display in pts
  double horizontalSizeOfDisplay = 200;

  double verticalSizeOfDisplay = 100;

  double border = 0; // no border

  // create the display
  ps_display postscriptDisplay(outStream, horizontalSizeOfDisplay, verticalSizeOfDisplay, border);

  // create a red line of width 2 from (0,0) to (200,100)
  line aLine(xy_coords(0,0), xy_coords(200,100), 2.0, red);

  // add the line to the whiteboard
  board.Add(aLine);

  // create the graphics file with the line
  board.DisplayOn(&postscriptDisplay);
  return 0;
}