xref: /petsc/src/sys/classes/draw/interface/dpoint.c (revision c094ef4021e955ef5f85f7d8a1bbc6ed64ba7621)
1 
2 /*
3        Provides the calling sequences for all the basic PetscDraw routines.
4 */
5 #include <petsc/private/drawimpl.h>  /*I "petscdraw.h" I*/
6 
7 #undef __FUNCT__
8 #define __FUNCT__ "PetscDrawPoint"
9 /*@
10    PetscDrawPoint - PetscDraws a point onto a drawable.
11 
12    Not collective
13 
14    Input Parameters:
15 +  draw - the drawing context
16 .  xl,yl - the coordinates of the point
17 -  cl - the color of the point
18 
19    Level: beginner
20 
21    Concepts: point^drawing
22    Concepts: drawing^point
23 
24 .seealso: PetscDrawPointSetSize()
25 
26 @*/
27 PetscErrorCode  PetscDrawPoint(PetscDraw draw,PetscReal xl,PetscReal yl,int cl)
28 {
29   PetscErrorCode ierr;
30   PetscBool      isnull;
31 
32   PetscFunctionBegin;
33   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
34   ierr = PetscObjectTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isnull);CHKERRQ(ierr);
35   if (isnull) PetscFunctionReturn(0);
36   ierr = (*draw->ops->point)(draw,xl,yl,cl);CHKERRQ(ierr);
37   PetscFunctionReturn(0);
38 }
39 
40 #undef __FUNCT__
41 #define __FUNCT__ "PetscDrawPointPixel"
42 /*@
43    PetscDrawPointPixel - PetscDraws a point onto a drawable, in pixel coordinates
44 
45    Not collective
46 
47    Input Parameters:
48 +  draw - the drawing context
49 .  xl,yl - the coordinates of the point
50 -  cl - the color of the point
51 
52    Level: beginner
53 
54    Concepts: point^drawing
55    Concepts: drawing^point
56 
57 .seealso: PetscDrawPointSetSize()
58 
59 @*/
60 PetscErrorCode  PetscDrawPointPixel(PetscDraw draw,PetscInt xl,PetscInt yl,int cl)
61 {
62   PetscErrorCode ierr;
63   PetscBool      isnull;
64 
65   PetscFunctionBegin;
66   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
67   ierr = PetscObjectTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isnull);CHKERRQ(ierr);
68   if (isnull) PetscFunctionReturn(0);
69   ierr = (*draw->ops->pointpixel)(draw,xl,yl,cl);CHKERRQ(ierr);
70   PetscFunctionReturn(0);
71 }
72