Exemple #1
0
void glut_PSF_range_menu(){
	int if_psf =        send_draw_field_current_psf();
	int ncomp =         send_ncomp_current_psf(if_psf);
	int iflag_vect =    send_kemoview_psf_draw_flags(PSFVECT_TOGGLE);
	int iflag_v_color = send_current_vector_patch_color();
/*	int iflag_refv =  send_draw_current_psf_refv();*/

	glutAddMenuEntry("Set range",              ISET_RANGE);
	glutAddMenuEntry("Set number of isolines", ISET_NLINE);
	glutAddMenuEntry("Set Opacity",            ISET_PSF_OPACITY);
	
	
	if(iflag_vect != IZERO && ncomp == 3){
		/*
		if(iflag_refv != IZERO ){
			glutAddMenuEntry("hide Vector Reference",PSFREFV_TOGGLE);
		}
		else{
			glutAddMenuEntry("show Vector Reference",PSFREFV_TOGGLE);
		};
		*/
		if (iflag_v_color == RAINBOW_SURFACE) {
			glutAddMenuEntry("Black Vector",          WHITE_PSF_VECT);
		}else{
			glutAddMenuEntry("Rainbow Vector",        RAINBOW_PSF_VECT);
		};
	
		glutAddMenuEntry("Set Increment for Vector", ISET_PSF_VEC_INC);
		glutAddMenuEntry("Set Reference Vector",     ISET_PSF_REFVECT);
		glutAddMenuEntry("Set Vector Thickness",     ISET_PSF_V_THICK);
	};
	
	return;
};
Exemple #2
0
void glut_PSF_field_select() {
	int i;
	int num_field = send_nfield_current_psf();
	int if_psf = send_draw_field_current_psf();
	char field_name[80];
	
	for ( i = 0; i< num_field; i++) {
		if( i != if_psf){
			send_current_psf_data_name(field_name, i);
			glutAddMenuEntry(field_name,i);
		}
	};
	return;
}
Exemple #3
0
static void make_2nd_level_psf_menu(){
	char tmp_menu[1024];
	char psf_name[LENGTHBUF];
	
	int num_psf =     send_num_loaded_PSF();
	int num_fld =     send_nfield_current_psf();
	int if_psf =      send_draw_field_current_psf();
	int ic_psf =      send_draw_comp_id_current_psf();
	int num_comp =    send_ncomp_current_psf(if_psf);
	int id_coord =    send_coordinate_id_current_psf();
	int iflag_solid = send_kemoview_psf_draw_flags(PSFSOLID_TOGGLE);
	int iflag_grid =  send_kemoview_psf_draw_flags(PSFGRID_TOGGLE);
	
	glut_menu_id->psf_root_menu = glutCreateMenu(psf_handler);
	
	if(num_psf > 1){
		send_current_psf_file_header(psf_name);
		sprintf(tmp_menu, "Current: %s", psf_name);
		glutAddSubMenu(tmp_menu, glut_menu_id->ichoose_current_psf_menu);
	} else {
	};
	
	
	send_current_psf_data_name(tmp_menu,if_psf);
	if (num_fld > 1) {
		glutAddSubMenu(tmp_menu, glut_menu_id->ichoose_field_menu);
	} else {
		glutAddMenuEntry(tmp_menu, PSF_NOTHING_TODO);
	};
	
	if (num_comp > 1) {
		set_PSF_component_name(num_comp,ic_psf,id_coord,tmp_menu); 
		glutAddSubMenu(tmp_menu, glut_menu_id->ichoose_comp_menu);
	};
	
	glut_PSF_draw_menu();

	if(iflag_solid > 0){glutAddSubMenu("Surface  color", glut_menu_id->ichoose_psf_patchcolor_menu);};
	if(iflag_grid > 0) {glutAddSubMenu("Line color", glut_menu_id->ichoose_psf_linecolor_menu);};
	
	glut_PSF_range_menu();
	
	glutAddMenuEntry("Close Current PSF data", PSF_OFF);
	
	return;
};
Exemple #4
0
void glut_PSF_comps_select() {
	char tmp_menu[1024];
	int i;
	int if_psf =   send_draw_field_current_psf();
	int ic_psf =   send_draw_comp_id_current_psf();
	int ndir =     send_ncomp_current_psf(if_psf);
	int id_coord = send_coordinate_id_current_psf();
	
	for(i=0;i<ndir;i++){
		if(ic_psf != i){
			set_PSF_component_name(ndir, i, id_coord, tmp_menu);
			glutAddMenuEntry(tmp_menu,i);
		}
	}
	glutAddMenuEntry("magnitude \n",ndir);
	
	return;
};
Exemple #5
0
void set_psf_range_by_glui(int winid){
	char psf_range_txt[1024];
	
	int ifield = send_draw_field_current_psf();
	int icomp = send_draw_component_current_psf();
	psf_color_min = (float) send_current_PSF_color_table_min();
	psf_color_max = (float) send_current_PSF_color_table_max();
	sprintf(psf_range_txt,"Range: %3.2e ... %3.2e",(float) send_current_psf_data_min(icomp),
			(float) send_current_psf_data_max(icomp) );
	glui_sub = GLUI_Master.create_glui("PSF range", 0, 100, 100);
	staticText = new GLUI_StaticText( glui_sub, psf_range_txt);
	editText_max = new GLUI_EditText( glui_sub, "Maximum: ", GLUI_EDITTEXT_FLOAT,
									 &psf_color_max, -1, input_psf_max_from_panel );
	editText_min = new GLUI_EditText( glui_sub, "Maximum: " , GLUI_EDITTEXT_FLOAT,
									 &psf_color_min, -1, input_psf_min_from_panel );
	glui_sub->add_button("OK", 0, close_panel);
	glui_sub->set_main_gfx_window(winid);
	return;
}
Exemple #6
0
static void make_3rd_level_psf_menu(){
	
	int num_psf =     send_num_loaded_PSF();
	int num_fld =     send_nfield_current_psf();
	int if_psf =      send_draw_field_current_psf();
	int num_comp =    send_ncomp_current_psf(if_psf);
	int iflag_solid = send_kemoview_psf_draw_flags(PSFSOLID_TOGGLE);
	int iflag_grid =  send_kemoview_psf_draw_flags(PSFGRID_TOGGLE);
	
	if(num_psf > 1){
		glut_menu_id->ichoose_current_psf_menu = glutCreateMenu(set_current_psf_handler);
		glut_current_PSF_select();
	};
	
	if (num_fld > 1) {
		glut_menu_id->ichoose_field_menu = glutCreateMenu(set_psf_field_handler);
		glut_PSF_field_select();
	};
	
	if (num_comp > 1) {
		glut_menu_id->ichoose_comp_menu = glutCreateMenu(set_psf_comp_handler);
		glut_PSF_comps_select();
	};

	if (iflag_solid > 0) {
		glut_menu_id->ichoose_psf_patchcolor_menu = glutCreateMenu(set_psf_patchcolor_handler);
		glut_PSF_patchcolor_select();
	};

	if (iflag_grid > 0) {
		glut_menu_id->ichoose_psf_linecolor_menu =  glutCreateMenu(set_psf_linecolor_handler);
		glut_PSF_linecolor_select();
	};

	return;
};
Exemple #7
0
void glut_PSF_draw_menu(){
	int iflag_solid =       send_kemoview_psf_draw_flags(PSFSOLID_TOGGLE);
	int iflag_grid =        send_kemoview_psf_draw_flags(PSFGRID_TOGGLE);
	int iflag_zero =        send_kemoview_psf_draw_flags(ZEROGRID_TOGGLE);
	int iflag_cbar =        send_kemoview_psf_draw_flags(COLORBAR_TOGGLE);
	int iflag_vect =        send_kemoview_psf_draw_flags(PSFVECT_TOGGLE);
	int iflag_PSF_polygon = send_kemoview_psf_draw_flags(PSF_POLYGON_SWITCH);
    int iflag_PSF_tanvec =  send_kemoview_psf_draw_flags(PSFTANVEC_TOGGLE);
	int if_psf =            send_draw_field_current_psf();
	int ncomp =             send_ncomp_current_psf(if_psf);
	
	if(iflag_solid != IZERO ){
		glutAddMenuEntry("hide PSF surface",PSFSOLID_TOGGLE);
	}
	else{
		glutAddMenuEntry("show PSF surface",PSFSOLID_TOGGLE);
	};
	
	if(iflag_grid != IZERO ){
		glutAddMenuEntry("hide PSF isolines",PSFGRID_TOGGLE);
	}
	else{
		glutAddMenuEntry("show PSF isolines",PSFGRID_TOGGLE);
	};
	
	if(iflag_zero != IZERO ){
		glutAddMenuEntry("hide zero lines",ZEROGRID_TOGGLE);
	}
	else{
		glutAddMenuEntry("show zero lines",ZEROGRID_TOGGLE);
	};
	
	if(iflag_cbar != IZERO ){
		glutAddMenuEntry("hide colorbar",COLORBAR_TOGGLE);
	}
	else{
		glutAddMenuEntry("show colorbar",COLORBAR_TOGGLE);
	};
	
	if(ncomp == 3){
		if(iflag_vect != IZERO ){
			glutAddMenuEntry("hide PSF Vector",PSFVECT_TOGGLE);
		}else{
			glutAddMenuEntry("show PSF Vector",PSFVECT_TOGGLE);
		};
	};

	if(iflag_solid != IZERO ){
		if(iflag_PSF_polygon== NORMAL_POLYGON ){
			glutAddMenuEntry("normal => reverse",PSF_POLYGON_SWITCH);
		}
		else{
			glutAddMenuEntry("reverse => normal",PSF_POLYGON_SWITCH);
		};
	};
    
	if(iflag_solid != IZERO ){
		if(iflag_PSF_polygon== NORMAL_POLYGON ){
			glutAddMenuEntry("full => tangential",PSFTANVEC_TOGGLE);
		}
		else{
			glutAddMenuEntry("tangential => full",PSFTANVEC_TOGGLE);
		};
	};
	return;
}