Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

make_single_node.C

Go to the documentation of this file.
00001 
00009 
00010 //   version 1:  Dec 1994   Piet Hut
00011 //               1998-11-25 Peter Teuben        fixed help
00012 
00013 
00014 #include "node.h"
00015 
00016 /*===========================================================================*/
00017 
00018 #ifdef TOOLBOX
00019 
00020 /*-----------------------------------------------------------------------------
00021  *  main  --  driver to create directly a single node
00022  *-----------------------------------------------------------------------------
00023  */
00024 main(int argc, char ** argv)
00025     {
00026     bool  c_flag = FALSE;
00027     bool  i_flag = FALSE;
00028     real m = 1;               // default mass: unity
00029     char  *comment;
00030 
00031     check_help();
00032 
00033     extern char *poptarg;
00034     int  c;
00035     char* param_string = "c:im:";
00036 
00037     while ((c = pgetopt(argc, argv, param_string)) != -1)
00038         switch(c)
00039             {
00040             case 'c': c_flag = TRUE;
00041                       comment = poptarg;
00042                       break;
00043             case 'i': i_flag = TRUE;
00044                       break;
00045             case 'm': m = atof(poptarg);
00046                       break;
00047             case '?': params_to_usage(cerr, argv[0], param_string);
00048                       get_help();
00049                       exit(1);
00050             }            
00051     
00052     node * root;
00053 
00054     root = new node();
00055     root->set_mass(m);
00056 
00057     if (c_flag == TRUE)
00058         root->log_comment(comment);
00059     root->log_history(argc, argv);
00060 
00061     if (i_flag)
00062         root->set_label(1);
00063 
00064     put_node(cout, *root);
00065     rmtree(root);
00066     }
00067 
00068 #endif
00069 
00070 /*===========================================================================*/
00071 
00072 /* endof: mk_single_node.C */
00073 

Generated at Sun Feb 24 09:57:08 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001