⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 field.c

📁 linux下的人机对话编程
💻 C
📖 第 1 页 / 共 2 页
字号:
                                             	/*	if((idright>=0x8000)&&(idright<=0x801d)){	  j=idright-0x8000;	f1x=SgNode_StatTab[j][2];	f1y=SgNode_StatTab[j][3];	}	     else if((idright>=0x4000)&&(idright<=0x4010)){        j=idright-0x4000;	f1x=SwNode_StatTab[j][2]*10.0;	f1y=SwNode_StatTab[j][3]*10.0;	n=idleft-0x4000;        f3x=SwNode_StatTab[n][2]*10.0;        f3y=SwNode_StatTab[n][3]*10.0;	}*/	      if((idright>=0x2000)&&(idright<=0x2017)){       j=idright-0x2000;	f1x=FdNode_StatTab[j][2];	f1y=FdNode_StatTab[j][3];	}	f2x=f1x-lon;	f2y=fy;	f3x=f1x-20;	f3y=f4y;	f5x=f2x;	f5y=f3y;	f6x=f4x-20;	f6y=f4y-60;	f7x=f2x;	f7y=f6y;        f8x=f1x-7;        f8y=f1y;        f9x=f1x-3;        f9y=f1y-9;        f10x=f4x-7;        f10y=f4y;        f11x=f4x-3;        f11y=f4y-9;	draw_11type_fd(fx,fy,f1x,f1y,f2x,f2y,f3x,f3y,f4x,f4y,f5x,f5y,f6x,f6y,f7x,f7y,f8x,f8y,                      f9x,f9y,f10x,f10y,f11x,f11y,dir,cor,canvas);      }}}int draw_no_swfd(double x1,double y1,double x2,double y2,GtkWidget*canvas,gchar*cr){  GnomeCanvasPoints *point1;  GnomeCanvasGroup *group;  group=gnome_canvas_root(GNOME_CANVAS(canvas));  GnomeCanvasItem *line;   point1=gnome_canvas_points_new(2);   point1->coords[0]=x1;   point1->coords[1]=y1;   point1->coords[2]=x2;   point1->coords[3]=y2;   line= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL); gnome_canvas_points_unref(point1); return 1;}int draw_onesw_fd(double fx,double fy,double f1x,double f1y,double f2x,double f2y,		      double f3x,double f3y,double f4x,double f4y,double f8x,double f8y,double                      f9x, double f9y,int dir,gchar*cor,GtkWidget*canvas){  GnomeCanvasPoints *point1,*point2;  GnomeCanvasGroup *group;  group=gnome_canvas_root(GNOME_CANVAS(canvas));  double c1x,c1y,c2x,c2y,c3x,c3y,c4x,c4y;   if(dir==0){   point1=gnome_canvas_points_new(2);   point1->coords[0]=fx;   point1->coords[1]=fy;   point1->coords[2]=f2x;   point1->coords[3]=f2y;       gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cor,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL); gnome_canvas_points_unref(point1);  c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","green",		        NULL);  c3x=f8x-2.0; c3y=f8y-2.0; c4x=f8x+2.0; c4y=f8y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","green",		        NULL);    }  else if(dir==1){   point2=gnome_canvas_points_new(4);   point2->coords[0]=fx;   point2->coords[1]=fy;   point2->coords[2]=f1x;   point2->coords[3]=f1y;   point2->coords[4]=f3x;   point2->coords[5]=f3y;   point2->coords[6]=f4x;   point2->coords[7]=f4y;      gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point2,"fill_color", cor,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL); gnome_canvas_points_unref(point2); c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL); }  return 1;}int draw_twosw_fd(double fx,double fy,double f1x,double f1y,double f2x,double f2y,double f3x,		  double f3y,double f4x,double f4y,double f8x,double f8y,double f9x,double f9y,double f10x,double f10y,double f11x,double f11y,int dir,gchar*cor,GtkWidget*canvas){  GnomeCanvasPoints *point1,*point2,*point3;  GnomeCanvasGroup *group;  group=gnome_canvas_root(GNOME_CANVAS(canvas));  double c1x,c1y,c2x,c2y,c3x,c3y,c4x,c4y,c5x,c5y,c6x,c6y,c7x,c7y,c8x,c8y;   if(dir==0){   point1=gnome_canvas_points_new(2);   point1->coords[0]=fx;   point1->coords[1]=fy;   point1->coords[2]=f2x;   point1->coords[3]=f2y;        gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cor,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL); gnome_canvas_points_unref(point1); c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","green",		        NULL);  c3x=f8x-2.0; c3y=f8y-2.0; c4x=f8x+2.0; c4y=f8y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","green",		        NULL); c5x=f3x-2.0; c5y=f3y-2.0; c6x=f3x+2.0; c6y=f3y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c5x,"y1",c5y,"x2",c6x,"y2",c6y,"fill_color","green",		        NULL);  c7x=f10x-2.0; c7y=f10y-2.0; c8x=f10x+2.0; c8y=f10y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c7x,"y1",c7y,"x2",c8x,"y2",c8y,"fill_color","green",		        NULL);         }  else if(dir==1){   point2=gnome_canvas_points_new(3);   point2->coords[0]=fx;   point2->coords[1]=fy;   point2->coords[2]=f1x;   point2->coords[3]=f1y;     point2->coords[4]=f4x;   point2->coords[5]=f4y;      gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point2,"fill_color", cor,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL); gnome_canvas_points_unref(point2); c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);    }else if(dir==2){   point3=gnome_canvas_points_new(3);   point3->coords[0]=f2x;   point3->coords[1]=f2y;   point3->coords[2]=f3x;   point3->coords[3]=f3y;   point3->coords[4]=f4x;   point3->coords[5]=f4y;      gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point3,"fill_color", cor,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);  gnome_canvas_points_unref(point3); c1x=f3x-2.0; c1y=f3y-2.0; c2x=f3x+2.0; c2y=f3y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f11x-2.0; c3y=f11y-2.0; c4x=f11x+2.0; c4y=f11y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);  }  return 1;} int draw_11type_fd(double fx,double fy,double f1x,double f1y,double f2x,double f2y,double f3x,                    double f3y,double f4x,double f4y,double f5x,double f5y,double f6x,double                    f6y,double f7x, double f7y,double f8x,double f8y,double f9x,double f9y,      double f10x,double f10y,double f11x,double f11y,int dir,gchar*cor,GtkWidget*canvas){  GnomeCanvasPoints *point1,*point2,*point3;  GnomeCanvasGroup *group;  group=gnome_canvas_root(GNOME_CANVAS(canvas));  double c1x,c1y,c2x,c2y,c3x,c3y,c4x,c4y,c5x,c5y,c6x,c6y,c7x,c7y,c8x,c8y;   if(dir==0){   point1=gnome_canvas_points_new(2);   point1->coords[0]=fx;   point1->coords[1]=fy;   point1->coords[2]=f2x;   point1->coords[3]=f2y;        gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cor,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL); gnome_canvas_points_unref(point1); c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","green",		        NULL);  c3x=f8x-2.0; c3y=f8y-2.0; c4x=f8x+2.0; c4y=f8y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","green",		        NULL);    }  else if(dir==1){   point2=gnome_canvas_points_new(4);   point2->coords[0]=fx;   point2->coords[1]=fy;   point2->coords[2]=f1x;   point2->coords[3]=f1y;   point2->coords[4]=f3x;   point2->coords[5]=f3y;   point2->coords[6]=f5x;   point2->coords[7]=f5y;      gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point2,"fill_color", cor,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);   gnome_canvas_points_unref(point2); c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);   c5x=f4x-2.0; c5y=f4y-2.0; c6x=f4x+2.0; c6y=f4y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c5x,"y1",c5y,"x2",c6x,"y2",c6y,"fill_color","yellow",		        NULL);  c7x=f10x-2.0; c7y=f10y-2.0; c8x=f10x+2.0; c8y=f10y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c7x,"y1",c7y,"x2",c8x,"y2",c8y,"fill_color","yellow",		        NULL);       }else if(dir==2){   point3=gnome_canvas_points_new(6);   point3->coords[0]=fx;   point3->coords[1]=fy;   point3->coords[2]=f1x;   point3->coords[3]=f1y;   point3->coords[4]=f3x;   point3->coords[5]=f3y;   point3->coords[6]=f4x;   point3->coords[7]=f4y;   point3->coords[8]=f6x;   point3->coords[9]=f6y;   point3->coords[10]=f7x;   point3->coords[11]=f7y;      gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point3,"fill_color", cor,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);  gnome_canvas_points_unref(point3); c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);   c5x=f4x-2.0; c5y=f4y-2.0; c6x=f4x+2.0; c6y=f4y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c5x,"y1",c5y,"x2",c6x,"y2",c6y,"fill_color","yellow",		        NULL);  c7x=f11x-2.0; c7y=f11y-2.0; c8x=f11x+2.0; c8y=f11y+2.0;  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c7x,"y1",c7y,"x2",c8x,"y2",c8y,"fill_color","yellow",		        NULL);     }  return 1;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -