xref: /petsc/src/sys/classes/draw/interface/dellipse.c (revision d12e167ebf17844deeae3c4cdd43de9ffb5cfe5d) !
1 
2 /*
3        Provides the calling sequences for all the basic Draw routines.
4 */
5 #include <petsc/private/drawimpl.h>  /*I "petscdraw.h" I*/
6 
7 #undef __FUNCT__
8 #define __FUNCT__ "PetscDrawEllipse"
9 /*@
10   PetscDrawEllipse - Draws an ellipse onto a drawable.
11 
12   Not collective
13 
14   Input Parameters:
15 + draw - The drawing context
16 . x,y  - The center
17 . a,b  - The major and minor axes lengths
18 - c    - The color
19 
20   Level: beginner
21 
22 .keywords: draw, ellipse
23 .seealso: PetscDrawRectangle(), PetscDrawTriangle()
24 @*/
25 PetscErrorCode  PetscDrawEllipse(PetscDraw draw, PetscReal x, PetscReal y, PetscReal a, PetscReal b, int c)
26 {
27   PetscBool      isnull;
28   PetscErrorCode ierr;
29 
30   PetscFunctionBegin;
31   PetscValidHeaderSpecific(draw, PETSC_DRAW_CLASSID,1);
32   ierr = PetscDrawIsNull(draw,&isnull);CHKERRQ(ierr);
33   if (isnull) PetscFunctionReturn(0);
34   if (!draw->ops->ellipse) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"No support for drawing ellipses");
35   ierr = (*draw->ops->ellipse)(draw, x, y, a, b, c);CHKERRQ(ierr);
36   PetscFunctionReturn(0);
37 }
38