Actual source code: dpoint.c
2: /*
3: Provides the calling sequences for all the basic PetscDraw routines.
4: */
5: #include <petsc/private/drawimpl.h>
7: /*@
8: PetscDrawPoint - draws 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: .seealso: `PetscDraw`, `PetscDrawPointPixel()`, `PetscDrawPointSetSize()`, `PetscDrawLine()`, `PetscDrawRectangle()`, `PetscDrawTriangle()`, `PetscDrawEllipse()`,
20: `PetscDrawMarker()`, `PetscDrawString()`, `PetscDrawArrow()`
21: @*/
22: PetscErrorCode PetscDrawPoint(PetscDraw draw, PetscReal xl, PetscReal yl, int cl)
23: {
24: PetscFunctionBegin;
26: PetscUseTypeMethod(draw, point, xl, yl, cl);
27: PetscFunctionReturn(PETSC_SUCCESS);
28: }
30: /*@
31: PetscDrawPointPixel - draws a point onto a drawable, in pixel coordinates
33: Not collective
35: Input Parameters:
36: + draw - the drawing context
37: . x,y - the pixel coordinates of the point
38: - c - the color of the point
40: Level: beginner
42: .seealso: `PetscDraw`, `PetscDrawPoint()`, `PetscDrawPointSetSize()`
43: @*/
44: PetscErrorCode PetscDrawPointPixel(PetscDraw draw, int x, int y, int c)
45: {
46: PetscFunctionBegin;
48: PetscUseTypeMethod(draw, pointpixel, x, y, c);
49: PetscFunctionReturn(PETSC_SUCCESS);
50: }
52: /*@
53: PetscDrawPointSetSize - Sets the point size for future draws. The size is
54: relative to the user coordinates of the window; 0.0 denotes the natural
55: width, 1.0 denotes the entire viewport.
57: Not collective
59: Input Parameters:
60: + draw - the drawing context
61: - width - the width in user coordinates
63: Level: advanced
65: Note:
66: Even a size of zero insures that a single pixel is colored.
68: .seealso: `PetscDraw`, `PetscDrawPoint()`, `PetscDrawMarker()`
69: @*/
70: PetscErrorCode PetscDrawPointSetSize(PetscDraw draw, PetscReal width)
71: {
72: PetscFunctionBegin;
74: PetscCheck(width >= 0.0 && width <= 1.0, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Bad size %g, should be between 0 and 1", (double)width);
75: PetscTryTypeMethod(draw, pointsetsize, width);
76: PetscFunctionReturn(PETSC_SUCCESS);
77: }