xref: /petsc/src/sys/classes/draw/interface/dclear.c (revision d076321ee94a992e029f0665fc86b0401d68c775)
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 #undef __FUNCT__
7 #define __FUNCT__ "PetscDrawClear"
8 /*@
9    PetscDrawClear - Clears graphical output.
10 
11    Not collective (Use PetscDrawSynchronizedClear() for collective)
12 
13    Input Parameter:
14 .  draw - the drawing context
15 
16    Level: beginner
17 
18    Concepts: clear^window
19 
20 .seealso: PetscDrawBOP(), PetscDrawEOP(), PetscDrawSynchronizedClear()
21 @*/
22 PetscErrorCode  PetscDrawClear(PetscDraw draw)
23 {
24   PetscErrorCode ierr;
25 
26   PetscFunctionBegin;
27   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
28   if (draw->ops->clear) {
29     ierr = (*draw->ops->clear)(draw);CHKERRQ(ierr);
30   }
31   PetscFunctionReturn(0);
32 }
33 
34 #undef __FUNCT__
35 #define __FUNCT__ "PetscDrawSynchronizedClear"
36 /*@
37    PetscDrawSynchronizedClear - Clears graphical output. All processors must call this routine.
38    Does not return until the draw in context is clear.
39 
40    Collective on PetscDraw
41 
42    Input Parameters:
43 .  draw - the drawing context
44 
45    Level: intermediate
46 
47    Concepts: clear^window
48 
49 @*/
50 PetscErrorCode  PetscDrawSynchronizedClear(PetscDraw draw)
51 {
52   PetscErrorCode ierr;
53 
54   PetscFunctionBegin;
55   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
56   if (draw->ops->synchronizedclear) {
57     ierr = (*draw->ops->synchronizedclear)(draw);CHKERRQ(ierr);
58   }
59   PetscFunctionReturn(0);
60 }
61 
62 #undef __FUNCT__
63 #define __FUNCT__ "PetscDrawBOP"
64 /*@
65    PetscDrawBOP - Begins a new page or frame on the selected graphical device.
66 
67    Logically Collective on PetscDraw
68 
69    Input Parameter:
70 .  draw - the drawing context
71 
72    Level: advanced
73 
74 .seealso: PetscDrawEOP(), PetscDrawClear()
75 @*/
76 PetscErrorCode  PetscDrawBOP(PetscDraw draw)
77 {
78   PetscErrorCode ierr;
79 
80   PetscFunctionBegin;
81   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
82   if (draw->ops->beginpage) {
83     ierr = (*draw->ops->beginpage)(draw);CHKERRQ(ierr);
84   }
85   PetscFunctionReturn(0);
86 }
87 #undef __FUNCT__
88 #define __FUNCT__ "PetscDrawEOP"
89 /*@
90    PetscDrawEOP - Ends a page or frame on the selected graphical device.
91 
92    Logically Collective on PetscDraw
93 
94    Input Parameter:
95 .  draw - the drawing context
96 
97    Level: advanced
98 
99 .seealso: PetscDrawBOP(), PetscDrawClear()
100 @*/
101 PetscErrorCode  PetscDrawEOP(PetscDraw draw)
102 {
103   PetscErrorCode ierr;
104 
105   PetscFunctionBegin;
106   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
107   if (draw->ops->endpage) {
108     ierr =  (*draw->ops->endpage)(draw);CHKERRQ(ierr);
109   }
110   PetscFunctionReturn(0);
111 }
112