Actual source code: dline.c

petsc-3.3-p7 2013-05-11
  2: /*
  3:        Provides the calling sequences for all the basic PetscDraw routines.
  4: */
  5: #include <../src/sys/draw/drawimpl.h>  /*I "petscdraw.h" I*/
  6: 
  9: /*@
 10:    PetscDrawLine - PetscDraws a line onto a drawable.

 12:    Not collective

 14:    Input Parameters:
 15: +  draw - the drawing context
 16: .  xl,yl,xr,yr - the coordinates of the line endpoints
 17: -  cl - the colors of the endpoints

 19:    Level: beginner

 21:    Concepts: line^drawing
 22:    Concepts: drawing^line

 24: @*/
 25: PetscErrorCode  PetscDrawLine(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr,int cl)
 26: {
 28:   PetscBool  isdrawnull;

 32:   PetscObjectTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isdrawnull);
 33:   if (isdrawnull) return(0);
 34:   (*draw->ops->line)(draw,xl,yl,xr,yr,cl);
 35:   return(0);
 36: }

 40: /*@
 41:    PetscDrawArrow - PetscDraws a line with arrow head at end if the line is long enough

 43:    Not collective

 45:    Input Parameters:
 46: +  draw - the drawing context
 47: .  xl,yl,xr,yr - the coordinates of the line endpoints
 48: -  cl - the colors of the endpoints

 50:    Level: beginner

 52:    Concepts: line^drawing
 53:    Concepts: drawing^line

 55: @*/
 56: PetscErrorCode  PetscDrawArrow(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr,int cl)
 57: {
 59:   PetscBool  isdrawnull;

 63:   PetscObjectTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isdrawnull);
 64:   if (isdrawnull) return(0);
 65:   (*draw->ops->arrow)(draw,xl,yl,xr,yr,cl);
 66:   return(0);
 67: }