xref: /petsc/src/sys/classes/draw/interface/dcoor.c (revision dbbe0bcd3f3a8fbab5a45420dc06f8387e5764c6)
15c6c1daeSBarry Smith 
25c6c1daeSBarry Smith /*
35c6c1daeSBarry Smith        Provides the calling sequences for all the basic PetscDraw routines.
45c6c1daeSBarry Smith */
5af0996ceSBarry Smith #include <petsc/private/drawimpl.h>  /*I "petscdraw.h" I*/
65c6c1daeSBarry Smith 
75c6c1daeSBarry Smith /*@
85c6c1daeSBarry Smith    PetscDrawSetCoordinates - Sets the application coordinates of the corners of
95c6c1daeSBarry Smith    the window (or page).
105c6c1daeSBarry Smith 
115c6c1daeSBarry Smith    Not collective
125c6c1daeSBarry Smith 
135c6c1daeSBarry Smith    Input Parameters:
145c6c1daeSBarry Smith +  draw - the drawing object
155c6c1daeSBarry Smith -  xl,yl,xr,yr - the coordinates of the lower left corner and upper
165c6c1daeSBarry Smith                  right corner of the drawing region.
175c6c1daeSBarry Smith 
185c6c1daeSBarry Smith    Level: advanced
195c6c1daeSBarry Smith 
20db781477SPatrick Sanan .seealso: `PetscDrawGetCoordinates()`
215c6c1daeSBarry Smith 
225c6c1daeSBarry Smith @*/
235c6c1daeSBarry Smith PetscErrorCode  PetscDrawSetCoordinates(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr)
245c6c1daeSBarry Smith {
255c6c1daeSBarry Smith   PetscFunctionBegin;
265c6c1daeSBarry Smith   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
275c6c1daeSBarry Smith   draw->coor_xl = xl; draw->coor_yl = yl;
285c6c1daeSBarry Smith   draw->coor_xr = xr; draw->coor_yr = yr;
29*dbbe0bcdSBarry Smith   PetscTryTypeMethod(draw,setcoordinates,xl,yl,xr,yr);
305c6c1daeSBarry Smith   PetscFunctionReturn(0);
315c6c1daeSBarry Smith }
325c6c1daeSBarry Smith 
338f69470aSLisandro Dalcin /*@
348f69470aSLisandro Dalcin    PetscDrawGetCoordinates - Gets the application coordinates of the corners of
358f69470aSLisandro Dalcin    the window (or page).
368f69470aSLisandro Dalcin 
378f69470aSLisandro Dalcin    Not Collective
388f69470aSLisandro Dalcin 
398f69470aSLisandro Dalcin    Input Parameter:
408f69470aSLisandro Dalcin .  draw - the drawing object
418f69470aSLisandro Dalcin 
428f69470aSLisandro Dalcin    Level: advanced
438f69470aSLisandro Dalcin 
4401d2d390SJose E. Roman    Output Parameters:
456b867d5aSJose E. Roman +  xl - the horizontal coordinate of the lower left corner of the drawing region.
466b867d5aSJose E. Roman .  yl - the vertical coordinate of the lower left corner of the drawing region.
476b867d5aSJose E. Roman .  xr - the horizontal coordinate of the upper right corner of the drawing region.
486b867d5aSJose E. Roman -  yr - the vertical coordinate of the upper right corner of the drawing region.
498f69470aSLisandro Dalcin 
50db781477SPatrick Sanan .seealso: `PetscDrawSetCoordinates()`
518f69470aSLisandro Dalcin 
528f69470aSLisandro Dalcin @*/
538f69470aSLisandro Dalcin PetscErrorCode  PetscDrawGetCoordinates(PetscDraw draw,PetscReal *xl,PetscReal *yl,PetscReal *xr,PetscReal *yr)
548f69470aSLisandro Dalcin {
558f69470aSLisandro Dalcin   PetscFunctionBegin;
568f69470aSLisandro Dalcin   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
578f69470aSLisandro Dalcin   PetscValidRealPointer(xl,2);
588f69470aSLisandro Dalcin   PetscValidRealPointer(yl,3);
598f69470aSLisandro Dalcin   PetscValidRealPointer(xr,4);
608f69470aSLisandro Dalcin   PetscValidRealPointer(yr,5);
618f69470aSLisandro Dalcin   *xl = draw->coor_xl; *yl = draw->coor_yl;
628f69470aSLisandro Dalcin   *xr = draw->coor_xr; *yr = draw->coor_yr;
638f69470aSLisandro Dalcin   PetscFunctionReturn(0);
648f69470aSLisandro Dalcin }
65