home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1992-1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #include <Inventor/SoDB.h>
- #include <Inventor/SbString.h>
- #include <stdlib.h>
- #include "Simulation.h"
-
-
- int main(int argc, char *argv[])
- {
- if (argc < 3)
- {
- fprintf(stderr,
- "usage: %s roadfile carfile [-path datapath] [-robots num] [-quiet]\n", argv[0]);
- exit(0);
- }
-
- // initialize Inventor
- SoDB::init();
-
- Boolean quiet = FALSE;
- Boolean race = FALSE;
- int num_robots = 4;
- SbString path("/usr/demos/data/drive");
-
- if (argc >= 4)
- {
- SbString quiet_string("-quiet");
- // SbString race_string("-race");
- SbString robot_string("-robots");
- SbString path_string("-path");
-
- for (int i = 3; i < argc; i++)
- {
- if ((robot_string == argv[i]) && (i != (argc - 1)))
- num_robots = atoi(argv[i+1]);
- else if ((path_string == argv[i]) && (i != (argc - 1)))
- path = argv[i+1];
- else
- {
- quiet = quiet || (quiet_string == argv[i]);
- // race = race || (race_string == argv[i]);
- }
- }
- }
-
- SbString carfile(argv[1]);
- SbString roadfile(argv[2]);
-
-
- Simulation *simulation =
- new Simulation(carfile, roadfile, path, num_robots, quiet, race);
-
- simulation->go();
- delete simulation;
-
- printf("Bye!\n");
- return(0);
- }
-
-