Actual source code: drect.c

  2: /*
  3:        Provides the calling sequences for all the basic PetscDraw routines.
  4: */
  5: #include <../src/sys/draw/drawimpl.h>  /*I "petscdraw.h" I*/

  9: /*@
 10:    PetscDrawRectangle - PetscDraws a rectangle  onto a drawable.

 12:    Not Collective

 14:    Input Parameters:
 15: +  draw - the drawing context
 16: .  xl,yl,xr,yr - the coordinates of the lower left, upper right corners
 17: -  c1,c2,c3,c4 - the colors of the four corners in counter clockwise order

 19:    Level: beginner

 21:    Concepts: drawing^rectangle
 22:    Concepts: graphics^rectangle
 23:    Concepts: rectangle

 25: @*/
 26: PetscErrorCode  PetscDrawRectangle(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr,int c1,int c2,int c3,int c4)
 27: {
 29:   PetscBool  isnull;
 32:   PetscTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isnull);
 33:   if (isnull) return(0);
 34:   (*draw->ops->rectangle)(draw,xl,yl,xr,yr,c1,c2,c3,c4);
 35:   return(0);
 36: }

 40: /*@
 41:    PetscDrawSave - Saves a drawn image in a viewer

 43:    Not Collective

 45:    Input Parameters:
 46: .  draw - the drawing context

 48:    Level: advanced

 50: @*/
 51: PetscErrorCode  PetscDrawSave(PetscDraw draw)
 52: {
 54:   PetscBool  isnull;
 57:   PetscTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isnull);
 58:   if (isnull) return(0);
 59:   if (!draw->ops->save) return(0);
 60:   (*draw->ops->save)(draw);
 61:   return(0);
 62: }