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

📄 xgrafixint.h

📁 xgrafix 是PTSG模拟程序中的图形截面库 改版本是最新版本
💻 H
字号:
#ifndef XGRAFIXINT_H#define XGRAFIXINT_H/************************//* Including the C libs */#include <stdio.h>#include <unistd.h>#include <malloc.h>#include <string.h>#include <time.h>#include <math.h>#include <stdlib.h>/************************//* Including the X libs */#include <X11/Xlib.h>#include <X11/Xutil.h>/*****************************//* Including the Tcl/Tk libx */#include <tcl.h>#include <tk.h>/********************//* Some data macros */#include "xgdatamacros.h"/*****************************//* the non-X global variables and data types */#include "xgminint.h"/****************************************//* XGrafix version number               */static char *xgversion = "2.60";/****************************************//* Definition of colors used in XGrafix */static char *WindowTextColor   = "cyan";static char *BorderColor       = "red";static char *TickMarkColor     = "yellow";static char *BackgroundColor   = "black";#define		MAXGRAYSHADES	 11static char *theGrayShades[]={	"gray0",  "gray10", "gray20",				"gray30", "gray40", "gray50",				"gray60", "gray70", "gray80",				"gray90", "gray100"};#define		MAXCOLORS	 9static char *theColorNames[]={	"cyan", "wheat", "green", 				"yellow", "orange", "pink",				"lightblue", "brown", "red"};#define		MAXTHREEDCOLORS	61static char *theTDColorNames[]={"00", "20", "35", "50", "70", "90",				"a5", "b9", "d0", "e5", "ff"};static char *theTDPSColorNames[]={"0.0 ", "0.1 ", "0.2 ", "0.3 ",				  "0.4 ", "0.5 ", "0.6 ", "0.7 ",				  "0.8 ", "0.9 ", "1.0 "};/****************************************/static char *theFontName = "variable";typedef struct window_struct *WindowType;struct window_struct {  int             ulxc;  int             ulyc;  int             lrxc;  int             lryc;  int             state;  DataType        data;  LabelType       label;  SCALAR          theta;  SCALAR          phi;  char            eps_file_name[MAX_BUFFER_SIZE];  char            plot_title[MAX_BUFFER_SIZE];  GC              xwingc;  Pixmap          pixmap_buffer;  void            (*paint_function) (WindowType);  void            (*print_function) (WindowType, char*, char*);  void            (*ascii_print_function) (WindowType, char*, char);  void            (*xgrafix_print_function) (WindowType, char*, char);  Tk_Window       tkwin;  MeshType      **theMesh;  double          c1,d1,c2,d2;  int             mstart, mend, nstart, nend, xSize, ySize;  StructType     *structures;  int            *openFlag;  char            type;};typedef struct string_struct {  char            buffer[20];  SCALAR          x;  SCALAR          y;}               StringType;/********************************************//********************************************//* Global variables used in XGRAFIX         */WindowType     *theWindowArray;int             sizeIncrement;int             sizeOfWindowArray;int             numberOfWindows; /* Variables for Special Button List, Payam 7.92 *//* List changed to array, Don 7.94 */SpecialType    *theSpecialArray; int             specialSizeIncrement;int             sizeOfSpecialArray;int             numberOfSpecials;double          theCrosshairmx, theCrosshairbx;double          theCrosshairmy, theCrosshairby;int             theCrosshairx1, theCrosshairx2;int             theCrosshairy1, theCrosshairy2;Font            theFont;XFontStruct    *theFontStruct;int             theFontAscent;int             theFontDescent;int             theFontHeight;char            ReqDisp[120];Display        *theDisplay;int             theDisplayWidth;int             theDisplayHeight;Window          theRootWindow;int             theScreen;int             theDepth;unsigned long   theBlackPixel;unsigned long   theWhitePixel;Colormap        theColormap;int             theWinTextColor;int             theDBTextColor;int             theBorderColor;int             theTickMarkColor;int             theBKGDColor;int             GrayShade[MAXGRAYSHADES];int             Color[MAXCOLORS];SCALAR          RedColor[MAXCOLORS];SCALAR          GreenColor[MAXCOLORS];SCALAR          BlueColor[MAXCOLORS];int             ThreeDColor[MAXTHREEDCOLORS];char            ThreeDPSColor[MAXTHREEDCOLORS][20];SCALAR          init_theta, init_phi;Tcl_Interp     *interp;char            TclCommand[255];Tk_Window       mainWindow;WindowType      theNewWindow;int             theRunWithXFlag;/*int             theExitFlag;*/void            XpmToGif(char **xpmData, char *outFile);DataType        SetupDataStruct(void);LabelType       SetupLabelStruct(void);int             xindex_3d_plots;int             yindex_3d_plots;int             zindex_3d_plots;int             windex_3d_plots;SCALAR        **xplot3d[MAX_3D_PLOTS];SCALAR        **yplot3d[MAX_3D_PLOTS];SCALAR        **zplot3d[MAX_3D_PLOTS];SCALAR        **wplot3d[MAX_3D_PLOTS];short           ToShort(SCALAR);int             findlen(char *);void            Paint_Window(WindowType);void            Paint_Vector_Window(WindowType);void            Paint_ThreeD_Window(WindowType);void            PostScriptOpenWindow(WindowType, char*, char*);void            PostScript_ThreeD_Window(WindowType, char*, char*);void            PostScript_Vector_Window(WindowType, char*, char*);void            Ascii_ThreeD_Window(WindowType, char*, char);void            Ascii_TwoD_Window(WindowType, char*, char);void            Ascii_Vector_Window(WindowType, char*, char);void            XGInit(int argc, char **argv, double *t);void            XGInitX(void);void            XGInitTclTk(void);void 	        XGSetVec(char *type, char *xlabel, char *ylabel, 			 char *zlabel, char *state, int ulx, 			 int uly, SCALAR xscale, SCALAR yscale, 			 int xautorescale, int yautorescale, 			 SCALAR xmin, SCALAR xmax, SCALAR ymin,			 SCALAR ymax);void 	        XGSet2D(char *type, char *xlabel, char *ylabel, 			char *state, int ulx, int uly, SCALAR xscale,			SCALAR yscale, int xautorescale, 			int yautorescale, SCALAR xmin, SCALAR xmax, 			SCALAR ymin, SCALAR ymax);void 	        XGSet2D_OS(char *type, char *xlabel, char *ylabel, 			char *state, int ulx, int uly, SCALAR xoffset,			SCALAR yoffset, SCALAR xscale,			SCALAR yscale, int xautorescale, 			int yautorescale, SCALAR xmin, SCALAR xmax, 			SCALAR ymin, SCALAR ymax);void 	        XGSet2DC(char *type, char *xlabel, char *ylabel, 			 char *zlabel, char *state, int ulx,			 int uly, SCALAR xscale, SCALAR yscale,			 SCALAR zscale, int xautorescale, 			 int yautorescale, int zautorescale, 			 SCALAR xmin, SCALAR xmax, SCALAR ymin, 			 SCALAR ymax, SCALAR zmin, SCALAR zmax);void 	        XGSet3D(char *type, char *xlabel, char *ylabel, 			char *zlabel, SCALAR theta, SCALAR phi,			char *state, int ulx, int uly, SCALAR xscale, 			SCALAR yscale, SCALAR zscale, 			int xautorescale, int yautorescale, 			int zautorescale, SCALAR xmin, SCALAR xmax, 			SCALAR ymin, SCALAR ymax, SCALAR zmin, 			SCALAR zmax);void 	        XGVector(SCALAR *xdata, SCALAR *ydata, 			 SCALAR **zdata, SCALAR **wdata, int *mpoints,			 int *npoints, int color);void            XGVectorVector(SCALAR *xdata, SCALAR *ydata, 			       SCALAR **zdata, SCALAR **wdata, 			       int *mpoints, int *npoints, int color,			       int xSize, int xOffset, int ySize, 			       int yOffset, int zSize, int zOffset, 			       int wSize, int wOffset);     void 	        XGSurf(SCALAR *xdata, SCALAR *ydata, 		       SCALAR **zdata, int *mpoints, int *npoints, 		       int color);void  	        XGSurfVector(SCALAR *xdata, SCALAR *ydata, 			     SCALAR **zdata, int *mpoints, int *npoints,			     int color, int xSize, int xOffset, 			     int ySize, int yOffset, int zSize, 			     int zOffset);void 	        XGCurve(SCALAR *xdata, SCALAR *ydata, 			int *npoints, int color);void  	        XGCurveVector(SCALAR *xdata, SCALAR *ydata, 			int *npoints, int color, int xSize, int xOffset,			int ySize, int yOffset);void 	        XGIRSurf(SCALAR **xdata, SCALAR **ydata, 			 SCALAR **zdata, int *mpoints, int *nponits, 			 int color);void 	        XGIRSurfVector(SCALAR **xdata, SCALAR **ydata, 			       SCALAR **zdata, int *mpoints, 			       int *npoints, int color, int xSize, 			       int xOffset, int ySize, int yOffset,			       int zSize, int zOffset);void            XGScat2D(SCALAR *xdata, SCALAR *ydata, 			  int *npoints, int color);void            XGScat3D(SCALAR *xdata, SCALAR *ydata, 			  SCALAR *zdata, int *npoints, int color);void            XGCont(SCALAR *xdata, SCALAR *data, 			SCALAR **zdata, int *mpoints, int *npoints, 			int color);void 		XGStart(void);void            XGMainLoop(void);int 		C_UpdateCrosshairProc _ANSI_ARGS_ ((ClientData, Tcl_Interp *, 		int, char **));int 		C_SetCrosshairParametersProc _ANSI_ARGS_ ((ClientData,		Tcl_Interp *, int, char **));void 		XG_Setup_Pixmap(WindowType);void 		Setup(void);void 		Main(void);void 		RedrawWindow(WindowType);void 		DoGraphics(ClientData);void 		DoMain(ClientData);void 		SortWindows(void);int 		Search(char *);void 		XGSetupWindow(char *, char *, int, int, int, DataType, 		LabelType, int);void 		InitTclCommands(void);void 		PSHeader(char *);void 		XG_Copy_Pixmap(WindowType);void 		ReallocateWindows(void);void 		SetUpNewVar(void *, char *, char *);void		Dump(char *);void		Quit(void);void            DrawCrosshair(WindowType, int, int);void            RescaleTwoDWindow(WindowType theWindow);void            RescaleVectorDWindow(WindowType theWindow, int *ms, int *me, 				     int *ns, int *ne);void            RescaleThreeDWindow(WindowType theWindow, int *ms, int *me, 				    int *ns, int *ne);void XGWriteLabel(LabelType theLabel, FILE *fp);void XGWriteStructures(StructType *structures, char *filename);void XGRead(void *ptr,int size,int nitems,FILE * stream,char * type);void Bin_Vector_Window(WindowType theWindow, char *filename, char type);void Bin_ThreeD_Window(WindowType theWindow, char *filename, char type);void Bin_TwoD_Window(WindowType theWindow, char *filename, char type);extern void	       XGStructureArray(int npoints, STRUCT_FILL fillFlag, int linecolor, int fillcolor, SCALAR *points);#endif /* XGRAFIXINT_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -