home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xprism.zip / xprism / src / xprism3 / run_xprism3.c < prev    next >
C/C++ Source or Header  |  1992-09-30  |  21KB  |  672 lines

  1.  /*
  2.   * Khoros: $Id: run_xprism3.c,v 1.3 1992/03/20 22:41:45 dkhoros Exp $
  3.   */
  4.  
  5. #if !defined(lint) && !defined(SABER)
  6. static char rcsid[] = "Khoros: $Id: run_xprism3.c,v 1.3 1992/03/20 22:41:45 dkhoros Exp $";
  7. #endif
  8.  
  9.  /*
  10.   * $Log: run_xprism3.c,v $
  11.  * Revision 1.3  1992/03/20  22:41:45  dkhoros
  12.  * VirtualPatch5
  13.  *
  14.   */ 
  15.  
  16.  
  17. /*
  18.  *----------------------------------------------------------------------
  19.  *
  20.  * Copyright 1990, University of New Mexico.  All rights reserved.
  21.  *
  22.  * Permission to copy and modify this software and its documen-
  23.  * tation only for internal use in your organization is hereby
  24.  * granted, provided that this notice is retained thereon and
  25.  * on all copies.  UNM makes no representations as too the sui-
  26.  * tability and operability of this software for any purpose.
  27.  * It is provided "as is" without express or implied warranty.
  28.  * 
  29.  * UNM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  30.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
  31.  * NESS.  IN NO EVENT SHALL UNM BE LIABLE FOR ANY SPECIAL,
  32.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHAT-
  33.  * SOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  34.  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  35.  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PER-
  36.  * FORMANCE OF THIS SOFTWARE.
  37.  * 
  38.  * No other rights, including for example, the right to redis-
  39.  * tribute this software and its documentation or the right to
  40.  * prepare derivative works, are granted unless specifically
  41.  * provided in a separate license agreement.
  42.  *---------------------------------------------------------------------
  43.  */
  44.  
  45. #include "unmcopyright.h"     /* Copyright 1990 by UNM */
  46. #include "xprism3.h"
  47.  
  48.  
  49. /* >>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  50.    >>>>                                                       <<<<
  51.    >>>>        file name: run_xprism3.c
  52.    >>>>               
  53.    >>>>   description: drives the plot subform 
  54.    >>>>              
  55.    >>>>      routines:
  56.    >>>>            run_xprism_3D
  57.    >>>>            run_environment
  58.    >>>>            run_input_file
  59.    >>>>            run_perspective
  60.    >>>>            run_transforms
  61.    >>>>              
  62.    >>>> modifications:
  63.    >>>>                                                       <<<<
  64.    >>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
  65.  
  66.  
  67. #define MAXNAMELENGTH 30
  68.  
  69.  
  70. /************************************************************
  71. *
  72. *  MODULE NAME: run_xprism_3D
  73. *
  74. *      PURPOSE: Drives the Xprism form -- 
  75. *        Called after the user clicks on an "Xprism" action
  76. *        button.
  77. *        
  78. *
  79. *       OUTPUT: none
  80. *
  81. *    CALLED BY: run_master
  82. *
  83. *   WRITTEN BY: Mark Young, & Mike Lang, Tom Sauer
  84. *
  85. *
  86. *************************************************************/
  87.  
  88. run_xprism_3D(form, xprism_info, marker_type, line_type, whichband, 
  89.           cmplx, update)
  90.  
  91. xvf_form    *form;
  92. Master_xprism   *xprism_info;
  93. int             marker_type, line_type, whichband, cmplx;
  94. float         update;
  95. {
  96.     /*
  97.      * get the form information structure indicating
  98.      * selections & and input provided by the user
  99.      */
  100.  
  101.     _xvf_get_xprism(form, xprism_info);
  102.  
  103.     if (xprism_info->quit)
  104.        xvf_change_active(form, false);
  105.  
  106.  
  107.     /*
  108.      * action came from the 'input_file' pane
  109.      */
  110.     else if (xprism_info->input_file_selected)
  111.         run_input_file(form, xprism_info->input_file, 
  112.                marker_type,line_type,whichband,cmplx,update);
  113.  
  114.     /*
  115.      * action came from the 'input_function' pane
  116.      */
  117.     else if (xprism_info->input_function_selected)
  118.         run_input_function(form, xprism_info->input_function,
  119.                 marker_type, line_type);
  120.  
  121.     /*
  122.      * action came from the 'transforms' pane
  123.      */
  124.     else if (xprism_info->transforms_selected)
  125.         run_transforms(form, xprism_info->transforms);
  126.  
  127.     /*
  128.      * action came from the 'environment' pane
  129.      */
  130.     else if (xprism_info->environment_selected)
  131.         run_environment(form, xprism_info->environment);
  132.  
  133.     XSync(display, FALSE);
  134. }
  135.  
  136.  
  137.  
  138. /************************************************************
  139. *
  140. *  MODULE NAME: run_environment
  141. *
  142. *      PURPOSE: Drives the Environment pane of the Xprism form -- 
  143. *        Called after the user clicks on "Set Environment",
  144. *        it sets the Global Input Directory (global_indir)
  145. *        and the Global Output Directory (global_outdir)
  146. *        which have been previously set by the user on the
  147. *        Environment pane, and passed back by xvforms
  148. *        in the "form.environment" structure 
  149. *        
  150. *       INPUT:  form - pointer to the form tree
  151. *               environ_info - pointer to the Environment Pane
  152. *                               information structure
  153. *
  154. *       OUTPUT: none
  155. *
  156. *    CALLED BY: Main
  157. *
  158. *   WRITTEN BY: Danielle Argiro, Mark Young, & Mike Lang
  159. *
  160. *
  161. *************************************************************/
  162.  
  163.  
  164. run_environment(form, environ_info)
  165.  
  166. xvf_form             *form;
  167. xprism_environment *environ_info;
  168. {
  169.     _xvf_get_environment(form, environ_info);
  170.  
  171.     if (global_indir != NULL)
  172.        free(global_indir);
  173.     global_indir = xvf_strcpy(environ_info->input_path);
  174.  
  175.     if (global_outdir != NULL)
  176.        free(global_outdir);
  177.     global_outdir = xvf_strcpy(environ_info->output_path);
  178.  
  179.     XVF_FILE_DIR = environ_info->input_path; 
  180. }
  181.  
  182.  
  183.  
  184. /************************************************************
  185. *
  186. *  MODULE NAME: run_input_file
  187. *
  188. *
  189. *      PURPOSE: Drives the Input pane of the Xprism form -- 
  190. *        Called after the user clicks on "Plot",
  191. *        It first determines which type of plot is desired
  192. *        according to the plot type; then, according to whether 
  193. *        the user has selected "Input Type" as a file,
  194. *        it reads the file in order to
  195. *        create the appropriate plot structure.  It then plots
  196. *        the information provided, alone in a graphics workspace
  197. *        if this was the first operation, or on top of the other
  198. *        plots already there if it was not.
  199. *
  200. *       INPUT:  form - pointer to the form tree
  201. *               input_info - pointer to the Input Pane information structure
  202. *
  203. *
  204. *       OUTPUT: A new plot displayed in the graphics workspace
  205. *
  206. *    CALLED BY: main
  207. *
  208. *   WRITTEN BY: Danielle Argiro and Mark Young
  209. *
  210. *
  211. *************************************************************/
  212.  
  213. run_input_file(form, input_file_info, marker_type, line_type, 
  214.            whichband, cmplx, update)
  215.  
  216. xvf_form        *form;
  217. xprism_input_file    *input_file_info;
  218. int             marker_type, line_type, whichband, cmplx;
  219. float        update;
  220. {
  221.         XPlot *plot, *get_input_file();
  222.         int  plot_type, get_file_type();
  223.         XawListReturnStruct *machine_list_return;
  224.         char *prompt1 = "Pick Input Raw Data Machine Type";
  225.         char *label1 = "Machine Type List";
  226.         char *mach_name, **machine_list, *mesg;
  227.         int col_num = 1, current, machorder();
  228.         int i, nc, nr, machine_type_index;
  229.         int machine_type, data_type, data_format;
  230.     int begin_point_x, begin_point_y, end_point_x, end_point_y;
  231.         int step_size_x, step_size_y;
  232.  
  233.     _xvf_get_input_file(form, input_file_info);
  234.  
  235.     /*
  236.      *  toggles start at 1, plot PLOT_3D starts at 1
  237.      */
  238.  
  239.     plot_type = input_file_info->change_plot_type_val;
  240.  
  241.     /*
  242.          *   Change the Plot Type plot(s) currently displayed in the window
  243.          */
  244.         switch(input_file_info->data_type_val)
  245.         {
  246.            case 1:  /* BYTE */
  247.               data_type = VFF_TYP_1_BYTE;
  248.               break;
  249.            case 2:  /* BYTE */
  250.               data_type = VFF_TYP_2_BYTE;
  251.               break;
  252.            case 3:  /* BYTE */
  253.               data_type = VFF_TYP_4_BYTE;
  254.               break;
  255.            case 4:  /* BYTE */
  256.               data_type = VFF_TYP_FLOAT;
  257.               break;
  258.           default:
  259.               xvf_error_wait("An unknown data type has been encountered.  Please select a valid data type", "run_input_file", NULL);
  260.               break;
  261.         }
  262.  
  263.         step_size_x = input_file_info->step_size_x;
  264.         begin_point_x = input_file_info->begin_point_x;
  265.         end_point_x = input_file_info->end_point_x;
  266.         step_size_y = input_file_info->step_size_y;
  267.         begin_point_y = input_file_info->begin_point_y;
  268.         end_point_y = input_file_info->end_point_y;
  269.  
  270.         switch(input_file_info->data_format_val)
  271.         {
  272.            case 1:
  273.               data_format = XYZ_TRIPLES;
  274.               break;
  275.            case 2:
  276.               data_format = Z_ONLY;
  277.               break;
  278.            default:
  279.               xvf_error_wait("An unknown data format has been encountered.  Please select a valid data format", "run_io_input", NULL);
  280.               break;
  281.         }
  282.  
  283.         /*
  284.          * user clicked on pane action button 'machine_type'
  285.          */
  286.  
  287.          /* since we do not save the machine type */
  288.  
  289.         if (input_file_info->machine_type)
  290.         {
  291.         machine_list = getmachlist(&i);
  292.  
  293.             machine_list_return = xvf_run_list_wait(machine_list,
  294.                                                     i-1,
  295.                                                     col_num, prompt1,
  296.                                                     label1, ¤t, False);
  297.             if (machine_list_return == NULL) return;
  298.  
  299.             mach_name = VStrcpy(machine_list_return->string);
  300.  
  301.             machine_type = machorder(mach_name);
  302.         machine_type_index = find_machtype_index(mach_name);
  303.  
  304.             xvf_change_input(form, input_file_info->machine_type_index+1,
  305.                                 xvf_title_chng, mach_name, MAXNAMELENGTH);
  306.  
  307.             if (machine_type == 255)
  308.             {
  309.                 xvf_error_wait("An unknown machine type has been encountered. Please select a valid machine type", "run_input_file", NULL);
  310.                gwin_attr->machine_type_index = machine_type_index;
  311.                return;
  312.             }
  313.             gwin_attr->machine_type_index = machine_type_index;
  314.             return;
  315.         }
  316.  
  317.     /*
  318.          *   Input a new plot from a file
  319.          */
  320.  
  321.     else if (input_file_info->plot_file)
  322.     {
  323.             plot = get_input_file(input_file_info->filename, plot_type,
  324.                                   data_format, gwin_attr->machine_type_index, 
  325.                      data_type, -1, whichband, cmplx);
  326.  
  327.     }  
  328.  
  329.     /* 
  330.      *  Create the graphics workspace if necessary, or add the
  331.      *  plot to the already-existent workspace 
  332.      */
  333.  
  334.     if (plot == NULL)
  335.        return;
  336.  
  337.         nc = plot->row_size;
  338.         nr = plot->size/plot->row_size;
  339.  
  340.         if (end_point_x > nc            ||
  341.             begin_point_x > nc          ||
  342.             step_size_x > nc            ||
  343.             (end_point_x <  begin_point_x         &&
  344.              end_point_x > 0 && begin_point_x >0) ||
  345.             step_size_x == 0.0            ||
  346.             end_point_y > nr            ||
  347.             begin_point_y > nr          ||
  348.             step_size_y > nr            ||
  349.             (end_point_y <  begin_point_y         &&
  350.              end_point_y > 0 && begin_point_y >0) ||
  351.             step_size_y == 0.0)
  352.         {
  353.              freeplot(plot);
  354.              mesg = xvf_strcpy("The Begin point, End point or Step Size was specified incorrectly.\n\nPlease check the Begin point, End point and Step Size, and Plot Data again");
  355.                 xvf_error_wait(mesg, "run_input_file", NULL);
  356.                 free(mesg);
  357.         return;
  358.     }
  359.  
  360.         if (gwin == NULL)
  361.     {
  362.             gwin = create_new_gwin(plot, plot_type, marker_type, line_type,
  363.                    step_size_x, begin_point_x, end_point_x, 0,
  364.                    step_size_y, begin_point_y, end_point_y, NULL, 1);
  365.     }
  366.         else
  367.     {
  368.             assign_plot_to_gwin(plot, plot_type, marker_type, line_type,
  369.                    step_size_x, begin_point_x, end_point_x, 0,
  370.                    step_size_y, begin_point_y, end_point_y, NULL, 1);
  371.  
  372. /* CLIPPING: remove comment when clipping has been done
  373.  
  374.             mesg = xvf_strcpy("Do you want to RESET the Min/Max of the Plot Area to the New Plot's min/max?");
  375.             if (xvf_warn_wait(mesg, "RESET AXES", "YES","NO"))
  376.             {
  377.             gwin->num_tics.x = 3;
  378.                 gwin->num_tics.y = 3;
  379.                 gwin->num_tics.z = 4;
  380.                 set_world_coordinates(plot->WCmin, plot->WCmax, gwin->num_tics);
  381.             }
  382.             free(mesg);
  383. CLIPPING: remove comment when clipping has been done */
  384.  
  385. /* CLIPPING: remove the following 2 lines when clipping is done */
  386.        find_wc_min_max();
  387.            reset_world_coordinates();
  388.     }
  389.  
  390.         if (update != 0.0)
  391.     {
  392.         for (i = 0; i < MAX_PLOTS; i++)
  393.            if (update_id[i] == 0) break;
  394.             update_id[i] = xvp_detect_file(plot->filename,
  395.                     update, update_file, NULL);
  396.         plot->update_id = update_id[i];
  397.     }
  398.         else
  399.     {
  400.         plot->update_id = 0;
  401.     }
  402.  
  403.     plot_routine();
  404.  
  405.     return;
  406.  
  407. } /* end run_input */
  408.  
  409.  
  410.  
  411. /********************************************************
  412. *
  413. *  Routine Name:  run_input_function
  414. *
  415. *       Purpose:  drives the pane 'input_function'
  416. *
  417. *         Input:  form - pointer to the form tree 
  418. *          input_function_info  - information structure for pane 'input_function'
  419. *        Output:  action of the application program
  420. *
  421. *     Called By:  run_xprism()
  422. *
  423. *     WRITTEN BY: Danielle Argiro, Mark Young, Tom Sauer
  424. *
  425. ********************************************************/
  426.  
  427.  
  428. run_input_function(form, input_function_info, marker_type, line_type)
  429.  
  430. xvf_form        *form;
  431. xprism_input_function    *input_function_info;
  432. int             marker_type, line_type;
  433. {
  434.     XPlot *plot, *get_function();
  435.     int  plot_type;
  436.     char *function, *mesg, *x_range, *y_range, error[1024];
  437.     char temp[2048];
  438.     int begin_point_x, end_point_x, begin_point_y, end_point_y;
  439.         int step_size_x, step_size_y, nc,nr;
  440.  
  441.     
  442.     _xvf_get_input_function(form, input_function_info);
  443.  
  444.     /*
  445.      *  toggles start at 1, plot PLOT_3D starts at 1
  446.      */
  447.  
  448.     plot_type = input_function_info->change_plot_type_val;
  449.  
  450.         step_size_x = input_function_info->step_size_x;
  451.         step_size_y = input_function_info->step_size_y;
  452.         begin_point_x = input_function_info->begin_point_x;
  453.         begin_point_y = input_function_info->begin_point_y;
  454.         end_point_x = input_function_info->end_point_x;
  455.         end_point_y = input_function_info->end_point_y;
  456.  
  457.         if (input_function_info->plot_function)
  458.         {
  459.         if (gwin != NULL)
  460.         {
  461.             if (gwin->plotnum > 19)
  462.             {
  463.             mesg = xvf_strcpy("Sorry... we only allow 20 plots in the workspace\n");
  464.             xvf_error_wait(mesg, "run_input_function", NULL);
  465.                     free(mesg);
  466.             return;
  467.             }
  468.         }
  469.         sprintf(temp,"f(x,y) = %s",input_function_info->function);
  470.         function = xvf_strcpy(temp);
  471.         sprintf(temp,"x = (%s,%s,%s)",
  472.                     input_function_info->x_min,input_function_info->x_max,
  473.             input_function_info->xnum_pts);
  474.         x_range = xvf_strcpy(temp);
  475.         sprintf(temp,"y = (%s,%s,%s)",
  476.                     input_function_info->y_min,input_function_info->y_max,
  477.             input_function_info->ynum_pts);
  478.         y_range = xvf_strcpy(temp);
  479.  
  480.         plot = get_function(plot_type, function, x_range, y_range, error);
  481.     }
  482.  
  483.     /* 
  484.      *  Create the graphics workspace if necessary, or add the
  485.      *  plot to the already-existent workspace 
  486.      */
  487.  
  488.     if (plot == NULL)
  489.     {
  490.        xvf_error_wait(error, "run_input_function", NULL);
  491.        return;
  492.     }
  493.  
  494.         nc = plot->row_size;
  495.         nr = plot->size/plot->row_size;
  496.  
  497.     if (((nc == 1) || (nr == 1)) && 
  498.        (plot->plot_type != PLOT_3D && 
  499.         plot->plot_type != PLOT_SCATTER &&
  500.         plot->plot_type != PLOT_IMPULSE))
  501.     {
  502.          xvf_error_wait(
  503.               "start_cmd_plot_3D: Warning, This plot requires at least 2 rows and columns\nfor specified plot type. Resetting plot type to 3D\n",
  504.            "run_input_function", NULL);
  505.         plot_type =
  506.         plot->plot_type = PLOT_3D;
  507.         }
  508.  
  509.         if (end_point_x > nc            ||
  510.             begin_point_x > nc          ||
  511.             step_size_x > nc            ||
  512.             (end_point_x <  begin_point_x         &&
  513.              end_point_x > 0 && begin_point_x >0) ||
  514.             step_size_x == 0.0            ||
  515.             end_point_y > nr            ||
  516.             begin_point_y > nr          ||
  517.             step_size_y > nr            ||
  518.             (end_point_y <  begin_point_y         &&
  519.              end_point_y > 0 && begin_point_y >0) ||
  520.             step_size_y == 0.0)
  521.         {
  522.              freeplot(plot);
  523.              mesg = xvf_strcpy("The Begin point, End point or Step Size was specified incorrectly.\n\nPlease check the Begin point, End point and Step Size, and Plot Data again");
  524.                 xvf_error_wait(mesg, "run_input_function", NULL);
  525.                 free(mesg);
  526.         return;
  527.     }
  528.  
  529.         if (gwin == NULL)
  530.     {
  531.             gwin = create_new_gwin(plot, plot_type, marker_type, line_type,
  532.                    step_size_x, begin_point_x, end_point_x, 0,
  533.                    step_size_y, begin_point_y, end_point_y, NULL, 1);
  534.     }
  535.         else
  536.     {
  537.             assign_plot_to_gwin(plot, plot_type, marker_type, line_type,
  538.                    step_size_x, begin_point_x, end_point_x, 0,
  539.                    step_size_y, begin_point_y, end_point_y, NULL, 1);
  540.  
  541. /* CLIPPING: remove comment when clipping has been done
  542.  
  543.             mesg = xvf_strcpy("Do you want to RESET the Min/Max of the Plot Area to The New Plot's min/max?");
  544.             if (xvf_warn_wait(mesg, "RESET AXES", "YES","NO"))
  545.             {
  546.             gwin->num_tics.x = 3;
  547.                 gwin->num_tics.y = 3;
  548.                 gwin->num_tics.z = 4;
  549.                 set_world_coordinates(plot->WCmin, plot->WCmax, gwin->num_tics);
  550.             }
  551.             free(mesg);
  552. CLIPPING: remove comment when clipping has been done */
  553.  
  554. /* remove the following 2 lines when clipping is done */
  555.        find_wc_min_max();
  556.            reset_world_coordinates();
  557.     }
  558.  
  559.     plot_routine ();
  560.     return;
  561.  
  562. } /* end run_input */
  563.  
  564.  
  565.  
  566. /************************************************************
  567. *
  568. *  MODULE NAME: run_transforms
  569. *
  570. *
  571. *      PURPOSE: Drives the Transforms pane of the Xprism form -- 
  572. *        Called after the user clicks on "Transform Plot(s)",
  573. *        It rotates, scales, translates, according to which
  574. *        options are activated.  It then redisplays the plot(s).
  575. *
  576. *       OUTPUT: A new plot displayed in the graphics workspace
  577. *
  578. *    CALLED BY: main
  579. *
  580. *   WRITTEN BY: Danielle Argiro and Mark Young
  581. *
  582. *
  583. *************************************************************/
  584.  
  585. run_transforms(form, transform_info)
  586.  
  587. xvf_form            *form;
  588. xprism_transforms   *transform_info;
  589. {
  590.     char *mesg;
  591.     float xval, yval, zval;
  592.     int   trans_type;
  593.     XPlot *plot;
  594.  
  595.     _xvf_get_transforms(form, transform_info);
  596.  
  597.     if (gwin == NULL)
  598.     {
  599.        mesg = xvf_strcpy("\nCannot do transforms unless plot(s) are displayed!\n");
  600.        xvf_error_wait(mesg, "run_transforms", NULL);
  601.        free(mesg);
  602.        return;
  603.     }
  604.  
  605.     if (transform_info->transform_plots)
  606.     {
  607.             xval = transform_info->x_val;
  608.             yval = transform_info->y_val;
  609.             zval = transform_info->z_val;
  610.             trans_type = transform_info->trans_type_val;
  611.             
  612.             /* rotate */
  613.             if (trans_type == ROTATE)
  614.             {
  615.                 if ((xval > 360) || (yval > 360) || (zval > 360))
  616.                 {
  617.                    mesg = xvf_strcpy("Can't rotate by more than 360 degrees");
  618.                     xvf_error_wait(mesg, "run_transforms", NULL);
  619.                     free(mesg);
  620.                     return;
  621.                 }
  622.                 if ((xval < -360) || (yval < -360) || (zval < -360))
  623.                 {
  624.                   mesg = xvf_strcpy("Can't rotate by less than -360 degrees");
  625.                     xvf_error_wait(mesg, "run_transforms", NULL);
  626.                     free(mesg);
  627.                     return;
  628.                 }
  629.  
  630.                 plot = get_a_plot("Select a plot to rotate" , "Rotate Plot",
  631.                             APPEND_PLOT_TYPE);
  632.         if (plot == NULL) return;
  633.                 rotate_3D(xval, yval, zval, plot);
  634.             }
  635.             
  636.                 
  637.             /* scale */
  638.             else if (trans_type == SCALE)
  639.             {
  640.                 if ((xval == 0) || (yval == 0) || (zval == 0))
  641.                 {
  642.                     mesg = xvf_strcpy("Can't scale by 0 \n");
  643.                     xvf_error_wait(mesg, "run_transforms", NULL);
  644.                     free(mesg);
  645.                     return;
  646.                 }
  647.         plot = get_a_plot("Select a plot to scale" , "Scale Plot",
  648.                             APPEND_PLOT_TYPE);
  649.                 if (plot == NULL) return;
  650.                 scale_3D(xval, yval, zval, plot);
  651.             }
  652.            
  653.                
  654.             /* translate */
  655.             else if (trans_type == TRANSLATE)
  656.             {
  657.                 plot = get_a_plot("Select a plot to translate","Translate Plot",
  658.                             APPEND_PLOT_TYPE);
  659.                 if (plot == NULL) return;
  660.                translate_3D(xval, yval, zval, plot);
  661.             }
  662.  
  663.     reset_world_coordinates();
  664.     plot_routine();
  665.  
  666.     }
  667.  
  668. } /* end run_transforms */
  669.  
  670.  
  671.  
  672.