Actual source code: drect.c

petsc-3.3-p7 2013-05-11
  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:   PetscObjectTypeCompare((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

 43:    Not Collective

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

 48:    Level: advanced

 50:    Notes: this is not normally called by the user, it is called by PetscDrawClear_X() to save a sequence of images. 

 52: .seealso: PetscDrawSetSave()

 54: @*/
 55: PetscErrorCode  PetscDrawSave(PetscDraw draw)
 56: {
 58:   PetscBool      isnull;

 62:   PetscObjectTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isnull);
 63:   if (isnull) return(0);
 64:   if (!draw->ops->save) return(0);
 65:   (*draw->ops->save)(draw);
 66:   return(0);
 67: }