Actual source code: dpoint.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: PetscDrawPoint - PetscDraws a point onto a drawable.
10: Not collective
12: Input Parameters:
13: + draw - the drawing context
14: . xl,yl - the coordinates of the point
15: - cl - the color of the point
17: Level: beginner
19: Concepts: point^drawing
20: Concepts: drawing^point
22: .seealso: PetscDrawPointPixel(), PetscDrawPointSetSize(), PetscDrawLine(), PetscDrawRectangle(), PetscDrawTriangle(), PetscDrawEllipse(),
23: PetscDrawMarker(), PetscDrawString(), PetscDrawArrow()
25: @*/
26: PetscErrorCode PetscDrawPoint(PetscDraw draw,PetscReal xl,PetscReal yl,int cl)
27: {
32: if (!draw->ops->point) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"This draw type %s does not support drawing points",((PetscObject)draw)->type_name);
33: (*draw->ops->point)(draw,xl,yl,cl);
34: return(0);
35: }
37: /*@
38: PetscDrawPointPixel - PetscDraws a point onto a drawable, in pixel coordinates
40: Not collective
42: Input Parameters:
43: + draw - the drawing context
44: . x,y - the pixel coordinates of the point
45: - c - the color of the point
47: Level: beginner
49: Concepts: point^drawing
50: Concepts: drawing^point
52: .seealso: PetscDrawPoint(), PetscDrawPointSetSize()
54: @*/
55: PetscErrorCode PetscDrawPointPixel(PetscDraw draw,int x,int y,int c)
56: {
61: if (!draw->ops->pointpixel) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"This draw type %s does not support drawing point pixels",((PetscObject)draw)->type_name);
62: (*draw->ops->pointpixel)(draw,x,y,c);
63: return(0);
64: }
66: /*@
67: PetscDrawPointSetSize - Sets the point size for future draws. The size is
68: relative to the user coordinates of the window; 0.0 denotes the natural
69: width, 1.0 denotes the entire viewport.
71: Not collective
73: Input Parameters:
74: + draw - the drawing context
75: - width - the width in user coordinates
77: Level: advanced
79: Note:
80: Even a size of zero insures that a single pixel is colored.
82: Concepts: point^drawing size
84: .seealso: PetscDrawPoint(), PetscDrawMarker()
85: @*/
86: PetscErrorCode PetscDrawPointSetSize(PetscDraw draw,PetscReal width)
87: {
92: if (width < 0.0 || width > 1.0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Bad size %g, should be between 0 and 1",(double)width);
93: if (draw->ops->pointsetsize) {
94: (*draw->ops->pointsetsize)(draw,width);
95: }
96: return(0);
97: }