Actual source code: dpause.c
1: #include <petsc/private/drawimpl.h>
3: /*@
4: PetscDrawPause - Waits n seconds or until user input, depending on input
5: to `PetscDrawSetPause()`.
7: Collective
9: Input Parameter:
10: . draw - the drawing context
12: Level: beginner
14: .seealso: `PetscDraw`, `PetscDrawSetPause()`, `PetscDrawGetPause()`
15: @*/
16: PetscErrorCode PetscDrawPause(PetscDraw draw)
17: {
18: PetscFunctionBegin;
20: PetscTryTypeMethod(draw, pause);
21: PetscFunctionReturn(PETSC_SUCCESS);
22: }
24: /*@
25: PetscDrawSetPause - Sets the amount of time that program pauses after
26: a `PetscDrawPause()` is called.
28: Logically Collective
30: Input Parameters:
31: + draw - the drawing object
32: - lpause - number of seconds to pause, -1 implies until user input, -2 pauses only on the `PetscDrawDestroy()`
34: Options Database Key:
35: . -draw_pause value - set the time to pause
37: Level: intermediate
39: Note:
40: By default the pause time is zero unless the -draw_pause option is given
41: during PetscDrawCreate().
43: .seealso: `PetscDraw`, `PetscDrawGetPause()`, `PetscDrawPause()`
44: @*/
45: PetscErrorCode PetscDrawSetPause(PetscDraw draw, PetscReal lpause)
46: {
47: PetscFunctionBegin;
50: draw->pause = lpause;
51: PetscFunctionReturn(PETSC_SUCCESS);
52: }
54: /*@
55: PetscDrawGetPause - Gets the amount of time that program pauses after
56: a `PetscDrawPause()` is called.
58: Not Collective
60: Input Parameters:
61: + draw - the drawing object
62: - lpause - number of seconds to pause, -1 implies until user input
64: Level: intermediate
66: Note:
67: By default the pause time is zero unless the -draw_pause option is given
69: .seealso: `PetscDraw`, `PetscDrawSetPause()`, `PetscDrawPause()`
70: @*/
71: PetscErrorCode PetscDrawGetPause(PetscDraw draw, PetscReal *lpause)
72: {
73: PetscFunctionBegin;
75: PetscAssertPointer(lpause, 2);
76: *lpause = draw->pause;
77: PetscFunctionReturn(PETSC_SUCCESS);
78: }