📄 jaws.c
字号:
#include <phigs.h> /* get HP-PHIGS definitions for C */#include <stdio.h> /* get standard I/O definitions */#include <math.h> /* link with library "-lm" */main() /* file "Jaws.c" */{ Pint WorkstnID = 1; /* workstation identifier */ Pint ConnID; /* connection identifier */ Pint WorkstnType = POIDDX; /* out/in, dir, dbl bfr, X */ Pint TheStructure = 1; /* structure ID */ /*--- define curve 1 ---------------------------------------------------*/ static Pfloat KnotVals1[9] = {0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 4.0, 4.0, 4.0}; static Ppoint3 CtrlPts1[6] = {{0.1, 0.1, 0.0}, {0.7, 0.1, 0.0}, {0.9, 0.1, 0.0}, {0.9, 0.3, 0.0}, {0.7, 0.3, 0.0}, {0.6, 0.3, 0.0}}; static Ppoint_list3 Markers1 = {6, CtrlPts1}; static Pcurve_geom_spline Curve1 = { 3, /* spline order */ {9, KnotVals1}, /* knot vector */ 0.0, 4.0, /* low/high limits */ {PB_SPLINE_NON_RATIONAL, 6, CtrlPts1}}; /* list of control points */ /*--- define curve 2 ---------------------------------------------------*/ static Pfloat KnotVals2[6] = {0.0, 0.0, 0.0, 1.0, 1.0, 1.0}; static Ppoint3 CtrlPts2[3] = {{0.6, 0.3, 0.0}, {0.55, 0.25, 0.0}, {0.5, 0.2, 0.0}}; static Ppoint_list3 Markers2 = {3, CtrlPts2}; static Pcurve_geom_spline Curve2 = { 3, /* spline order */ {6, KnotVals2}, /* knot vector */ 0.0, 1.0, /* low/high limits */ {PB_SPLINE_NON_RATIONAL, 3, CtrlPts2}}; /* list of control points */ /*--- define curve 3 ---------------------------------------------------*/ static Pfloat KnotVals3[7] = {0.0, 0.0, 0.0, 1.0, 2.0, 2.0, 2.0}; static Ppoint3 CtrlPts3[4] = {{0.5, 0.2, 0.0}, {0.2, 0.2, 0.0}, {0.12, 0.2, 0.0}, {0.1, 0.3, 0.0}}; static Ppoint_list3 Markers3 = {4, CtrlPts3}; static Pcurve_geom_spline Curve3 = { 3, /* spline order */ {7, KnotVals3}, /* knot vector */ 0.0, 2.0, /* low/high limits */ {PB_SPLINE_NON_RATIONAL, 4, CtrlPts3}}; /* list of control points */ /*--- define curve 4 ---------------------------------------------------*/ static Pfloat KnotVals4[6] = {0.0, 0.0, 0.0, 1.0, 1.0, 1.0}; static Ppoint3 CtrlPts4[3] = {{0.1, 0.3, 0.0}, {0.07, 0.2, 0.0}, {0.1, 0.1, 0.0}}; static Ppoint_list3 Markers4 = {3, CtrlPts4}; static Pcurve_geom_spline Curve4 = { 3, /* spline order */ {6, KnotVals4}, /* knot vector */ 0.0, 1.0, /* low/high limits */ {PB_SPLINE_NON_RATIONAL, 3, CtrlPts4}}; /* list of control points */ popen_phigs((char *) stderr, 0); /* errors go to "stderr" */ pescape_u4("/dev/screen/phigs_window", &ConnID); popen_ws(WorkstnID, (void *) ConnID, WorkstnType); popen_struct(TheStructure); pset_marker_type(PMARKER_ASTERISK); pset_marker_size(4.0); /*--- draw curve 1 -----------------------------------------------------*/ ppolymarker3(&Markers1); pnon_uniform_b_spline_curve3(&Curve1); /*--- draw curve 2 -----------------------------------------------------*/ ppolymarker3(&Markers2); pnon_uniform_b_spline_curve3(&Curve2); /*--- draw curve 3 -----------------------------------------------------*/ ppolymarker3(&Markers3); pnon_uniform_b_spline_curve3(&Curve3); /*--- draw curve 4 -----------------------------------------------------*/ ppolymarker3(&Markers4); pnon_uniform_b_spline_curve3(&Curve4); pclose_struct(); ppost_struct(WorkstnID, TheStructure, 1.0); pupd_ws(WorkstnID, PFLAG_PERFORM); pclose_ws(WorkstnID); pclose_phigs();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -