Actual source code: dline.c

  1: /*$Id: dline.c,v 1.32 2001/03/23 23:20:08 balay Exp $*/
  2: /*
  3:        Provides the calling sequences for all the basic PetscDraw routines.
  4: */
 5:  #include src/sys/src/draw/drawimpl.h
  6: 
  7: /*@
  8:    PetscDrawLine - PetscDraws a line onto a drawable.

 10:    Not collective

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

 17:    Level: beginner

 19:    Concepts: line^drawing
 20:    Concepts: drawing^line

 22: @*/
 23: int PetscDrawLine(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr,int cl)
 24: {
 25:   int        ierr;
 26:   PetscTruth isdrawnull;

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

 36: /*@
 37:    PetscDrawIsNull - Returns PETSC_TRUE if draw is a null draw object.

 39:    Not collective

 41:    Input Parameter:
 42: .  draw - the draw context

 44:    Output Parameter:
 45: .  yes - PETSC_TRUE if it is a null draw object; otherwise PETSC_FALSE

 47:    Level: advanced

 49: @*/
 50: int PetscDrawIsNull(PetscDraw draw,PetscTruth *yes)
 51: {
 52:   int        ierr;
 53:   PetscTruth isdrawnull;

 57:   PetscTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isdrawnull);
 58:   if (isdrawnull) *yes = PETSC_TRUE;
 59:   else            *yes = PETSC_FALSE;
 60:   return(0);
 61: }