Actual source code: dcoor.c
petsc-3.11.4 2019-09-28
2: /*
3: Provides the calling sequences for all the basic PetscDraw routines.
4: */
5: #include <petsc/private/drawimpl.h>
7: /*@
8: PetscDrawSetCoordinates - Sets the application coordinates of the corners of
9: the window (or page).
11: Not collective
13: Input Parameters:
14: + draw - the drawing object
15: - xl,yl,xr,yr - the coordinates of the lower left corner and upper
16: right corner of the drawing region.
18: Level: advanced
20: Concepts: drawing^coordinates
21: Concepts: graphics^coordinates
23: .seealso: PetscDrawGetCoordinates()
25: @*/
26: PetscErrorCode PetscDrawSetCoordinates(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr)
27: {
32: draw->coor_xl = xl; draw->coor_yl = yl;
33: draw->coor_xr = xr; draw->coor_yr = yr;
34: if (draw->ops->setcoordinates) {
35: (*draw->ops->setcoordinates)(draw,xl,yl,xr,yr);
36: }
37: return(0);
38: }
40: /*@
41: PetscDrawGetCoordinates - Gets the application coordinates of the corners of
42: the window (or page).
44: Not Collective
46: Input Parameter:
47: . draw - the drawing object
49: Level: advanced
51: Ouput Parameters:
52: . xl,yl,xr,yr - the coordinates of the lower left corner and upper
53: right corner of the drawing region.
55: Concepts: drawing^coordinates
56: Concepts: graphics^coordinates
58: .seealso: PetscDrawSetCoordinates()
60: @*/
61: PetscErrorCode PetscDrawGetCoordinates(PetscDraw draw,PetscReal *xl,PetscReal *yl,PetscReal *xr,PetscReal *yr)
62: {
69: *xl = draw->coor_xl; *yl = draw->coor_yl;
70: *xr = draw->coor_xr; *yr = draw->coor_yr;
71: return(0);
72: }