xref: /petsc/src/sys/classes/draw/interface/dclear.c (revision 356ed81403a8ddb9cbcae868d64486ea275d004c)
1 /*
2        Provides the calling sequences for all the basic PetscDraw routines.
3 */
4 #include <petsc/private/drawimpl.h>  /*I "petscdraw.h" I*/
5 
6 /*@
7    PetscDrawClear - Clears graphical output. All processors must call this routine.
8    Does not return until the draw in context is clear.
9 
10    Collective on PetscDraw
11 
12    Input Parameters:
13 .  draw - the drawing context
14 
15    Level: intermediate
16 
17 @*/
18 PetscErrorCode  PetscDrawClear(PetscDraw draw)
19 {
20   PetscFunctionBegin;
21   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
22   if (draw->saveonclear) PetscCall(PetscDrawSave(draw));
23   if (draw->ops->clear) {
24     PetscCall((*draw->ops->clear)(draw));
25   }
26   PetscFunctionReturn(0);
27 }
28 
29 /*@
30    PetscDrawBOP - Begins a new page or frame on the selected graphical device.
31 
32    Logically Collective on PetscDraw
33 
34    Input Parameter:
35 .  draw - the drawing context
36 
37    Level: advanced
38 
39 .seealso: PetscDrawEOP(), PetscDrawClear()
40 @*/
41 PetscErrorCode  PetscDrawBOP(PetscDraw draw)
42 {
43   PetscFunctionBegin;
44   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
45   if (draw->ops->beginpage) {
46     PetscCall((*draw->ops->beginpage)(draw));
47   }
48   PetscFunctionReturn(0);
49 }
50 /*@
51    PetscDrawEOP - Ends a page or frame on the selected graphical device.
52 
53    Logically Collective on PetscDraw
54 
55    Input Parameter:
56 .  draw - the drawing context
57 
58    Level: advanced
59 
60 .seealso: PetscDrawBOP(), PetscDrawClear()
61 @*/
62 PetscErrorCode  PetscDrawEOP(PetscDraw draw)
63 {
64   PetscFunctionBegin;
65   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
66   if (draw->ops->endpage) {
67     PetscCall((*draw->ops->endpage)(draw));
68   }
69   PetscFunctionReturn(0);
70 }
71