📄 xginitf.c
字号:
#include "xgrafixint.h"#include <stdlib.h>#ifdef __STDC__#include <stdarg.h>#else#include <varargs.h>#endif#ifdef UNICOSextern void XGMAINLOOP(void);#else#ifdef IBMextern void xgmainloop(void);#else#ifdef HPextern void xgmainloop(void);#elseextern void xgmainloop_(void);#endif#endif#endif/***********************************************************************//* FORTRAN callable routines *//***********************************************************************/void#ifdef UNICOSINITXG(number_of_names,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,thetime)#else#ifdef IBMinitxg(number_of_names,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,thetime)#else#ifdef HPinitxg(number_of_names,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,thetime)#elseinitxg_(number_of_names,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,thetime)#endif#endif#endif int *number_of_names; double *thetime; char *n1,*n2,*n3,*n4,*n5,*n6,*n7,*n8,*n9,*n10,*n11,*n12,*n13,*n14,*n15,*n16; { char *names[16]; int i; xindex_3d_plots = 0; yindex_3d_plots = 0; zindex_3d_plots = 0; /* Write the NAMEn strings into the NAMES array. */ names[0] = n1; names[1] = n2; names[2] = n3; names[3] = n4; names[4] = n5; names[5] = n6; names[6] = n7; names[7] = n8; names[8] = n9; names[9] = n10; names[10] = n11; names[11] = n12; names[12] = n13; names[13] = n14; names[14] = n15; names[15] = n16; /* Initialize the XGrafix package. */ XGInit(*number_of_names, names, thetime);}/*****************************************************************/void#ifdef UNICOSSTARTXG()#else#ifdef IBMstartxg()#else#ifdef HPstartxg()#elsestartxg_()#endif#endif#endif{ XGStart();}/***********************************************************************/void#ifdef UNICOSSETVECXG(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max)#else#ifdef IBMsetvecxg(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max)#else#ifdef HPsetvecxg(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max)#elsesetvecxg_(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max)#endif#endif#endif char *PlotType;/* "vecvec" */ char *X_Label; /* x label for the frame */ char *Y_Label; /* y label for the frame */ char *Z_Label; /* z label for the frame */ char *State; /* "open" or "iconic" */ int *ulx,*uly;/* requested position of frame's upper left coner*/ SCALAR *X_Scale; /* scaling factor for the x array */ SCALAR *Y_Scale; /* scaling factor for the y array */ int *X_Auto_Rescale;/* if True X_Min and X_Max are neglected */ int *Y_Auto_Rescale;/* if True Y_Min and Y_Max are neglected */ SCALAR *X_Min, *X_Max; /* x bounds for the plot if x-autorescale if False */ SCALAR *Y_Min, *Y_Max; /* y bounds for the plot if y-autorescale if False */{ int plottype; DataType data_ptr = NULL; LabelType label_ptr; label_ptr = SetupLabelStruct(); label_ptr->Z_Label = Z_Label; label_ptr->Z_Auto_Rescale = 0; label_ptr->Y_Label = X_Label; label_ptr->Y_Min = *X_Min; label_ptr->Y_Max = *X_Max; label_ptr->Y_Scale = *X_Scale; label_ptr->Y_Auto_Rescale = *X_Auto_Rescale; label_ptr->X_Label = Y_Label; label_ptr->X_Min = *Y_Min; label_ptr->X_Max = *Y_Max; label_ptr->X_Scale = *Y_Scale; label_ptr->X_Auto_Rescale = *Y_Auto_Rescale; if (!strcmp(PlotType, "vecvec")) plottype = VEC_VEC; else { printf("Unrecognized plot string '%s' for Window '%s'.\n", PlotType, Y_Label); exit(-1); } XGSetupWindow(Z_Label,State,*ulx,*uly,VECD, data_ptr, label_ptr, plottype);}/***********************************************************************/void#ifdef UNICOSSETVECXGFLAG(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, openFlag)#else#ifdef IBMsetvecxgflag(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, openFlag)#else#ifdef HPsetvecxgflag(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, openFlag)#elsesetvecxgflag_(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, openFlag)#endif#endif#endif char *PlotType;/* "vecvec" */ char *X_Label; /* x label for the frame */ char *Y_Label; /* y label for the frame */ char *Z_Label; /* z label for the frame */ char *State; /* "open" or "iconic" */ int *ulx,*uly;/* requested position of frame's upper left coner*/ SCALAR *X_Scale; /* scaling factor for the x array */ SCALAR *Y_Scale; /* scaling factor for the y array */ int *X_Auto_Rescale;/* if True X_Min and X_Max are neglected */ int *Y_Auto_Rescale;/* if True Y_Min and Y_Max are neglected */ SCALAR *X_Min, *X_Max; /* x bounds for the plot if x-autorescale if False */ SCALAR *Y_Min, *Y_Max; /* y bounds for the plot if y-autorescale if False */ int *openFlag;{ int plottype; DataType data_ptr = NULL; LabelType label_ptr; label_ptr = SetupLabelStruct(); label_ptr->Z_Label = Z_Label; label_ptr->Z_Auto_Rescale = 0; label_ptr->Y_Label = X_Label; label_ptr->Y_Min = *X_Min; label_ptr->Y_Max = *X_Max; label_ptr->Y_Scale = *X_Scale; label_ptr->Y_Auto_Rescale = *X_Auto_Rescale; label_ptr->X_Label = Y_Label; label_ptr->X_Min = *Y_Min; label_ptr->X_Max = *Y_Max; label_ptr->X_Scale = *Y_Scale; label_ptr->X_Auto_Rescale = *Y_Auto_Rescale; if (!strcmp(PlotType, "vecvec")) plottype = VEC_VEC; else { printf("Unrecognized plot string '%s' for Window '%s'.\n", PlotType, Y_Label); exit(-1); } XGSetupWindow(Z_Label,State,*ulx,*uly,VECD, data_ptr, label_ptr, plottype); theWindowArray[numberOfWindows -1]->openFlag = openFlag;}/***********************************************************************/void#ifdef UNICOSSET2DXG(PlotType, X_Label, Y_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max)#else#ifdef IBMset2dxg(PlotType, X_Label, Y_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max)#else#ifdef HPset2dxg(PlotType, X_Label, Y_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max)#elseset2dxg_(PlotType, X_Label, Y_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max)#endif#endif#endif char *PlotType;/* "linlin", "linlog", "loglog", or "loglin" */ char *X_Label; /* x label for the frame */ char *Y_Label; /* y label for the frame */ SCALAR *X_Scale; /* scaling factor for the x array */ SCALAR *Y_Scale; /* scaling factor for the y array */ char *State; /* "open" or "iconic" */ int *ulx, *uly;/* requested position of frame's upper left coner */ int *X_Auto_Rescale;/* if True X_Min and X_Max are * neglected */ int *Y_Auto_Rescale;/* if True Y_Min and Y_Max are * neglected */ SCALAR *X_Min, *X_Max;/* x bounds for the plot if x-autorescale if False*/ SCALAR *Y_Min, *Y_Max;/* y bounds for the plot if y-autorescale if False*/{ int plottype; DataType data_ptr = NULL; LabelType label_ptr; label_ptr = SetupLabelStruct(); label_ptr->Y_Label = Y_Label; label_ptr->Y_Min = *Y_Min; label_ptr->Y_Max = *Y_Max; label_ptr->Y_Scale = *Y_Scale; label_ptr->Y_Auto_Rescale = *Y_Auto_Rescale; label_ptr->X_Label = X_Label; label_ptr->X_Min = *X_Min; label_ptr->X_Max = *X_Max; label_ptr->X_Scale = *X_Scale; label_ptr->X_Auto_Rescale = *X_Auto_Rescale; if (!strcmp(PlotType, "linlin")) plottype = LIN_LIN; else if (!strcmp(PlotType, "linlog")) plottype = LIN_LOG; else if (!strcmp(PlotType, "loglog")) plottype = LOG_LOG; else if (!strcmp(PlotType, "loglin")) plottype = LOG_LIN; else { printf("Unrecognized plot string '%s' for Window '%s'.\n", PlotType, Y_Label); exit(-1); } XGSetupWindow(Y_Label,State,*ulx,*uly,TWOD,data_ptr, label_ptr,plottype);}/***********************************************************************/void#ifdef UNICOSSET2DXGFLAG(PlotType, X_Label, Y_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, openFlag)#else#ifdef IBMset2dxgflag(PlotType, X_Label, Y_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, openFlag)#else#ifdef HPset2dxgflag(PlotType, X_Label, Y_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max,openFlag)#elseset2dxgflag_(PlotType, X_Label, Y_Label, State, ulx, uly, X_Scale, Y_Scale, X_Auto_Rescale, Y_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max,openFlag)#endif#endif#endif char *PlotType;/* "linlin", "linlog", "loglog", or "loglin" */ char *X_Label; /* x label for the frame */ char *Y_Label; /* y label for the frame */ SCALAR *X_Scale; /* scaling factor for the x array */ SCALAR *Y_Scale; /* scaling factor for the y array */ char *State; /* "open" or "iconic" */ int *ulx, *uly;/* requested position of frame's upper left coner */ int *X_Auto_Rescale;/* if True X_Min and X_Max are * neglected */ int *Y_Auto_Rescale;/* if True Y_Min and Y_Max are * neglected */ SCALAR *X_Min, *X_Max;/* x bounds for the plot if x-autorescale if False*/ SCALAR *Y_Min, *Y_Max;/* y bounds for the plot if y-autorescale if False*/ int *openFlag;{ int plottype; DataType data_ptr = NULL; LabelType label_ptr; label_ptr = SetupLabelStruct(); label_ptr->Y_Label = Y_Label; label_ptr->Y_Min = *Y_Min; label_ptr->Y_Max = *Y_Max; label_ptr->Y_Scale = *Y_Scale; label_ptr->Y_Auto_Rescale = *Y_Auto_Rescale; label_ptr->X_Label = X_Label; label_ptr->X_Min = *X_Min; label_ptr->X_Max = *X_Max; label_ptr->X_Scale = *X_Scale; label_ptr->X_Auto_Rescale = *X_Auto_Rescale; if (!strcmp(PlotType, "linlin")) plottype = LIN_LIN; else if (!strcmp(PlotType, "linlog")) plottype = LIN_LOG; else if (!strcmp(PlotType, "loglog")) plottype = LOG_LOG; else if (!strcmp(PlotType, "loglin")) plottype = LOG_LIN; else { printf("Unrecognized plot string '%s' for Window '%s'.\n", PlotType, Y_Label); exit(-1); } XGSetupWindow(Y_Label,State,*ulx,*uly,TWOD,data_ptr, label_ptr,plottype); theWindowArray[numberOfWindows -1]->openFlag = openFlag;}/****************************************************************************/void#ifdef UNICOSSET2DCXG(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, Z_Scale, X_Auto_Rescale, Y_Auto_Rescale, Z_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, Z_Min, Z_Max)#else#ifdef IBMset2dcxg(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, Z_Scale, X_Auto_Rescale, Y_Auto_Rescale, Z_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, Z_Min, Z_Max)#else#ifdef HPset2dcxg(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, Z_Scale, X_Auto_Rescale, Y_Auto_Rescale, Z_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, Z_Min, Z_Max)#elseset2dcxg_(PlotType, X_Label, Y_Label, Z_Label, State, ulx, uly, X_Scale, Y_Scale, Z_Scale, X_Auto_Rescale, Y_Auto_Rescale, Z_Auto_Rescale, X_Min, X_Max, Y_Min, Y_Max, Z_Min, Z_Max)#endif#endif#endif char *PlotType; /* "linlinlin", "linlinlog", "linloglog", etc. */ char *X_Label; /* x label for the frame */ char *Y_Label; /* y label for the frame */ char *Z_Label; /* z label for the frame */ char *State; /* "open" or "iconic" */ int *ulx, *uly; /* requested position of frame's upper left coner*/ SCALAR *X_Scale; /* scaling factor for the x array */ SCALAR *Y_Scale; /* scaling factor for the y array */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -