Actual source code: petsc-drawimpl.h

petsc-3.4.5 2014-06-29
  1: /*
  2:        Abstract data structure and functions for graphics.
  3: */

  5: #if !defined(_DRAWIMPL_H)
  6: #define _DRAWIMPL_H

  8: #include <petscdraw.h>
  9: #include <petsc-private/petscimpl.h>

 11: struct _PetscDrawOps {
 12:   PetscErrorCode (*setdoublebuffer)(PetscDraw);
 13:   PetscErrorCode (*flush)(PetscDraw);
 14:   PetscErrorCode (*line)(PetscDraw,PetscReal,PetscReal,PetscReal,PetscReal,int);
 15:   PetscErrorCode (*linesetwidth)(PetscDraw,PetscReal);
 16:   PetscErrorCode (*linegetwidth)(PetscDraw,PetscReal*);
 17:   PetscErrorCode (*point)(PetscDraw,PetscReal,PetscReal,int);
 18:   PetscErrorCode (*pointsetsize)(PetscDraw,PetscReal);
 19:   PetscErrorCode (*string)(PetscDraw,PetscReal,PetscReal,int,const char[]);
 20:   PetscErrorCode (*stringvertical)(PetscDraw,PetscReal,PetscReal,int,const char[]);
 21:   PetscErrorCode (*stringsetsize)(PetscDraw,PetscReal,PetscReal);
 22:   PetscErrorCode (*stringgetsize)(PetscDraw,PetscReal*,PetscReal*);
 23:   PetscErrorCode (*setviewport)(PetscDraw,PetscReal,PetscReal,PetscReal,PetscReal);
 24:   PetscErrorCode (*clear)(PetscDraw);
 25:   PetscErrorCode (*synchronizedflush)(PetscDraw);
 26:   PetscErrorCode (*rectangle)(PetscDraw,PetscReal,PetscReal,PetscReal,PetscReal,int,int,int,int);
 27:   PetscErrorCode (*triangle)(PetscDraw,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal,int,int,int);
 28:   PetscErrorCode (*ellipse)(PetscDraw,PetscReal,PetscReal,PetscReal,PetscReal,int);
 29:   PetscErrorCode (*getmousebutton)(PetscDraw,PetscDrawButton*,PetscReal *,PetscReal *,PetscReal*,PetscReal*);
 30:   PetscErrorCode (*pause)(PetscDraw);
 31:   PetscErrorCode (*synchronizedclear)(PetscDraw);
 32:   PetscErrorCode (*beginpage)(PetscDraw);
 33:   PetscErrorCode (*endpage)(PetscDraw);
 34:   PetscErrorCode (*getpopup)(PetscDraw,PetscDraw*);
 35:   PetscErrorCode (*settitle)(PetscDraw,const char[]);
 36:   PetscErrorCode (*checkresizedwindow)(PetscDraw);
 37:   PetscErrorCode (*resizewindow)(PetscDraw,int,int);
 38:   PetscErrorCode (*destroy)(PetscDraw);
 39:   PetscErrorCode (*view)(PetscDraw,PetscViewer);
 40:   PetscErrorCode (*getsingleton)(PetscDraw,PetscDraw*);
 41:   PetscErrorCode (*restoresingleton)(PetscDraw,PetscDraw*);
 42:   PetscErrorCode (*save)(PetscDraw);
 43:   PetscErrorCode (*setsave)(PetscDraw,const char*);
 44:   PetscErrorCode (*setcoordinates)(PetscDraw,PetscReal,PetscReal,PetscReal,PetscReal);
 45:   PetscErrorCode (*arrow)(PetscDraw,PetscReal,PetscReal,PetscReal,PetscReal,int);
 46:   PetscErrorCode (*coordinatetopixel)(PetscDraw,PetscReal,PetscReal,PetscInt*,PetscInt*);
 47:   PetscErrorCode (*pixeltocoordinate)(PetscDraw,PetscInt,PetscInt,PetscReal*,PetscReal*);
 48:   PetscErrorCode (*pointpixel)(PetscDraw,PetscInt,PetscInt,int);
 49:   PetscErrorCode (*boxedstring)(PetscDraw,PetscReal,PetscReal,int,int,const char[],PetscReal*,PetscReal*);
 50: };

 52: struct _p_PetscDraw {
 53:   PETSCHEADER(struct _PetscDrawOps);
 54:   PetscReal       pause;       /* sleep time after a synchronized flush */
 55:   PetscReal       port_xl,port_yl,port_xr,port_yr;
 56:   PetscReal       coor_xl,coor_yl,coor_xr,coor_yr;
 57:   PetscReal       currentpoint_x[20],currentpoint_y[20];
 58:   PetscReal       boundbox_xl,boundbox_yl,boundbox_xr,boundbox_yr; /* need to have this for each current point? */
 59:   PetscInt        currentpoint;
 60:   char            *title;
 61:   char            *display;
 62:   PetscDraw       popup;
 63:   int             x,y,h,w;
 64:   char            *savefilename;
 65:   PetscInt        savefilecount;
 66:   PetscBool       savefilemovie;
 67:   PetscBool       saveonflush;       /* save a new image for every PetscDrawFlush() called */
 68:   void            *data;
 69: };

 71: #endif