#ifndef _XGRAFIXINT_H #define _XGRAFIXINT_H #include #include #include #include #include #include #include #include #include #include /********************/ /* Some data macros */ #include "xgdatamacros.h" /*****************************/ /* the non-X global variables and data types */ #include "xgminint.h" #ifdef USE_STATIC # define USE_THECOLORNAMES # define USE_XGVERSION #endif /****************************************/ /* XGrafix version number */ #ifdef USE_XGVERSION static char *xgversion = "2.50"; #endif /* #ifdef USE_XGVERSION */ /****************************************/ /* Definition of colors used in XGrafix */ #ifdef USE_STATIC static char *WindowTextColor = "cyan"; static char *BorderColor = "red"; static char *TickMarkColor = "yellow"; static char *BackgroundColor = "black"; #endif /* #ifdef USE_STATIC */ #define MAXGRAYSHADES 11 #ifdef USE_STATIC static char *theGrayShades[]={ "gray0", "gray10", "gray20", "gray30", "gray40", "gray50", "gray60", "gray70", "gray80", "gray90", "gray100"}; #endif /* #ifdef USE_STATIC */ #define MAXCOLORS 9 #ifdef USE_THECOLORNAMES static char *theColorNames[]={ "cyan", "wheat", "green", "yellow", "orange", "pink", "lightblue", "brown", "red"}; #endif /* #ifdef USE_THECOLORNAMES */ #define MAXTHREEDCOLORS 61 #ifdef USE_STATIC static 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 "}; #endif /* #ifdef USE_STATIC */ /****************************************/ #ifdef USE_STATIC static char *theFontName = "variable"; #endif /* #ifdef USE_STATIC */ // typedef struct window_struct {...} *WindowType; {{{ typedef 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) (); void (*print_function) (); void (*ascii_print_function) (); void (*xgrafix_print_function) (); Tk_Window tkwin; MeshType **theMesh; double c1,d1,c2,d2; int mstart, mend, nstart, nend, xSize, ySize; StructType *structures; int *openFlag; char type; } *WindowType; // }}} // typedef struct string_struct {...} StringType; {{{ 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; 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]; float RedColor[MAXCOLORS]; float GreenColor[MAXCOLORS]; float BlueColor[MAXCOLORS]; int ThreeDColor[MAXTHREEDCOLORS]; char ThreeDPSColor[MAXTHREEDCOLORS][20]; SCALAR init_theta, init_phi; Tcl_Interp *interp; #define TclCommand_MAX 4096 char TclCommand[TclCommand_MAX]; 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]; extern int xgDebug; // }}} // Functions defined in XGRAFIX {{{ void Paint_Window(WindowType theWindow); void Paint_Vector_Window(WindowType theWindow); void Paint_ThreeD_Window(WindowType theWindow); void PostScriptOpenWindow(WindowType theWindow, char *eps_file_name, char *plot_title); void PostScript_ThreeD_Window(WindowType theWindow, char *eps_file_name, char *plot_title); void PostScript_Vector_Window(WindowType theWindow, char *eps_file_name, char *plot_title); void Ascii_ThreeD_Window(WindowType theWindow, char *filename, char *type); void Ascii_TwoD_Window(WindowType theWindow, char *filename, char *type); void Ascii_Vector_Window(WindowType theWindow, char *filename, char *type); 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 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 *ydata, SCALAR **zdata, int *mpoints, int *npoints, int color); void XGStart(void); void XGMainLoop(void); int C_UpdateCrosshairProc _ANSI_ARGS_ (( ClientData cl, Tcl_Interp *interp, int argc, char **argv)); int C_SetCrosshairParametersProc _ANSI_ARGS_ (( ClientData cl, Tcl_Interp *interp, int argc, char **argv)); void XG_Setup_Pixmap(WindowType theWindow); void Setup(void); void Main(void); void RedrawWindow(WindowType theWindow); void DoGraphics(ClientData cl); void DoMain(ClientData cl); void SortWindows(void); int Search(char *WinTitle); void XGSetupWindow(char *Win_Title, char *State, int ulx, int uly, int WinType, DataType data_ptr, LabelType label_ptr, int PlotType); void PSHeader(char *filename); void XG_Copy_Pixmap(WindowType theWindow); void ReallocateWindows(void); void SetUpNewVar(void *spvar, char *spname, char *type); void Dump(char *filename); void Quit(void); void DrawCrosshair(WindowType theWindow, int xindex, int yindex); 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); void XGStructureArray(int npoints, STRUCT_FILL fillFlag, int linecolor, int fillcolor, SCALAR *points); // }}} #endif /* #ifndef _XGRAFIXINT_H */ // Modeline for ViM {{{1 // vim:set ts=4: // vim600:fdm=marker fdl=0 fdc=3: // 1}}}