Actual source code: dpause.c

  1: /*
  2:        Provides the calling sequences for all the basic PetscDraw routines.
  3: */
  4: #include <petsc/private/drawimpl.h>

  6: /*@
  7:    PetscDrawPause - Waits n seconds or until user input, depending on input
  8:                to `PetscDrawSetPause()`.

 10:    Collective

 12:    Input Parameter:
 13: .  draw - the drawing context

 15:    Level: beginner

 17: .seealso: `PetscDraw`, `PetscDrawSetPause()`, `PetscDrawGetPause()`
 18: @*/
 19: PetscErrorCode PetscDrawPause(PetscDraw draw)
 20: {
 22:   PetscTryTypeMethod(draw, pause);
 23:   return 0;
 24: }

 26: /*@
 27:    PetscDrawSetPause - Sets the amount of time that program pauses after
 28:    a `PetscDrawPause()` is called.

 30:    Logically Collective

 32:    Input Parameters:
 33: +  draw   - the drawing object
 34: -  lpause - number of seconds to pause, -1 implies until user input, -2 pauses only on the `PetscDrawDestroy()`

 36:    Options Database Key:
 37: .  -draw_pause value - set the time to pause

 39:    Level: intermediate

 41:    Note:
 42:    By default the pause time is zero unless the -draw_pause option is given
 43:    during PetscDrawCreate().

 45: .seealso: `PetscDraw`, `PetscDrawGetPause()`, `PetscDrawPause()`
 46: @*/
 47: PetscErrorCode PetscDrawSetPause(PetscDraw draw, PetscReal lpause)
 48: {
 51:   draw->pause = lpause;
 52:   return 0;
 53: }

 55: /*@
 56:    PetscDrawGetPause - Gets the amount of time that program pauses after
 57:    a `PetscDrawPause()` is called.

 59:    Not collective

 61:    Input Parameters:
 62: +  draw   - the drawing object
 63: -  lpause - number of seconds to pause, -1 implies until user input

 65:    Level: intermediate

 67:    Note:
 68:    By default the pause time is zero unless the -draw_pause option is given

 70: .seealso: `PetscDraw`, `PetscDrawSetPause()`, `PetscDrawPause()`
 71: @*/
 72: PetscErrorCode PetscDrawGetPause(PetscDraw draw, PetscReal *lpause)
 73: {
 76:   *lpause = draw->pause;
 77:   return 0;
 78: }