xref: /petsc/src/sys/classes/draw/interface/dpoint.c (revision 811af0c4b09a35de4306c442f88bd09fdc09897d)
15c6c1daeSBarry Smith 
25c6c1daeSBarry Smith /*
35c6c1daeSBarry Smith        Provides the calling sequences for all the basic PetscDraw routines.
45c6c1daeSBarry Smith */
5af0996ceSBarry Smith #include <petsc/private/drawimpl.h> /*I "petscdraw.h" I*/
65c6c1daeSBarry Smith 
75c6c1daeSBarry Smith /*@
8*811af0c4SBarry Smith    PetscDrawPoint - draws a point onto a drawable.
95c6c1daeSBarry Smith 
105c6c1daeSBarry Smith    Not collective
115c6c1daeSBarry Smith 
125c6c1daeSBarry Smith    Input Parameters:
135c6c1daeSBarry Smith +  draw - the drawing context
145c6c1daeSBarry Smith .  xl,yl - the coordinates of the point
155c6c1daeSBarry Smith -  cl - the color of the point
165c6c1daeSBarry Smith 
175c6c1daeSBarry Smith    Level: beginner
185c6c1daeSBarry Smith 
19*811af0c4SBarry Smith .seealso: `PetscDraw`, `PetscDrawPointPixel()`, `PetscDrawPointSetSize()`, `PetscDrawLine()`, `PetscDrawRectangle()`, `PetscDrawTriangle()`, `PetscDrawEllipse()`,
20db781477SPatrick Sanan           `PetscDrawMarker()`, `PetscDrawString()`, `PetscDrawArrow()`
215c6c1daeSBarry Smith @*/
229371c9d4SSatish Balay PetscErrorCode PetscDrawPoint(PetscDraw draw, PetscReal xl, PetscReal yl, int cl) {
235c6c1daeSBarry Smith   PetscFunctionBegin;
245c6c1daeSBarry Smith   PetscValidHeaderSpecific(draw, PETSC_DRAW_CLASSID, 1);
25dbbe0bcdSBarry Smith   PetscUseTypeMethod(draw, point, xl, yl, cl);
265c6c1daeSBarry Smith   PetscFunctionReturn(0);
275c6c1daeSBarry Smith }
285c6c1daeSBarry Smith 
295c6c1daeSBarry Smith /*@
30*811af0c4SBarry Smith    PetscDrawPointPixel - draws a point onto a drawable, in pixel coordinates
315c6c1daeSBarry Smith 
325c6c1daeSBarry Smith    Not collective
335c6c1daeSBarry Smith 
345c6c1daeSBarry Smith    Input Parameters:
355c6c1daeSBarry Smith +  draw - the drawing context
36a7e8706aSLisandro Dalcin .  x,y - the pixel coordinates of the point
37a7e8706aSLisandro Dalcin -  c - the color of the point
385c6c1daeSBarry Smith 
395c6c1daeSBarry Smith    Level: beginner
405c6c1daeSBarry Smith 
41*811af0c4SBarry Smith .seealso: `PetscDraw`, `PetscDrawPoint()`, `PetscDrawPointSetSize()`
425c6c1daeSBarry Smith @*/
439371c9d4SSatish Balay PetscErrorCode PetscDrawPointPixel(PetscDraw draw, int x, int y, int c) {
445c6c1daeSBarry Smith   PetscFunctionBegin;
455c6c1daeSBarry Smith   PetscValidHeaderSpecific(draw, PETSC_DRAW_CLASSID, 1);
46dbbe0bcdSBarry Smith   PetscUseTypeMethod(draw, pointpixel, x, y, c);
475c6c1daeSBarry Smith   PetscFunctionReturn(0);
485c6c1daeSBarry Smith }
498f69470aSLisandro Dalcin 
508f69470aSLisandro Dalcin /*@
518f69470aSLisandro Dalcin    PetscDrawPointSetSize - Sets the point size for future draws.  The size is
528f69470aSLisandro Dalcin    relative to the user coordinates of the window; 0.0 denotes the natural
538f69470aSLisandro Dalcin    width, 1.0 denotes the entire viewport.
548f69470aSLisandro Dalcin 
558f69470aSLisandro Dalcin    Not collective
568f69470aSLisandro Dalcin 
578f69470aSLisandro Dalcin    Input Parameters:
588f69470aSLisandro Dalcin +  draw - the drawing context
598f69470aSLisandro Dalcin -  width - the width in user coordinates
608f69470aSLisandro Dalcin 
618f69470aSLisandro Dalcin    Level: advanced
628f69470aSLisandro Dalcin 
638f69470aSLisandro Dalcin    Note:
648f69470aSLisandro Dalcin    Even a size of zero insures that a single pixel is colored.
658f69470aSLisandro Dalcin 
66*811af0c4SBarry Smith .seealso: `PetscDraw`, `PetscDrawPoint()`, `PetscDrawMarker()`
678f69470aSLisandro Dalcin @*/
689371c9d4SSatish Balay PetscErrorCode PetscDrawPointSetSize(PetscDraw draw, PetscReal width) {
698f69470aSLisandro Dalcin   PetscFunctionBegin;
708f69470aSLisandro Dalcin   PetscValidHeaderSpecific(draw, PETSC_DRAW_CLASSID, 1);
71cc73adaaSBarry Smith   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);
72dbbe0bcdSBarry Smith   PetscTryTypeMethod(draw, pointsetsize, width);
738f69470aSLisandro Dalcin   PetscFunctionReturn(0);
748f69470aSLisandro Dalcin }
75