Getting Started

This page present a simple program that will show a map of the topological map of the Mississippi river. The text of the program can be found inside the MilleFeuille source tree under progs/primer/millefeuille_primer.cpp.
After making the program, and starting the muralserver, just type millefeuille_primer in the progs/primer directory to see the map on the screen.

#include <stdlib.h>
#include <iostream.h>
#include <stdio.h>
#include "MilleFeuilleToolkit.H"
#include "Feuilles/Image.H"

main(int argc, char **argv)
  Mural *m;
  utilInit( argc, argv, NULL);
Initialises the utilities library that provide system resources.
  muralInit(argc, argv);
Initialises the mural server library.
Initialises the MilleFeuille library.
  if ((muralConnect( &m, NULL )) != IWORK_OK)
      utilSimpleError( "Couldn't connect to the mural server!" );
Open a connection to the default mural. If the connection fails, bails out after printing an error message.
      CollagePtr background = MilleFeuilleToolkit::open_mural(m);
Create the root window for the hierarchy. open_mural also create a cursor that will track the motion of the mouse.
      Image mississippi("/n/radiance/mural/data/images/topomaps/Gorham.jpg");
Create an image Feuille using a picture of the Mississippi River at Gorham.
Set the initial position of the image at (0,0).
Resize the image to cover the full mural.
Add the image to the background.
Post a redisplay to show the changes on the screen.

Wait for the user to finish the program by pressing a key

  catch (Exception &exception)
  catch (...)
      cerr << "Unknown exception occured." << endl;
  return (0);