00001
00007
00008
00009
00010
00011 #include "dyn.h"
00012
00013 #ifdef TOOLBOX
00014
00015 local void freezebin(dyn * b, real fac)
00016 {
00017 for_all_daughters(dyn, b, bi)
00018 if (bi->is_parent()) bi->scale_vel(fac);
00019 }
00020
00021 main(int argc, char ** argv)
00022 {
00023 bool c_flag = FALSE;
00024 char *comment;
00025 real fac = 0;
00026
00027 check_help();
00028
00029 extern char *poptarg;
00030 int c;
00031 char* param_string = "c:f:";
00032
00033 while ((c = pgetopt(argc, argv, param_string)) != -1)
00034 switch(c) {
00035
00036 case 'c': c_flag = TRUE;
00037 comment = poptarg;
00038 break;
00039 case 'f': fac = atof(poptarg);
00040 break;
00041 case '?': params_to_usage(cerr, argv[0], param_string);
00042 get_help();
00043 exit(1);
00044 }
00045
00046 dyn *b;
00047
00048 while (b = get_dyn(cin)) {
00049 if (c_flag == TRUE)
00050 b->log_comment(comment);
00051 b->log_history(argc, argv);
00052
00053 freezebin(b, fac);
00054 put_dyn(cout, *b);
00055 rmtree(b);
00056 }
00057 }
00058
00059 #endif
00060
00061