Actual source code: dpoint.c
2: #include <petsc/private/drawimpl.h>
4: /*@
5: PetscDrawPoint - draws a point onto a drawable.
7: Not Collective
9: Input Parameters:
10: + draw - the drawing context
11: . xl - horizatonal coordinate of the point
12: . yl - vertical coordinate of the point
13: - cl - the color of the point
15: Level: beginner
17: .seealso: `PetscDraw`, `PetscDrawPointPixel()`, `PetscDrawPointSetSize()`, `PetscDrawLine()`, `PetscDrawRectangle()`, `PetscDrawTriangle()`, `PetscDrawEllipse()`,
18: `PetscDrawMarker()`, `PetscDrawString()`, `PetscDrawArrow()`
19: @*/
20: PetscErrorCode PetscDrawPoint(PetscDraw draw, PetscReal xl, PetscReal yl, int cl)
21: {
22: PetscFunctionBegin;
24: PetscUseTypeMethod(draw, point, xl, yl, cl);
25: PetscFunctionReturn(PETSC_SUCCESS);
26: }
28: /*@
29: PetscDrawPointPixel - draws a point onto a drawable, in pixel coordinates
31: Not Collective
33: Input Parameters:
34: + draw - the drawing context
35: . x - horizontal pixel coordinates of the point
36: . y - vertical pixel coordinates of the point
37: - c - the color of the point
39: Level: beginner
41: .seealso: `PetscDraw`, `PetscDrawPoint()`, `PetscDrawPointSetSize()`
42: @*/
43: PetscErrorCode PetscDrawPointPixel(PetscDraw draw, int x, int y, int c)
44: {
45: PetscFunctionBegin;
47: PetscUseTypeMethod(draw, pointpixel, x, y, c);
48: PetscFunctionReturn(PETSC_SUCCESS);
49: }
51: /*@
52: PetscDrawPointSetSize - Sets the point size for future draws. The size is
53: relative to the user coordinates of the window; 0.0 denotes the natural
54: width, 1.0 denotes the entire viewport.
56: Not Collective
58: Input Parameters:
59: + draw - the drawing context
60: - width - the width in user coordinates
62: Level: advanced
64: Note:
65: Even a size of zero insures that a single pixel is colored.
67: .seealso: `PetscDraw`, `PetscDrawPoint()`, `PetscDrawMarker()`
68: @*/
69: PetscErrorCode PetscDrawPointSetSize(PetscDraw draw, PetscReal width)
70: {
71: PetscFunctionBegin;
73: 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);
74: PetscTryTypeMethod(draw, pointsetsize, width);
75: PetscFunctionReturn(PETSC_SUCCESS);
76: }