xref: /petsc/src/sys/classes/draw/interface/dcoor.c (revision 9566063d113dddea24716c546802770db7481bc0)
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 
205c6c1daeSBarry Smith .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;
295c6c1daeSBarry Smith   if (draw->ops->setcoordinates) {
30*9566063dSJacob Faibussowitsch     PetscCall((*draw->ops->setcoordinates)(draw,xl,yl,xr,yr));
315c6c1daeSBarry Smith   }
325c6c1daeSBarry Smith   PetscFunctionReturn(0);
335c6c1daeSBarry Smith }
345c6c1daeSBarry Smith 
358f69470aSLisandro Dalcin /*@
368f69470aSLisandro Dalcin    PetscDrawGetCoordinates - Gets the application coordinates of the corners of
378f69470aSLisandro Dalcin    the window (or page).
388f69470aSLisandro Dalcin 
398f69470aSLisandro Dalcin    Not Collective
408f69470aSLisandro Dalcin 
418f69470aSLisandro Dalcin    Input Parameter:
428f69470aSLisandro Dalcin .  draw - the drawing object
438f69470aSLisandro Dalcin 
448f69470aSLisandro Dalcin    Level: advanced
458f69470aSLisandro Dalcin 
4601d2d390SJose E. Roman    Output Parameters:
476b867d5aSJose E. Roman +  xl - the horizontal coordinate of the lower left corner of the drawing region.
486b867d5aSJose E. Roman .  yl - the vertical coordinate of the lower left corner of the drawing region.
496b867d5aSJose E. Roman .  xr - the horizontal coordinate of the upper right corner of the drawing region.
506b867d5aSJose E. Roman -  yr - the vertical coordinate of the upper right corner of the drawing region.
518f69470aSLisandro Dalcin 
528f69470aSLisandro Dalcin .seealso: PetscDrawSetCoordinates()
538f69470aSLisandro Dalcin 
548f69470aSLisandro Dalcin @*/
558f69470aSLisandro Dalcin PetscErrorCode  PetscDrawGetCoordinates(PetscDraw draw,PetscReal *xl,PetscReal *yl,PetscReal *xr,PetscReal *yr)
568f69470aSLisandro Dalcin {
578f69470aSLisandro Dalcin   PetscFunctionBegin;
588f69470aSLisandro Dalcin   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
598f69470aSLisandro Dalcin   PetscValidRealPointer(xl,2);
608f69470aSLisandro Dalcin   PetscValidRealPointer(yl,3);
618f69470aSLisandro Dalcin   PetscValidRealPointer(xr,4);
628f69470aSLisandro Dalcin   PetscValidRealPointer(yr,5);
638f69470aSLisandro Dalcin   *xl = draw->coor_xl; *yl = draw->coor_yl;
648f69470aSLisandro Dalcin   *xr = draw->coor_xr; *yr = draw->coor_yr;
658f69470aSLisandro Dalcin   PetscFunctionReturn(0);
668f69470aSLisandro Dalcin }
67