1 #if !defined(ZGRAPH_H_)
10 #include <X11/Intrinsic.h>
12 typedef unsigned int Zuint;
13 typedef unsigned char Zind;
14 typedef unsigned char Uchar;
20 typedef float ZRdepth;
24 #define MIN_(x,a) if(x > (a)) x = a
25 #define MAX_(x,a) if(x < (a)) x = a
26 #define Swap(x,y) (x ^= (y ^= (x ^= y)))
27 #define FtoI(a) ((a < 0) ? a-0.5 : a+0.5)
28 #define Zabs(a) ((a < 0) ? -a : a)
29 #define Sign(a) ((a < 0) ? -1 : 1)
30 #define max(a,b) (((a) > (b)) ? (a) : (b))
31 #define min(a,b) (((a) < (b)) ? (a) : (b))
35 #define YTimeOut 0x4014
40 #define memcpy_(a,b,c) memcpy((char *)(a),(char *)(b),c)
41 #define memcmp_(a,b,c) memcmp((char *)(a),(char *)(b),c)
42 #define memset_(a,b,c) memset((char *)(a),b,c)
44 typedef int (*DrawFunction4D)();
45 typedef int (*SelectFunction)();
46 typedef int (*PutUserPixmap)();
47 typedef int (*SetUserData)();
48 typedef int (*ZDrawS4DLine)();
49 typedef float (*SelectObjF)(
double x,
double y);
97 #define DRAW_NO_DEPTH 2
98 #define DRAW_ONLY_PIXMAP 4
99 #define DRAW_ONLY_WINDOW 8
106 DrawFunction4D DrawF;
107 SelectFunction DrawS;
110 char AllocMem,FlDraw,Draw1,Draw2;
114 float m[9],m_[9],d[3],d_[3],scale[3],scale_[3],
115 center[3],center_[3],shadow[3],
ray[3];
130 int (*ZSet4DVector)();
131 int (*ZSet4DVector_)();
132 int (*ZSet3DVector)();
133 int (*ZSet3DVector_)();
134 int (*ZSet2DVector)();
135 int (*ZSet2DVector_)();
138 int height,width,Lwidth,CgmW,CgmH;
140 float m[9],m_[9],d[3],d_[3],scale[3],scale_[3],
141 center[3],center_[3],shadow[3],
ray[3];
142 float rx1,rx2,ry1,ry2,rz1,rz2;
144 float selX,selY,selZ;
147 XFontStruct* font_struct;
149 short ch_h,ch_w,a1,a2;
152 char OnlyShadow,OnlyRay,FLine,FTriangle,HCopy,cpl[3];
157 #define ZcolorFrame 4
163 char Fill,Frame,CFrame;
168 char Fill,Frame,CFrame;
184 extern char CubePlanes[];
188 char plane[8],Calculate;
195 int x1,x2,y1,y2,z1,z2;
199 float surfx,surfy,surfz;
212 double XX,YY,ZZ,Rz,dxR,dyR,dzR,n0z,dxz,dyz;
221 float zmin,zcoef,raycoef;
227 char NoDepth,Fill,Frame,Ray,DataType,FastGrid,Surf;
235 double kx,ky,kz1,kz2,fx,fy,fz,dxy;
236 double ind1,ind2,id1,id2;
250 float zmin,zcoef,raycoef;
256 char NoDepth,Fill,Frame,Ray,DataType,FastGrid,Surf;
267 float x1,y1,x2,y2,x3,y3,x4,y4;
272 float kx1,ky1,kz1,kz2;
273 char NoDepth,Film,Frame,Ray;
297 int ZPutImage3D(
WIN3D* w);
303 int ZSet3DVectorP(
Place3D* w,
double x,
double y,
double z,
Vector3D* v_);
304 int ZInv3DVectorP(
Place3D* w,
double *x,
double *y,
double *z,
Vector3D* v_);
305 int ZSet3DVectorXYZ(
WIN3D* w,
double x,
double y,
double z,
Vector3D* v_);
306 int ZInv3DVectorXYZ(
WIN3D* w,
double *x,
double *y,
double *z,
Vector3D* v_);
313 double ZGet3DVectorLenth(
Vector3D* v);
314 int ZInitMxyz(
WIN3D* w);
315 int ZRotMxyz(
WIN3D* w,
int a,
double fi);
316 int ZRotMxyzI(
WIN3D* w,
int a,
double fi);
317 int ZRotMShadow(
WIN3D* w,
double f0,
double f1);
318 int ZSetCenter3D(
WIN3D* w,
double fx,
double fy,
double fz);
319 int ZInitShift3D(
WIN3D* w,
double x,
double y,
double z);
320 int ZShift3D(
WIN3D* w,
double fx,
double fy,
double fz);
321 int ZInitScale3D(
WIN3D* w,
double fx,
double fy,
double fz);
322 int ZScale3D(
WIN3D* w,
double fx,
double fy,
double fz);
323 int ZRoom3D(
WIN3D* w,
double rx1,
double ry1,
double rz1,
324 double rx2,
double ry2,
double rz2);
325 int ZSet4DColor(
ColorInd* ci,
int* clr,
int nc);
326 int ZClear3Depth(
WIN3D* w);
327 int ZSet3DWindowClip(
WIN3D* w);
328 int ZInitColorInd(
ColorInd* ci,
int nind,
int* colors,
int nc);
331 int ZGetNObject(
ORool* o);
338 int ZSetMaxImage(
WIN3D* w);
339 int ZSetImageSize(
WIN3D* w,
int x1,
int y1,
int x2,
int y2);
340 int ZDeleteObjectsByName(
ORool* o,
char* name);
341 int ZoDraw4DObjects(
WIN3D* w,
ORool* o,
int q,
int cl,
int pt);
361 WIN3D* w2,
int ix1,
int iy1,
int ix2,
int iy2,
int xy);
362 double ZGetDepth(
WIN3D* w,
int x,
int y);
363 double ZglDepth(
WIN3D* w,
int x,
int y);
364 double ZGetDepth(
WIN3D* w,
int x,
int y);
365 double ZDrawTriangleGetDepth(
WIN3D* w,
double x,
double y,
368 int GetCubeValue(
DVData* d,
double x,
double y,
double z,
double* v);
370 int YtMalloc(
void *m,
long n);
371 void* YtFree(
void *m);
373 extern Uchar gl_colors[128];
376 extern Uchar my_rgb[256][3];
377 extern XEvent ZEvent;
378 extern XtAppContext Zapp_context;