Actual source code: dcoor.c

petsc-3.7.5 2017-01-01
Report Typos and Errors
  2: /*
  3:        Provides the calling sequences for all the basic PetscDraw routines.
  4: */
  5: #include <petsc/private/drawimpl.h>  /*I "petscdraw.h" I*/

  9: /*@
 10:    PetscDrawSetCoordinates - Sets the application coordinates of the corners of
 11:    the window (or page).

 13:    Not collective

 15:    Input Parameters:
 16: +  draw - the drawing object
 17: -  xl,yl,xr,yr - the coordinates of the lower left corner and upper
 18:                  right corner of the drawing region.

 20:    Level: advanced

 22:    Concepts: drawing^coordinates
 23:    Concepts: graphics^coordinates

 25: .seealso: PetscDrawGetCoordinates()

 27: @*/
 28: PetscErrorCode  PetscDrawSetCoordinates(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr)
 29: {

 34:   draw->coor_xl = xl; draw->coor_yl = yl;
 35:   draw->coor_xr = xr; draw->coor_yr = yr;
 36:   if (draw->ops->setcoordinates) {
 37:     (*draw->ops->setcoordinates)(draw,xl,yl,xr,yr);
 38:   }
 39:   return(0);
 40: }

 44: /*@
 45:    PetscDrawGetCoordinates - Gets the application coordinates of the corners of
 46:    the window (or page).

 48:    Not Collective

 50:    Input Parameter:
 51: .  draw - the drawing object

 53:    Level: advanced

 55:    Ouput Parameters:
 56: .  xl,yl,xr,yr - the coordinates of the lower left corner and upper
 57:                  right corner of the drawing region.

 59:    Concepts: drawing^coordinates
 60:    Concepts: graphics^coordinates

 62: .seealso: PetscDrawSetCoordinates()

 64: @*/
 65: PetscErrorCode  PetscDrawGetCoordinates(PetscDraw draw,PetscReal *xl,PetscReal *yl,PetscReal *xr,PetscReal *yr)
 66: {
 73:   *xl = draw->coor_xl; *yl = draw->coor_yl;
 74:   *xr = draw->coor_xr; *yr = draw->coor_yr;
 75:   return(0);
 76: }