/*************************************************************/
/***** FEAPpv DRIVER FOR X WINDOWS VERSION 11, RELEASE 4 *****/
/*************************************************************/
/*********************************/
/* Driver configuration */
/* X11 DEVICE DRIVER */
/* Change 5-places for EACH */
/* Type of workstation Search */
/* for string FORTRAN to change */
/* Currently set: Underscore */
/* Version for: SUN & DEC */
/*********************************/
/* This driver supports the traditional GIN mode, i.e. point the cursor */
/* and strike a key! It also supports the use of the mouse buttons */
/* during GIN input. Below is the mouse button to "key" relationships. */
#define BUTTON1_KEY 'l'
#define BUTTON2_KEY 'm'
#define BUTTON3_KEY 'r'
/* This driver has the capability to store all the lines drawn into the */
/* X Window and to use these saved lines to refresh the screen. */
/* Using this feature and the routine "gdx11_refresh_window" should */
/* make using FEAP under X11 easier than before! */
/* If you don't want/need this feature or if you can't afford the */
/* memory usage, set MAX_SEG to 1, MAX_POINTS to something around 100 */
#define MAX_POINTS 20000 /* Maximum points in all polylines stored */
#define MAX_SEG 10000 /* Maximum polylines stored */
#define MAX_TEXT 10000 /* Maximum 80-character text string */
#define DEBUG 0 /* 0 == No debugging. */
/* 1 == Soft X11 errors */
/* 2 == Above plus caller bugs */
/* 3 == Above plus Driver tracing messages */
/* 4 == Above plus all tracing messages */
/****************************/
/* Non-FEAP include files */
/****************************/
#include <stdio.h> /* Unix standard I/O definitions */
#include <stdlib.h> /* We use Unix "malloc" and "free" */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
/* Note: if you don't have the file "malloc.h", then use the following: */
/* extern char *malloc(); */
/* extern void free(); */
/**************************/
/* Gray scale definitions */
/**************************/
#define gray1_width 16
#define gray1_height 16
static char gray1_bits [] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
#define gray2_width 4
#define gray2_height 4
static char gray2_bits [] = {0x07, 0x0d, 0x07, 0x0d};
#define gray3_width 16
#define gray3_height 4
static char gray3_bits [] = {0x55, 0x55, 0xee, 0xee, 0x55, 0x55, 0xbb, 0xbb};
#define gray4_width 16
#define gray4_height 16
static char gray4_bits [] = {0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33,
0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33,
0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33,
0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33};
#define gray5_width 2
#define gray5_height 2
static char gray5_bits [] = {0x01, 0x02};
#define gray6_width 16
#define gray6_height 16
static char gray6_bits [] = {0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22,
0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22,
0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22,
0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x22, 0x22};
#define gray7_width 4
#define gray7_height 4
static char gray7_bits [] = {0x08, 0x02, 0x08, 0x02};
#define gray8_width 16
#define gray8_height 16
static char gray8_bits [] = {0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00,
0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00,
0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00,
0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00};
/***************************/
/* FEAP Window Structure */
/***************************/
/* Note: User's should treat all DIGWin structures as READ-ONLY */
/* However, in general, user's should even read these fields! */
typedef struct
{
Window xwin;
Display *xdisplay;
XWindowAttributes xwa;
GC xgc;
GC xgc_mono_fill;
Pixmap gray[8];
int num_fg_colors;
int pixel_value_for_color[8];
int current_x;
int current_y;
int current_pixel_value;
int current_gray_value;
int min_x;
int max_x;
int min_y;
int max_y;
int abs_min_max;
int x_border;
int y_border;
int x_offset;
int x_len;
float x_scale;
int y_offset;
int y_len;
float y_scale;
int next_point;
int npolylines;
int nstrings;
int *npoints;
int *polyline_pixel_value;
int *polyline_gray_value;
int *strlen;
int *strflg;
int *textx;
int *texty;
char *strings;
XPoint *points;
} DIGWin;
#define STROKE_DEVICE 0
#define RASTER_DEVICE 1
#define DVST_DEVICE 2
#define PLOTTER_DEVICE 3
#define CAN_DRAW_IN_BACKGROUND 4
#define HARDCOPY_DEVICE 8
#define SHARED_DEVICE 16
#define HLS_SETABLE_COLORS 32
#define RGB_SETABLE_COLORS 64
#define CAN_DO_GIN 128
#define CAN_DRAW_FILLED_POLYGONS 256
#define CONVEX_POLYGONS_ONLY 512
#define CAN_DO_LOCATOR_INPUT 1024
/***************************/
/* Some global definitions */
/***************************/
#define MAX_OPCODE 16 /* number of op-code values */
#define DEFAULT_X 245 /* X Window Location on Screen */
#define DEFAULT_Y 065 /* Y Window Location on Screen */
static XButtonPressedEvent DiglibEvent;/* Button event variable */
static DIGWin *current_dw = NULL;
static DIGWin *default_dw = NULL;
static int default_width = 768; /* X Window width (default) */
static int default_height = 600; /* Y Window width (default) */
#define Min(x,y) ( ((float)x < (float)y ) ? (float)x : (float)y )
/*******************************************************************/
/* Device coordinates <--> Virtual corrdinates, translation macros */
/*******************************************************************/
#define x_translate(dw,x) (int)((x)*dw->x_scale-1.5)+dw->x_offset
#define y_translate(dw,y) (int)(dw->y_len-(y)*dw->y_scale-1.5)+dw->y_offset
#define x_untranslate(dw,x) ((x)-dw->x_offset)/dw->x_scale
#define y_untranslate(dw,y) (dw->y_len+dw->y_offset-(y))/dw->y_scale
/*********************************/
/*** Window Management Support ***/
/*********************************/
/*******************************************************************/
/* Adjust the scale of the diglib device to fit the current window */
/* given the user's guidelines for what part of the window to use.*/
/*******************************************************************/
void gdx11_adjust_digwin(dw)
DIGWin *dw;
{
if (dw->abs_min_max)
{
dw->x_offset = dw->min_x + dw->x_border;
dw->y_offset = dw->min_y + dw->y_border;
dw->x_len = (dw->max_x-dw->x_border) - dw->x_offset;
dw->y_len = (dw->max_y-dw->y_border) - dw->y_offset;
}
else
{
XGetWindowAttributes(dw->xdisplay,dw->xwin,&(dw->xwa));
dw->x_offset = (dw->min_x*dw->xwa.width)/100+dw->x_border;
dw->y_offset = (dw->min_y*dw->xwa.height)/100+dw->y_border;
dw->x_len = ((dw->max_x-dw->min_x)*dw->xwa.width)/100-dw->x_border;
dw->y_len = ((dw->
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
Feappv.zip_feappv_finite_personal (578个子文件)
Feappv.a 1.79MB
built_objs 2KB
built_objs 561B
built_objs 437B
built_objs 191B
built_objs 143B
x11u.c 41KB
material.f 105KB
solid2d.f 85KB
shell3d.f 59KB
frame2d.f 52KB
plate2d.f 45KB
pesurf.f 32KB
pplotf.f 31KB
pmacr3.f 25KB
shell2d.f 24KB
solid3d.f 24KB
prj3dl.f 23KB
pmacr1.f 22KB
pcontr.f 20KB
frame3d.f 19KB
pmesh.f 17KB
trussnd.f 13KB
membr3d.f 12KB
pform.f 12KB
pmacr2.f 12KB
pnums.f 11KB
blkgen.f 10KB
arclen.f 10KB
therm2d.f 10KB
pblend2.f 10KB
sblke.f 10KB
pltdos.f 9KB
pltelc.f 9KB
therm3d.f 9KB
pmacr.f 9KB
palloc.f 8KB
pltcon.f 8KB
tienod.f 8KB
datri.f 8KB
vblkn.f 7KB
propld.f 7KB
setmem.f 7KB
fppsop.f 7KB
subsp.f 7KB
tint2d.f 7KB
pblend.f 7KB
pmacio.f 7KB
mkface.f 7KB
restrt.f 7KB
pconst.f 7KB
plfacx.f 7KB
filnam.f 6KB
pnorml.f 6KB
pedgin.f 6KB
pblend1.f 6KB
pltris.f 6KB
plink.f 6KB
meshck.f 6KB
convec2d.f 6KB
int1dg.f 6KB
trishp.f 6KB
pelmin.f 6KB
perspe.f 6KB
pltftx.f 5KB
sblkn.f 5KB
global.f 5KB
update.f 5KB
dparam.f 5KB
pltftx.f 5KB
pmatin.f 5KB
iters.f 5KB
pfuncs.f 5KB
feappv.f 5KB
proced.f 5KB
pwopn.f 5KB
frame.f 5KB
prj2dl.f 5KB
cassem.f 5KB
genvec.f 5KB
pltfor.f 5KB
convec3d.f 5KB
eisql.f 5KB
iterat.f 4KB
pblend3.f 4KB
pltord.f 4KB
tinput.f 4KB
dicont.f 4KB
elpint1.f 4KB
shp3d.f 4KB
phist.f 4KB
pinstall.f 4KB
compro.f 4KB
elmlib.f 4KB
xpline.f 4KB
reader.f 4KB
conjgd.f 4KB
ptiend.f 4KB
dplot.f 4KB
arcint1.f 4KB
共 578 条
- 1
- 2
- 3
- 4
- 5
- 6
朱moyimi
- 粉丝: 64
- 资源: 1万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Pytorch-pytorch深度学习教程之前馈神经网络.zip
- Pytorch-pytorch深度学习教程之线性回归.zip
- Pytorch-pytorch深度学习教程之基本操作.zip
- 基于QT的地图可视化桌面系统后台数据库为MySQL5.7源码.zip
- 基于simulink的PLL锁相环系统仿真【包括模型,文档,参考文献,操作步骤】
- 基于EM-GMM模型的目标跟踪和异常行为检测matlab仿真【包括程序,注释,参考文献,操作步骤,说明文档】
- 2109010044_胡晨燕_选课管理数据库设计与实现.prj
- 帕鲁介绍的PPT备份没什么好下的
- demo1-202405
- 两种方式修改Intel网卡MAC地址
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1