1*0752156aSBarry Smith /* $Id: draw.h,v 1.47 1997/08/13 22:27:41 bsmith Exp bsmith $ */ 243e6b640SBarry Smith /* 337f753daSBarry Smith Interface to the graphics 443e6b640SBarry Smith */ 51eb62cbbSBarry Smith #if !defined(__DRAW_PACKAGE) 61eb62cbbSBarry Smith #define __DRAW_PACKAGE 7d6dfbf8fSBarry Smith #include "petsc.h" 843e6b640SBarry Smith 99e25ed09SBarry Smith #define DRAW_COOKIE PETSC_COOKIE+6 10f0479e8cSBarry Smith 11d6dfbf8fSBarry Smith /* types of draw contexts */ 126d4a8577SBarry Smith #define DRAW_XWINDOW 0 136d4a8577SBarry Smith #define DRAW_NULLWINDOW 1 146d4a8577SBarry Smith #define DRAW_VRML 2 15d6dfbf8fSBarry Smith 16783d1d5eSSatish Balay typedef struct _p_Draw* Draw; 1743e6b640SBarry Smith 18*0752156aSBarry Smith /* 19*0752156aSBarry Smith Number of basic colors in the draw routines, the others are used 20*0752156aSBarry Smith for a uniform colormap. 21*0752156aSBarry Smith */ 22*0752156aSBarry Smith #define DRAW_BASIC_COLORS 32 23*0752156aSBarry Smith 2420563c6bSBarry Smith #define DRAW_WHITE 0 2520563c6bSBarry Smith #define DRAW_BLACK 1 2620563c6bSBarry Smith #define DRAW_RED 2 27f8d5e24aSBarry Smith #define DRAW_GREEN 3 28f8d5e24aSBarry Smith #define DRAW_CYAN 4 29f8d5e24aSBarry Smith #define DRAW_BLUE 5 30f8d5e24aSBarry Smith #define DRAW_MAGENTA 6 31f8d5e24aSBarry Smith #define DRAW_AQUAMARINE 7 32f8d5e24aSBarry Smith #define DRAW_FORESTGREEN 8 33f8d5e24aSBarry Smith #define DRAW_ORANGE 9 34f8d5e24aSBarry Smith #define DRAW_VIOLET 10 35f8d5e24aSBarry Smith #define DRAW_BROWN 11 36f8d5e24aSBarry Smith #define DRAW_PINK 12 37f8d5e24aSBarry Smith #define DRAW_CORAL 13 38f8d5e24aSBarry Smith #define DRAW_GRAY 14 39f8d5e24aSBarry Smith #define DRAW_YELLOW 15 4020563c6bSBarry Smith 41*0752156aSBarry Smith #define DRAW_GOLD 16 42*0752156aSBarry Smith #define DRAW_LIGHTPINK 17 43*0752156aSBarry Smith #define DRAW_MEDIUMTURQUOISE 18 44*0752156aSBarry Smith #define DRAW_KHAKI 19 45*0752156aSBarry Smith #define DRAW_DIMGRAY 20 46*0752156aSBarry Smith #define DRAW_YELLOWGREEN 21 47*0752156aSBarry Smith #define DRAW_SKYBLUE 22 48*0752156aSBarry Smith #define DRAW_DARKGREEN 23 49*0752156aSBarry Smith #define DRAW_NAVYBLUE 24 50*0752156aSBarry Smith #define DRAW_SANDYBROWN 25 51*0752156aSBarry Smith #define DRAW_CADETBLUE 26 52*0752156aSBarry Smith #define DRAW_POWDERBLUE 27 53*0752156aSBarry Smith #define DRAW_DEEPPINK 28 54*0752156aSBarry Smith #define DRAW_THISTLE 29 55*0752156aSBarry Smith #define DRAW_LIMEGREEN 30 56*0752156aSBarry Smith #define DRAW_LAVENDERBLUSH 31 57*0752156aSBarry Smith 58*0752156aSBarry Smith 59d7e8b826SBarry Smith extern int DrawOpenX(MPI_Comm,char *,char *,int,int,int,int,Draw*); 60e340e5c6SBarry Smith extern int DrawOpenVRML( MPI_Comm, char *, char *, Draw * ); 61e340e5c6SBarry Smith 62d7e8b826SBarry Smith extern int DrawOpenNull(MPI_Comm,Draw *); 63d7e8b826SBarry Smith extern int DrawDestroy(Draw); 6419bcc07fSBarry Smith extern int DrawIsNull(Draw,PetscTruth*); 6543e6b640SBarry Smith 66d4fbbf0eSBarry Smith extern int DrawCreatePopUp(Draw,Draw*); 67d4fbbf0eSBarry Smith extern int DrawCheckResizedWindow(Draw); 68aa028dcaSBarry Smith extern int DrawResizeWindow(Draw,int,int); 69d4fbbf0eSBarry Smith 70df85ffc0SBarry Smith extern int DrawScalePopup(Draw,double min,double max); 715311e20fSBarry Smith 72d7e8b826SBarry Smith extern int DrawLine(Draw,double,double,double,double,int); 73d7e8b826SBarry Smith extern int DrawLineSetWidth(Draw,double); 749a28b0a6SLois Curfman McInnes extern int DrawLineGetWidth(Draw,double*); 7543e6b640SBarry Smith 76d7e8b826SBarry Smith extern int DrawPoint(Draw,double,double,int); 77d7e8b826SBarry Smith extern int DrawPointSetSize(Draw,double); 788ed539a5SBarry Smith 79d7e8b826SBarry Smith extern int DrawRectangle(Draw,double,double,double,double,int,int,int,int); 80d7e8b826SBarry Smith extern int DrawTriangle(Draw,double,double,double,double,double,double,int,int,int); 81c22c1629SBarry Smith extern int DrawTensorContourPatch(Draw,int,int,double*,double*,double,double,Scalar*); 828ed539a5SBarry Smith 837824c9abSSatish Balay extern int DrawString(Draw,double,double,int,char*); 847824c9abSSatish Balay extern int DrawStringVertical(Draw,double,double,int,char*); 857824c9abSSatish Balay extern int DrawStringSetSize(Draw,double,double); 867824c9abSSatish Balay extern int DrawStringGetSize(Draw,double*,double*); 87d6dfbf8fSBarry Smith 88d7e8b826SBarry Smith extern int DrawSetViewPort(Draw,double,double,double,double); 89d7e8b826SBarry Smith extern int DrawSetCoordinates(Draw,double,double,double,double); 90d7e8b826SBarry Smith extern int DrawGetCoordinates(Draw,double*,double*,double*,double*); 919e25ed09SBarry Smith 92d4fbbf0eSBarry Smith extern int DrawSetTitle(Draw,char *); 93d4fbbf0eSBarry Smith extern int DrawAppendTitle(Draw,char *); 94d4fbbf0eSBarry Smith extern int DrawGetTitle(Draw,char **); 95d4fbbf0eSBarry Smith 96d7e8b826SBarry Smith extern int DrawSetPause(Draw,int); 9777c4ece6SBarry Smith extern int DrawGetPause(Draw,int*); 9877c4ece6SBarry Smith extern int DrawPause(Draw); 99d7e8b826SBarry Smith extern int DrawSetDoubleBuffer(Draw); 100d7e8b826SBarry Smith extern int DrawFlush(Draw); 101d7e8b826SBarry Smith extern int DrawSyncFlush(Draw); 102d7e8b826SBarry Smith extern int DrawClear(Draw); 1031a20e397SBarry Smith extern int DrawSyncClear(Draw); 104e340e5c6SBarry Smith extern int DrawBOP(Draw); 105e340e5c6SBarry Smith extern int DrawEOP(Draw); 106cddf8d76SBarry Smith 107cddf8d76SBarry Smith typedef enum {BUTTON_NONE, BUTTON_LEFT, BUTTON_CENTER, BUTTON_RIGHT } DrawButton; 108d7e8b826SBarry Smith extern int DrawGetMouseButton(Draw,DrawButton *,double*,double *,double *,double *); 109005c665bSBarry Smith extern int DrawSyncGetMouseButton(Draw,DrawButton *,double*,double *,double *,double *); 11020563c6bSBarry Smith 111d69bd51fSBarry Smith /* 112d69bd51fSBarry Smith Routines for drawing X-Y axises in a Draw object 113d69bd51fSBarry Smith */ 1146254e6afSSatish Balay typedef struct _p_DrawAxis* DrawAxis; 1156d4a8577SBarry Smith #define DRAWAXIS_COOKIE PETSC_COOKIE+16 116d7e8b826SBarry Smith extern int DrawAxisCreate(Draw,DrawAxis *); 117d7e8b826SBarry Smith extern int DrawAxisDestroy(DrawAxis); 118d7e8b826SBarry Smith extern int DrawAxisDraw(DrawAxis); 119d7e8b826SBarry Smith extern int DrawAxisSetLimits(DrawAxis,double,double,double,double); 120d7e8b826SBarry Smith extern int DrawAxisSetColors(DrawAxis,int,int,int); 121d7e8b826SBarry Smith extern int DrawAxisSetLabels(DrawAxis,char*,char*,char*); 12220563c6bSBarry Smith 123d69bd51fSBarry Smith /* 124d69bd51fSBarry Smith Routines to draw line curves in X-Y space 125d69bd51fSBarry Smith */ 1266254e6afSSatish Balay typedef struct _p_DrawLG* DrawLG; 1276d4a8577SBarry Smith #define DRAWLG_COOKIE PETSC_COOKIE+7 128d7e8b826SBarry Smith extern int DrawLGCreate(Draw,int,DrawLG *); 129d7e8b826SBarry Smith extern int DrawLGDestroy(DrawLG); 130d7e8b826SBarry Smith extern int DrawLGAddPoint(DrawLG,double*,double*); 131d7e8b826SBarry Smith extern int DrawLGAddPoints(DrawLG,int,double**,double**); 132d7e8b826SBarry Smith extern int DrawLGDraw(DrawLG); 133d7e8b826SBarry Smith extern int DrawLGReset(DrawLG); 1345311e20fSBarry Smith extern int DrawLGSetDimension(DrawLG,int); 135d7e8b826SBarry Smith extern int DrawLGGetAxis(DrawLG,DrawAxis *); 136d7e8b826SBarry Smith extern int DrawLGGetDraw(DrawLG,Draw *); 137d7e8b826SBarry Smith extern int DrawLGIndicateDataPoints(DrawLG); 138d7e8b826SBarry Smith extern int DrawLGSetLimits(DrawLG,double,double,double,double); 13943e6b640SBarry Smith 140d69bd51fSBarry Smith /* 141d69bd51fSBarry Smith Routines to draw scatter plots in complex space 142d69bd51fSBarry Smith */ 1436254e6afSSatish Balay typedef struct _p_DrawSP* DrawSP; 144d4fbbf0eSBarry Smith #define DRAWSP_COOKIE PETSC_COOKIE+27 145d4fbbf0eSBarry Smith extern int DrawSPCreate(Draw,int,DrawSP *); 146d4fbbf0eSBarry Smith extern int DrawSPDestroy(DrawSP); 147d4fbbf0eSBarry Smith extern int DrawSPAddPoint(DrawSP,double*,double*); 148d4fbbf0eSBarry Smith extern int DrawSPAddPoints(DrawSP,int,double**,double**); 149d4fbbf0eSBarry Smith extern int DrawSPDraw(DrawSP); 150d4fbbf0eSBarry Smith extern int DrawSPReset(DrawSP); 151d4fbbf0eSBarry Smith extern int DrawSPSetDimension(DrawSP,int); 152d4fbbf0eSBarry Smith extern int DrawSPGetAxis(DrawSP,DrawAxis *); 153d4fbbf0eSBarry Smith extern int DrawSPGetDraw(DrawSP,Draw *); 154d4fbbf0eSBarry Smith extern int DrawSPSetLimits(DrawSP,double,double,double,double); 155d4fbbf0eSBarry Smith 1563f1d51d7SBarry Smith /* 1573f1d51d7SBarry Smith Viewer routines that allow you to access underlying Draw objects 1583f1d51d7SBarry Smith */ 1593f1d51d7SBarry Smith extern int ViewerDrawGetDraw(Viewer, Draw*); 1605311e20fSBarry Smith extern int ViewerDrawGetDrawLG(Viewer, DrawLG*); 1615311e20fSBarry Smith 162d557673fSLois Curfman McInnes /* Mesh management routines */ 1636254e6afSSatish Balay typedef struct _p_DrawMesh* DrawMesh; 164d557673fSLois Curfman McInnes int DrawMeshCreate( DrawMesh *, 165d557673fSLois Curfman McInnes double *, double *, double *, 166d557673fSLois Curfman McInnes int, int, int, int, int, int, int, int, int, 167d557673fSLois Curfman McInnes int, int, int, int, double *, int ); 168d557673fSLois Curfman McInnes int DrawMeshCreateSimple( DrawMesh *, double *, double *, double *, 169d557673fSLois Curfman McInnes int, int, int, int, double *, int ); 170d557673fSLois Curfman McInnes int DrawMeshDestroy( DrawMesh * ); 171d557673fSLois Curfman McInnes 172d557673fSLois Curfman McInnes /* Color spectrum managment */ 173d557673fSLois Curfman McInnes typedef void (*VRMLGetHue_fcn)( double, void *, int, double *, double *, 174d557673fSLois Curfman McInnes double * ); 175d557673fSLois Curfman McInnes 176d557673fSLois Curfman McInnes void *VRMLFindHue_setup( DrawMesh, int ); 177d557673fSLois Curfman McInnes void VRMLFindHue( double, void *, int, double *, double *, double * ); 178d557673fSLois Curfman McInnes void VRMLFindHue_destroy( void * ); 179d557673fSLois Curfman McInnes void *VRMLGetHue_setup( DrawMesh, int ); 180d557673fSLois Curfman McInnes void VRMLGetHue( double, void *, int, double *, double *, double * ); 181d557673fSLois Curfman McInnes void VRMLGetHue_destroy( void * ); 182d557673fSLois Curfman McInnes 183d557673fSLois Curfman McInnes 184d557673fSLois Curfman McInnes int DrawTensorSurfaceContour(Draw,DrawMesh,VRMLGetHue_fcn, void *, int ); 185d557673fSLois Curfman McInnes int DrawTensorMapMesh( Draw, DrawMesh, double, double, double, int, int ); 186d557673fSLois Curfman McInnes int DrawTensorMapSurfaceContour(Draw,DrawMesh,double,double,double, 187d557673fSLois Curfman McInnes int,int, VRMLGetHue_fcn, void *, int,double); 188d557673fSLois Curfman McInnes int DrawTensorSurface(Draw, DrawMesh, int); 189d557673fSLois Curfman McInnes /*int DrawTensorMapSurfaceContourAndMesh_VRML(Draw,DrawMesh,int); */ 190d557673fSLois Curfman McInnes 19143e6b640SBarry Smith #endif 192