Date: 2015-10-02T21:58:38+00:00

Actual source code: drawimpl.h
petsc-3.6.2 2015-10-02
Report Typos and Errors

      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: PETSC_EXTERN PetscBool PetscDrawRegisterAllCalled;
     12: PETSC_EXTERN PetscErrorCode PetscDrawRegisterAll(void);

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

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

     78: #endif