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

📄 jaws4.c

📁 Intro/: Directory containing introductory examples. HelloWorld.c A simple program that draws a bo
💻 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 "jaws4.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 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 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 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 -----------------------------------------------------*/    pset_linetype(PLINE_DASH);    pnon_uniform_b_spline_curve3(&Curve1);    /*--- draw curve 2 -----------------------------------------------------*/    pnon_uniform_b_spline_curve3(&Curve2);    /*--- draw curve 3 -----------------------------------------------------*/    pnon_uniform_b_spline_curve3(&Curve3);    /*--- draw curve 4 -----------------------------------------------------*/    pset_linetype(PLINE_SOLID);    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 + -