Actual source code: dpoint.c

petsc-3.7.5 2017-01-01
Report Typos and Errors
  2: /*
  3:        Provides the calling sequences for all the basic PetscDraw routines.
  4: */
  5: #include <petsc/private/drawimpl.h>  /*I "petscdraw.h" I*/

  9: /*@
 10:    PetscDrawPoint - PetscDraws a point onto a drawable.

 12:    Not collective

 14:    Input Parameters:
 15: +  draw - the drawing context
 16: .  xl,yl - the coordinates of the point
 17: -  cl - the color of the point

 19:    Level: beginner

 21:    Concepts: point^drawing
 22:    Concepts: drawing^point

 24: .seealso: PetscDrawPointSetSize()

 26: @*/
 27: PetscErrorCode  PetscDrawPoint(PetscDraw draw,PetscReal xl,PetscReal yl,int cl)
 28: {

 33:   if (!draw->ops->point) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"This draw type %s does not support drawing points",((PetscObject)draw)->type_name);
 34:   (*draw->ops->point)(draw,xl,yl,cl);
 35:   return(0);
 36: }

 40: /*@
 41:    PetscDrawPointPixel - PetscDraws a point onto a drawable, in pixel coordinates

 43:    Not collective

 45:    Input Parameters:
 46: +  draw - the drawing context
 47: .  x,y - the pixel coordinates of the point
 48: -  c - the color of the point

 50:    Level: beginner

 52:    Concepts: point^drawing
 53:    Concepts: drawing^point

 55: .seealso: PetscDrawPointSetSize()

 57: @*/
 58: PetscErrorCode  PetscDrawPointPixel(PetscDraw draw,int x,int y,int c)
 59: {

 64:   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);
 65:   (*draw->ops->pointpixel)(draw,x,y,c);
 66:   return(0);
 67: }

 71: /*@
 72:    PetscDrawPointSetSize - Sets the point size for future draws.  The size is
 73:    relative to the user coordinates of the window; 0.0 denotes the natural
 74:    width, 1.0 denotes the entire viewport.

 76:    Not collective

 78:    Input Parameters:
 79: +  draw - the drawing context
 80: -  width - the width in user coordinates

 82:    Level: advanced

 84:    Note:
 85:    Even a size of zero insures that a single pixel is colored.

 87:    Concepts: point^drawing size

 89: .seealso: PetscDrawPoint()
 90: @*/
 91: PetscErrorCode  PetscDrawPointSetSize(PetscDraw draw,PetscReal width)
 92: {

 97:   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);
 98:   if (draw->ops->pointsetsize) {
 99:     (*draw->ops->pointsetsize)(draw,width);
100:   }
101:   return(0);
102: }