1*e24b481bSBarry Smith /* $Id: viewer.h,v 1.56 1998/09/25 03:16:46 bsmith Exp bsmith $ */ 284cb2905SBarry Smith /* 384cb2905SBarry Smith Viewers are objects where other objects can be looked at or stored. 484cb2905SBarry Smith */ 53c119ea2SBarry Smith 688d459dfSBarry Smith #if !defined(__VIEWER_H) 788d459dfSBarry Smith #define __VIEWER_H 82eb8c8abSBarry Smith 9f09e8eb9SSatish Balay typedef struct _p_Viewer* Viewer; 103c119ea2SBarry Smith 113c119ea2SBarry Smith /* 123c119ea2SBarry Smith petsc.h must be included AFTER the definition of Viewer for ADIC to 133c119ea2SBarry Smith process correctly. 143c119ea2SBarry Smith */ 152eb8c8abSBarry Smith #include "petsc.h" 162eb8c8abSBarry Smith 172eb8c8abSBarry Smith #define VIEWER_COOKIE PETSC_COOKIE+1 18bcd2baecSBarry Smith typedef enum { MATLAB_VIEWER,ASCII_FILE_VIEWER, ASCII_FILES_VIEWER, 19488ecbafSBarry Smith BINARY_FILE_VIEWER, STRING_VIEWER, DRAW_VIEWER, 20488ecbafSBarry Smith AMS_VIEWER} ViewerType; 212eb8c8abSBarry Smith 22e26ad7d8SSatish Balay extern int ViewerFileOpenASCII(MPI_Comm,const char[],Viewer*); 234b0e389bSBarry Smith typedef enum {BINARY_RDONLY, BINARY_WRONLY, BINARY_CREATE} ViewerBinaryType; 24e26ad7d8SSatish Balay extern int ViewerFileOpenBinary(MPI_Comm,const char[],ViewerBinaryType,Viewer*); 25e26ad7d8SSatish Balay extern int ViewerMatlabOpen(MPI_Comm,const char[],int,Viewer*); 26e26ad7d8SSatish Balay extern int ViewerStringOpen(MPI_Comm,char[],int, Viewer*); 27e26ad7d8SSatish Balay extern int ViewerDrawOpenX(MPI_Comm,const char[],const char[],int,int,int,int,Viewer*); 28e26ad7d8SSatish Balay extern int ViewerDrawOpenVRML(MPI_Comm,const char[],const char[],Viewer*); 29d64ed03dSBarry Smith extern int ViewerDrawClear(Viewer); 304b0e389bSBarry Smith 31488ecbafSBarry Smith 32bcd2baecSBarry Smith extern int ViewerGetType(Viewer,ViewerType*); 339651b370SBarry Smith extern int ViewerDestroy(Viewer); 34ae39576cSLois Curfman McInnes 3590ace30eSBarry Smith extern int ViewerASCIIGetPointer(Viewer,FILE**); 36e1311b90SBarry Smith 3790ace30eSBarry Smith extern int ViewerBinaryGetDescriptor(Viewer,int*); 38496e697eSBarry Smith extern int ViewerBinaryGetInfoPointer(Viewer,FILE **); 3990ace30eSBarry Smith 40639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_DEFAULT 0 41639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_MATLAB 1 42639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_IMPL 2 43639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO 3 44639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_INFO_LONG 4 45639f9d9dSBarry Smith #define VIEWER_FORMAT_ASCII_COMMON 5 4609b0ea9bSLois Curfman McInnes #define VIEWER_FORMAT_ASCII_SYMMODU 6 4747e7184fSBarry Smith #define VIEWER_FORMAT_ASCII_INDEX 7 48*e24b481bSBarry Smith #define VIEWER_FORMAT_ASCII_DENSE 8 49090de74eSSatish Balay 50639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_DEFAULT 0 51639f9d9dSBarry Smith #define VIEWER_FORMAT_BINARY_NATIVE 1 52090de74eSSatish Balay 535311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_BASIC 0 545311e20fSBarry Smith #define VIEWER_FORMAT_DRAW_LG 1 550513a670SBarry Smith #define VIEWER_FORMAT_DRAW_CONTOUR 2 565311e20fSBarry Smith 57e26ad7d8SSatish Balay extern int ViewerSetFormat(Viewer,int,char[]); 58e26ad7d8SSatish Balay extern int ViewerPushFormat(Viewer,int,char[]); 595311e20fSBarry Smith extern int ViewerPopFormat(Viewer); 6090ace30eSBarry Smith extern int ViewerGetFormat(Viewer,int*); 6190ace30eSBarry Smith 625fe861cdSBarry Smith extern int ViewerFlush(Viewer); 6377c4ece6SBarry Smith extern int ViewerStringSPrintf(Viewer,char *,...); 644b0e389bSBarry Smith 656d4a8577SBarry Smith extern Viewer VIEWER_STDOUT_SELF; 666d4a8577SBarry Smith extern Viewer VIEWER_STDERR_SELF; 6725482d47SBarry Smith extern Viewer VIEWER_STDOUT_WORLD; 680752156aSBarry Smith extern Viewer VIEWER_STDOUT_(MPI_Comm); 690752156aSBarry Smith extern int VIEWER_STDOUT_Destroy(MPI_Comm); 70c22c1629SBarry Smith extern Viewer VIEWER_STDERR_WORLD; 710752156aSBarry Smith extern Viewer VIEWER_STDERR_(MPI_Comm); 720752156aSBarry Smith extern int VIEWER_STDERR_Destroy(MPI_Comm); 73639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_0; 74639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_1; 75639f9d9dSBarry Smith extern Viewer VIEWER_DRAWX_WORLD_PRIVATE_2; 765311e20fSBarry Smith extern Viewer VIEWER_DRAWX_SELF_PRIVATE; 77c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_WORLD_PRIVATE; 78c16cb8f2SBarry Smith extern Viewer VIEWER_MATLAB_SELF_PRIVATE; /* not yet used */ 795311e20fSBarry Smith 80cf256101SBarry Smith extern int ViewerInitializeDrawXWorld_Private_0(void); 81cf256101SBarry Smith extern int ViewerInitializeDrawXWorld_Private_1(void); 82cf256101SBarry Smith extern int ViewerInitializeDrawXWorld_Private_2(void); 83cf256101SBarry Smith extern int ViewerInitializeDrawXSelf_Private(void); 84cf256101SBarry Smith extern int ViewerInitializeMatlabWorld_Private(void); 8558562591SBarry Smith extern Viewer VIEWER_DRAWX_(MPI_Comm); 8656cd22aeSBarry Smith extern int VIEWER_DRAWX_Destroy(MPI_Comm); 875311e20fSBarry Smith 88639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_0 \ 89639f9d9dSBarry Smith (ViewerInitializeDrawXWorld_Private_0(),VIEWER_DRAWX_WORLD_PRIVATE_0) 90639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_1 \ 91639f9d9dSBarry Smith (ViewerInitializeDrawXWorld_Private_1(),VIEWER_DRAWX_WORLD_PRIVATE_1) 92639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD_2 \ 93639f9d9dSBarry Smith (ViewerInitializeDrawXWorld_Private_2(),VIEWER_DRAWX_WORLD_PRIVATE_2) 94639f9d9dSBarry Smith 955311e20fSBarry Smith #define VIEWER_DRAWX_SELF \ 965311e20fSBarry Smith (ViewerInitializeDrawXSelf_Private(),VIEWER_DRAWX_SELF_PRIVATE) 97639f9d9dSBarry Smith #define VIEWER_DRAWX_WORLD VIEWER_DRAWX_WORLD_0 98e1311b90SBarry Smith 99c16cb8f2SBarry Smith #define VIEWER_MATLAB_WORLD \ 100c16cb8f2SBarry Smith (ViewerInitializeMatlabWorld_Private(),VIEWER_MATLAB_WORLD_PRIVATE) 101c16cb8f2SBarry Smith 1022bdab257SBarry Smith extern int ViewersDrawOpenX(MPI_Comm,char *,char **,int,int,int,Viewer**); 103e26ad7d8SSatish Balay extern int ViewersDestroy(int,Viewer[]); 1042bdab257SBarry Smith 105cb5b572fSBarry Smith #if defined(HAVE_AMS) 106cb5b572fSBarry Smith #include "ams.h" 107cb5b572fSBarry Smith extern int ViewerAMSGetAMSComm(Viewer,AMS_Comm *); 108cb5b572fSBarry Smith extern int ViewerAMSOpen(MPI_Comm,const char[],Viewer*); 109cb5b572fSBarry Smith extern Viewer VIEWER_AMS_(MPI_Comm); 110cb5b572fSBarry Smith extern int VIEWER_AMS_Destroy(MPI_Comm); 111cb5b572fSBarry Smith extern Viewer VIEWER_AMS_WORLD_PRIVATE; 112cb5b572fSBarry Smith extern int ViewerInitializeAMSWorld_Private(void); 113cb5b572fSBarry Smith #define VIEWER_AMS_WORLD (ViewerInitializeAMSWorld_Private(),VIEWER_AMS_WORLD_PRIVATE) 1142eb8c8abSBarry Smith #endif 115cb5b572fSBarry Smith 116cb5b572fSBarry Smith #endif 117cb5b572fSBarry Smith 118