📄 lines.c
字号:
#include <phigs.h> /* get HP-PHIGS definitions for C */#include <stdio.h> /* get standard I/O definitions */main() /* file "Lines.c" */{ Pint WorkstnID = 1; /* workstation identifier */ Pint ConnID; /* connection identifier */ Pint WorkstnType = POIDDX; /* out/in, direct, dbl bfr, Xwindow */ Pint TheCurve = 1; /* structure ID (chosen by user) */ Ppoint LinePts[100]; /* points for the polyline */ Ppoint_list LineData; /* data for the polyline */ FILE *datafile; /* file pointer */ int I = 0; /* loop control variable */ /*=== read data file into the structure array ==========================*/ datafile = fopen("data", "r"); /* open data file (2 numbers/line) */ while (fscanf(datafile, "%f%f", &LinePts[I].x, &LinePts[I].y) != EOF) I++; fclose(datafile); LineData.num_points = I; LineData.points = LinePts; /*=== set up HP-PHIGS to plot data =====================================*/ popen_phigs((char *) stderr, 0); /* errors go to "stderr" */ pescape_u4("/dev/screen/phigs_window", &ConnID); popen_ws(WorkstnID, (void *) ConnID, WorkstnType); popen_struct(TheCurve); ppolyline(&LineData); pclose_struct(); /*=== post the image and close up shop =================================*/ ppost_struct(WorkstnID, TheCurve, 1.0); pupd_ws(WorkstnID, PFLAG_PERFORM); /* (regeneration flag) */ pclose_ws(WorkstnID); pclose_phigs();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -