コード例 #1
0
static void make_2nd_level_image_menu(){
	int iflag_draw_m = send_iflag_draw_mesh();
	int iflag_draw_p = send_iflag_draw_current_psf();
	int iflag_draw_f = send_iflag_draw_fline();
	int iflag_axis =       send_object_property_flags(AXIS_TOGGLE);
	int iflag_draw_coast = send_object_property_flags(COASTLINE_SWITCH);
	int iflag_draw_sph =   send_object_property_flags(SPHEREGRID_SWITCH);
	
	glut_menu_id->color_mode_menu = glutCreateMenu(color_mode_handler);
	glut_color_mode_menu_item();
	
	glut_menu_id->polygon_id_menu = glutCreateMenu(object_property_handler);
	
	glut_draw_axis_menu_item(iflag_axis);
	glut_draw_coast_menu_item(iflag_draw_coast);
	glut_draw_sph_grid_menu_item(iflag_draw_sph);
	if ( (iflag_draw_coast != 0) || (iflag_draw_sph != 0)) {
		glutAddMenuEntry("Set Coastline radius",SET_COAST_RADIUS);
	};
	
	glut_drawing_select();
	if ( (iflag_draw_m > 0) && (iflag_draw_p == 0) && (iflag_draw_f == 0) ) {
		glutAddMenuEntry("Object distance",SET_DISTANCE_DOMAIN);
	};
	glutAddMenuEntry("Output transfer matrices",OUTPUT_V_MATRIX);
	glutAddMenuEntry("Load transfer matrices",INPUT_V_MATRIX);
	
	glut_menu_id->draw_rot_image_menu = glutCreateMenu(draw_rot_image_handler);
	glutAddMenuEntry("x-axis",ROTATE_X);
	glutAddMenuEntry("y-axis",ROTATE_Y);
	glutAddMenuEntry("z-axis",ROTATE_Z);
	return;
};
コード例 #2
0
static void make_1st_level_menu(){
	GLint menu_id;
	
	int iflag_draw_m = send_iflag_draw_mesh();
	int iflag_draw_p = send_iflag_draw_current_psf();
	int iflag_draw_f = send_iflag_draw_fline();
	int iflag_any_objects_on = iflag_draw_p + iflag_draw_m + iflag_draw_f;
	
	int nload_psf = send_num_loaded_PSF();
	
	glutSetWindow(menu_win);
	
	if (iflag_any_objects_on > 0) {
		make_2nd_level_view_menu();
	};
	
	if( iflag_draw_m > 0){
		make_3rd_level_mesh_menu();
		make_2nd_level_mesh_menu();
	};
	
	if( iflag_draw_p > 0){
		make_3rd_level_psf_menu();
		make_2nd_level_psf_menu();
	};
	
	if( iflag_draw_f > 0){
		make_3rd_level_fline_menu();
		make_2nd_level_fline_menu();
	};
	
	
	if (iflag_any_objects_on > 0) {
	make_2nd_level_image_menu();
	};
	
	glut_menu_id->submenu_id = menu_init();
	
	menu_id = glutCreateMenu(main_menu_handler);
	
	glutAddMenuEntry("Open...",FILE_OPEN);
	if(iflag_any_objects_on > 0){
		/*glutAddSubMenu("View Modifier",glut_menu_id->submenu_id);*/
		glutAddSubMenu(viewtype_title,glut_menu_id->viewtype_id);
	}
	
	if( iflag_draw_m > 0){
		glutAddSubMenu("Domain informations",glut_menu_id->domain_id);
		glutAddSubMenu("Node groups",glut_menu_id->nod_grp_menu);
		glutAddSubMenu("Element_groups",glut_menu_id->ele_grp_menu);
		glutAddSubMenu("Surface_groups",glut_menu_id->surf_grp_menu);
	};
	
	if( nload_psf > 0) glutAddSubMenu("Surface rendering", glut_menu_id->psf_root_menu);
	if( iflag_draw_f > 0) glutAddSubMenu("Field Lines", glut_menu_id->fline_root_menu);
	
	
	if ( iflag_draw_m > 0) {
		glutAddSubMenu("Color mode",         glut_menu_id->color_mode_menu);
	};
	
	if (iflag_any_objects_on > 0) {
		/*printf("polygon_id_menu \n");*/
		glutAddSubMenu("Object propaties",   glut_menu_id->polygon_id_menu);
		glutAddMenuEntry("Save image", SAVE_SNAPSHOT);
	};
	
	if( iflag_draw_p+iflag_draw_f > 0){
		glutAddMenuEntry("Save evolution images", SAVE_EVOLUTION);
	};
	
	if (iflag_any_objects_on > 0) {
		glutAddSubMenu("Save rotate images", glut_menu_id->save_rot_image_menu);
		glutAddSubMenu("Rotate on Window",   glut_menu_id->draw_rot_image_menu);
	};
	
	glutAddMenuEntry("Quit",QUIT_SELECTED);
	glutAttachMenu(GLUT_LEFT_BUTTON);
	return;
};