 /*
  * Khoros: $Id: form_init.c,v 1.2 1992/03/20 22:51:34 dkhoros Exp $
  */

#if !defined(lint) && !defined(SABER)
static char rcsid[] = "Khoros: $Id: form_init.c,v 1.2 1992/03/20 22:51:34 dkhoros Exp $";
#endif

 /*
  * $Log: form_init.c,v $
 * Revision 1.2  1992/03/20  22:51:34  dkhoros
 * VirtualPatch5
 *
  */

/*
 *---------------------------------------------------------------------
 *            Copyright 1990 University of New Mexico
 * 
 * Permission to copy and modify this software and its documen- 
 * tation only for internal use in your organization is hereby 
 * granted, provided that this notice is retained thereon and 
 * on all copies.  UNM makes no representations as too the sui- 
 * tability and operability of this software for any purpose. 
 * It is provided 'as is' without express or implied warranty. 
 *  
 * UNM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- 
 * NESS.  IN NO EVENT SHALL UNM BE LIABLE FOR ANY SPECIAL, 
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHAT- 
 * SOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 
 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PER- 
 * FORMANCE OF THIS SOFTWARE. 
 *  
 * No other rights, including for example, the right to redis- 
 * tribute this software and its documentation or the right to 
 * prepare derivative works, are granted unless specifically 
 * provided in a separate license agreement. 
 * 
 *---------------------------------------------------------------------
 */
#include "unmcopyright.h"
#include "xvforms.h"
#include "form_info.h"


/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 >>>>
 >>>>         File Name:  form_init.c
 >>>>
 >>>>      Program Desc:  code to initialize fields
 >>>>                      in the structure found in form_info.h
 >>>>
 >>>>            Author:  automatically generated by conductor
 >>>>
 >>>> Date Last Updated:  Fri Mar 13 14:07:50 1992
 >>>>
 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/


_xvf_init_view(formptr,forminfo)

xvf_form *formptr; 
view *forminfo;
{
	int index;
	Line_Info line_info;
	char **database;

	xvf_clear_line_info(&line_info);
	database = formptr->db;

	/***** initializing 'view' Form Information structure *****/

	forminfo->plot_workspace_index = 2;
	forminfo->change_bands = false;
	forminfo->quit = false;
	forminfo->lut_subform = (view_lut_subform *) 
			  malloc(sizeof(view_lut_subform));


	index = 24;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->lut_subform_selected = line_info.selected;
	forminfo->lut_subform_index = 24;
	forminfo->lut_subform_sfb_index = 3;

	/*** initializing 'forminfo->lut_subform'
	      Subform Information structure ***/

	forminfo->lut_subform->lut = (lut_subform_lut *) 
			  malloc(sizeof(lut_subform_lut));


	index = 25;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->lut_subform->lut_selected = line_info.selected;
	forminfo->lut_subform->lut_index = 25;
	forminfo->lut_subform->lut_gb_index = 0;
	index++;


	/* initializing 'forminfo->lut_subform->lut'
	       Pane Information structure */

	xvf_parse_toggle_line(database[index], &line_info);
	forminfo->lut_subform->lut->color_model_val = line_info.toggle_def;
	line_info.toggle_val = line_info.toggle_def;
	xvf_deparse_toggle_line(&line_info, database,index);
	forminfo->lut_subform->lut->color_model_index = index;
forminfo->lut_subform->lut->color_model_selected = false;
	index++;

	index = 36;
	xvf_parse_logic_line(database[index], &line_info);
	forminfo->lut_subform->lut->histogram = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->lut_subform->lut->histogram_index = index;
forminfo->lut_subform->lut->histogram_selected = false;
	index++;

	xvf_parse_cycle_line(database[index], &line_info);
	forminfo->lut_subform->lut->hist_type = line_info.cycle_val;
	xvf_deparse_cycle_line(&line_info, database,index);
	forminfo->lut_subform->lut->hist_type_index = index;
	forminfo->lut_subform->lut->hist_type_selected = false;
	index++;

	forminfo->lut_subform->lut->lut_workspace_index = 38;
	index++;

	index++;

	forminfo->lut_subform->lut->quit = false;
	index++;

	if (!(xvf_create_subform(formptr->db, formptr, formptr->subform->next_subform, true)))
	   return(false);
	_xvf_get_lut(formptr, forminfo->lut_subform->lut);
	forminfo->pseudo_subform = (view_pseudo_subform *) 
			  malloc(sizeof(view_pseudo_subform));


	index = 43;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->pseudo_subform_selected = line_info.selected;
	forminfo->pseudo_subform_index = 43;
	forminfo->pseudo_subform_sfb_index = 4;

	/*** initializing 'forminfo->pseudo_subform'
	      Subform Information structure ***/

	forminfo->pseudo_subform->pseudo = (pseudo_subform_pseudo *) 
			  malloc(sizeof(pseudo_subform_pseudo));


	index = 44;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->pseudo_subform->pseudo_selected = line_info.selected;
	forminfo->pseudo_subform->pseudo_index = 44;
	forminfo->pseudo_subform->pseudo_gb_index = 0;
	index++;


	/* initializing 'forminfo->pseudo_subform->pseudo'
	       Pane Information structure */

	xvf_parse_toggle_line(database[index], &line_info);
	forminfo->pseudo_subform->pseudo->color_model_val = line_info.toggle_def;
	line_info.toggle_val = line_info.toggle_def;
	xvf_deparse_toggle_line(&line_info, database,index);
	forminfo->pseudo_subform->pseudo->color_model_index = index;
forminfo->pseudo_subform->pseudo->color_model_selected = false;
	index++;

	index = 55;
	forminfo->pseudo_subform->pseudo->pseudo_workspace_index = 55;
	index++;

	index++;

	forminfo->pseudo_subform->pseudo->quit = false;
	index++;

	if (!(xvf_create_subform(formptr->db, formptr, formptr->subform->next_subform->next_subform, true)))
	   return(false);
	_xvf_get_pseudo(formptr, forminfo->pseudo_subform->pseudo);
	forminfo->thres_subform = (view_thres_subform *) 
			  malloc(sizeof(view_thres_subform));


	index = 60;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->thres_subform_selected = line_info.selected;
	forminfo->thres_subform_index = 60;
	forminfo->thres_subform_sfb_index = 5;

	/*** initializing 'forminfo->thres_subform'
	      Subform Information structure ***/

	forminfo->thres_subform->thres = (thres_subform_thres *) 
			  malloc(sizeof(thres_subform_thres));


	index = 61;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->thres_subform->thres_selected = line_info.selected;
	forminfo->thres_subform->thres_index = 61;
	forminfo->thres_subform->thres_gb_index = 0;
	index++;


	/* initializing 'forminfo->thres_subform->thres'
	       Pane Information structure */

	xvf_parse_toggle_line(database[index], &line_info);
	forminfo->thres_subform->thres->thresholding_val = line_info.toggle_def;
	line_info.toggle_val = line_info.toggle_def;
	xvf_deparse_toggle_line(&line_info, database,index);
	forminfo->thres_subform->thres->thresholding_index = index;
forminfo->thres_subform->thres->thresholding_selected = false;
	index++;

	index = 66;
	xvf_parse_logic_line(database[index], &line_info);
	forminfo->thres_subform->thres->accept = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->thres_subform->thres->accept_index = index;
forminfo->thres_subform->thres->accept_selected = false;
	index++;

	xvf_parse_int_line(database[index], &line_info);
	forminfo->thres_subform->thres->fill_pixel = line_info.int_def;
	line_info.int_val = line_info.int_def;
	xvf_deparse_int_line(&line_info, database,index);
	forminfo->thres_subform->thres->fill_pixel_index = index;
forminfo->thres_subform->thres->fill_pixel_selected = false;
	index++;

	xvf_parse_logic_line(database[index], &line_info);
	forminfo->thres_subform->thres->invert = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->thres_subform->thres->invert_index = index;
forminfo->thres_subform->thres->invert_selected = false;
	index++;

	xvf_parse_int_line(database[index], &line_info);
	forminfo->thres_subform->thres->non_zero_pixel = line_info.int_def;
	line_info.int_val = line_info.int_def;
	xvf_deparse_int_line(&line_info, database,index);
	forminfo->thres_subform->thres->non_zero_pixel_index = index;
forminfo->thres_subform->thres->non_zero_pixel_selected = false;
	index++;

	forminfo->thres_subform->thres->thres_workspace_index = 70;
	index++;

	index++;

	forminfo->thres_subform->thres->quit = false;
	index++;

	if (!(xvf_create_subform(formptr->db, formptr, formptr->subform->next_subform->next_subform->next_subform, true)))
	   return(false);
	_xvf_get_thres(formptr, forminfo->thres_subform->thres);
	forminfo->files_subform = (view_files_subform *) 
			  malloc(sizeof(view_files_subform));


	index = 75;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->files_subform_selected = line_info.selected;
	forminfo->files_subform_index = 75;
	forminfo->files_subform_sfb_index = 6;

	/*** initializing 'forminfo->files_subform'
	      Subform Information structure ***/

	forminfo->files_subform->file = (files_subform_file *) 
			  malloc(sizeof(files_subform_file));


	index = 76;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->files_subform->file_selected = line_info.selected;
	forminfo->files_subform->file_index = 76;
	forminfo->files_subform->file_gb_index = 0;
	index++;


	/* initializing 'forminfo->files_subform->file'
	       Pane Information structure */

	index++;

	xvf_parse_input_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->file->image = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->file->image = NULL;

	xvf_deparse_input_line(&line_info, database, index);
	forminfo->files_subform->file->image_index = index;
forminfo->files_subform->file->image_selected = false;
	index++;

	index++;

	xvf_parse_input_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->file->elev = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->file->elev = NULL;

	xvf_deparse_input_line(&line_info, database, index);
	forminfo->files_subform->file->elev_index = index;
forminfo->files_subform->file->elev_selected = false;
	index++;

	index++;

	xvf_parse_input_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->file->colormap = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->file->colormap = NULL;

	xvf_deparse_input_line(&line_info, database, index);
	forminfo->files_subform->file->colormap_index = index;
forminfo->files_subform->file->colormap_selected = false;
	index++;

	index++;

	xvf_parse_output_line(database[index], &line_info);
	if (line_info.file_def != NULL) {
	   forminfo->files_subform->file->outfile = 
		xvf_strcpy(line_info.file_def);
	}
	else  forminfo->files_subform->file->outfile = NULL;

	xvf_deparse_output_line(&line_info, database,index);
	forminfo->files_subform->file->outfile_index = index;
forminfo->files_subform->file->outfile_selected = false;
	index++;

	index++;

	forminfo->files_subform->file->quit = false;
	index++;

	forminfo->persp_subform = (view_persp_subform *) 
			  malloc(sizeof(view_persp_subform));


	index = 89;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->persp_subform_selected = line_info.selected;
	forminfo->persp_subform_index = 89;
	forminfo->persp_subform_sfb_index = 12;

	/*** initializing 'forminfo->persp_subform'
	      Subform Information structure ***/

	forminfo->persp_subform->persp = (persp_subform_persp *) 
			  malloc(sizeof(persp_subform_persp));


	index = 90;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->persp_subform->persp_selected = line_info.selected;
	forminfo->persp_subform->persp_index = 90;
	forminfo->persp_subform->persp_gb_index = 0;
	index++;


	/* initializing 'forminfo->persp_subform->persp'
	       Pane Information structure */

	xvf_parse_toggle_line(database[index], &line_info);
	forminfo->persp_subform->persp->views_val = line_info.toggle_def;
	line_info.toggle_val = line_info.toggle_def;
	xvf_deparse_toggle_line(&line_info, database,index);
	forminfo->persp_subform->persp->views_index = index;
forminfo->persp_subform->persp->views_selected = false;
	index++;

	index = 100;
	forminfo->persp_subform->persp->persp_workspace_index = 100;
	index++;

	index++;

	forminfo->persp_subform->persp->quit = false;
	index++;

	if (!(xvf_create_subform(formptr->db, formptr, formptr->subform->next_subform->next_subform->next_subform->next_subform->next_subform->next_subform->next_subform->next_subform->next_subform, true)))
	   return(false);
	_xvf_get_persp(formptr, forminfo->persp_subform->persp);
	forminfo->colormap_subform = (view_colormap_subform *) 
			  malloc(sizeof(view_colormap_subform));


	index = 105;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->colormap_subform_selected = line_info.selected;
	forminfo->colormap_subform_index = 105;
	forminfo->colormap_subform_sfb_index = 13;

	/*** initializing 'forminfo->colormap_subform'
	      Subform Information structure ***/

	forminfo->colormap_subform->colormap = (colormap_subform_colormap *) 
			  malloc(sizeof(colormap_subform_colormap));


	index = 106;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->colormap_subform->colormap_selected = line_info.selected;
	forminfo->colormap_subform->colormap_index = 106;
	forminfo->colormap_subform->colormap_gb_index = 0;
	index++;


	/* initializing 'forminfo->colormap_subform->colormap'
	       Pane Information structure */

	index++;

	xvf_parse_toggle_line(database[index], &line_info);
	forminfo->colormap_subform->colormap->color_type_val = line_info.toggle_def;
	line_info.toggle_val = line_info.toggle_def;
	xvf_deparse_toggle_line(&line_info, database,index);
	forminfo->colormap_subform->colormap->color_type_index = index;
forminfo->colormap_subform->colormap->color_type_selected = false;
	index++;

	index = 126;
	index++;

	forminfo->colormap_subform->colormap->quit = false;
	index++;

	forminfo->plot_subform = (view_plot_subform *) 
			  malloc(sizeof(view_plot_subform));


	index = 130;

	xvf_parse_startsubform_line(database[index], &line_info);
	forminfo->plot_subform_selected = line_info.selected;
	forminfo->plot_subform_index = 130;
	forminfo->plot_subform_sfb_index = 14;

	/*** initializing 'forminfo->plot_subform'
	      Subform Information structure ***/

	forminfo->plot_subform->plot = (plot_subform_plot *) 
			  malloc(sizeof(plot_subform_plot));


	index = 131;

	xvf_parse_startpane_line(database[index], &line_info);
	forminfo->plot_subform->plot_selected = line_info.selected;
	forminfo->plot_subform->plot_index = 131;
	forminfo->plot_subform->plot_gb_index = 0;
	index++;


	/* initializing 'forminfo->plot_subform->plot'
	       Pane Information structure */

	index++;

	xvf_parse_logic_line(database[index], &line_info);
	forminfo->plot_subform->plot->use_imagery = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->plot_subform->plot->use_imagery_index = index;
forminfo->plot_subform->plot->use_imagery_selected = false;
	index++;

	xvf_parse_logic_line(database[index], &line_info);
	forminfo->plot_subform->plot->interp_imagery = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->plot_subform->plot->interp_imagery_index = index;
forminfo->plot_subform->plot->interp_imagery_selected = false;
	index++;

	xvf_parse_logic_line(database[index], &line_info);
	forminfo->plot_subform->plot->proportional = line_info.logical_def;
	line_info.logical_val = line_info.logical_def;
	xvf_deparse_logic_line(&line_info, database,index);
	forminfo->plot_subform->plot->proportional_index = index;
forminfo->plot_subform->plot->proportional_selected = false;
	index++;

	xvf_parse_float_line(database[index], &line_info);
	forminfo->plot_subform->plot->subsample = line_info.float_def;
	line_info.float_val = line_info.float_def;
	xvf_deparse_float_line(&line_info, database,index);
	forminfo->plot_subform->plot->subsample_index = index;
forminfo->plot_subform->plot->subsample_selected = false;
	index++;

	xvf_parse_float_line(database[index], &line_info);
	forminfo->plot_subform->plot->height = line_info.float_def;
	line_info.float_val = line_info.float_def;
	xvf_deparse_float_line(&line_info, database,index);
	forminfo->plot_subform->plot->height_index = index;
forminfo->plot_subform->plot->height_selected = false;
	index++;

	xvf_parse_toggle_line(database[index], &line_info);
	forminfo->plot_subform->plot->plot_type_val = line_info.toggle_def;
	line_info.toggle_val = line_info.toggle_def;
	xvf_deparse_toggle_line(&line_info, database,index);
	forminfo->plot_subform->plot->plot_type_index = index;
forminfo->plot_subform->plot->plot_type_selected = false;
	index++;

	index = 150;
	index++;

	forminfo->plot_subform->plot->quit = false;
	index++;

	_xvf_get_view(formptr, forminfo);
	return(true);

}

