/*@C PetscDrawCreate - Creates a graphics context. Collective on MPI_Comm Input Parameter: + comm - MPI communicator . display - X display when using X windows . title - optional title added to top of window . x,y - coordinates of lower left corner of window or PETSC_DECIDE - w, h - width and height of window or PETSC_DECIDE or PETSC_DRAW_HALF_SIZE, PETSC_DRAW_FULL_SIZE, or PETSC_DRAW_THIRD_SIZE or PETSC_DRAW_QUARTER_SIZE Output Parameter: . draw - location to put the PetscDraw context Level: beginner Concepts: graphics^creating context Concepts: drawing^creating context .seealso: PetscDrawSetFromOptions(), PetscDrawDestroy(), PetscDrawSetType() @*/ PetscErrorCode PetscDrawCreate(MPI_Comm comm,const char display[],const char title[],int x,int y,int w,int h,PetscDraw *indraw) { PetscDraw draw; PetscErrorCode ierr; PetscReal dpause; PetscBool flag; PetscFunctionBegin; ierr = PetscDrawInitializePackage(); CHKERRQ(ierr); *indraw = 0; ierr = PetscHeaderCreate(draw,_p_PetscDraw,struct _PetscDrawOps,PETSC_DRAW_CLASSID,"Draw","Graphics","Draw",comm,PetscDrawDestroy,0); CHKERRQ(ierr); draw->data = 0; ierr = PetscStrallocpy(title,&draw->title); CHKERRQ(ierr); ierr = PetscStrallocpy(display,&draw->display); CHKERRQ(ierr); draw->x = x; draw->y = y; draw->w = w; draw->h = h; draw->pause = 0.0; draw->coor_xl = 0.0; draw->coor_xr = 1.0; draw->coor_yl = 0.0; draw->coor_yr = 1.0; draw->port_xl = 0.0; draw->port_xr = 1.0; draw->port_yl = 0.0; draw->port_yr = 1.0; draw->popup = 0; ierr = PetscOptionsGetReal(NULL,"-draw_pause",&dpause,&flag); CHKERRQ(ierr); if (flag) draw->pause = dpause; draw->savefilename = NULL; draw->savefilemovie = PETSC_FALSE; draw->savefilecount = -1; ierr = PetscDrawSetCurrentPoint(draw,.5,.9); CHKERRQ(ierr); draw->boundbox_xl = .5; draw->boundbox_xr = .5; draw->boundbox_yl = .9; draw->boundbox_yr = .9; *indraw = draw; PetscFunctionReturn(0); }
PETSC_EXTERN void PETSC_STDCALL petscdrawsetcurrentpoint_(PetscDraw draw,PetscReal *x,PetscReal *y, int *__ierr ) { *__ierr = PetscDrawSetCurrentPoint( (PetscDraw)PetscToPointer((draw) ),*x,*y); }