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: #undef __FUNCT__  
  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: int PetscDrawLine(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr,int cl)
 26: {
 27:   int        ierr;
 28:   PetscTruth isdrawnull;

 32:   PetscTypeCompare((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: }

 38: #undef __FUNCT__  
 40: /*@
 41:    PetscDrawIsNull - Returns PETSC_TRUE if draw is a null draw object.

 43:    Not collective

 45:    Input Parameter:
 46: .  draw - the draw context

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

 51:    Level: advanced

 53: @*/
 54: int PetscDrawIsNull(PetscDraw draw,PetscTruth *yes)
 55: {
 56:   int        ierr;
 57:   PetscTruth isdrawnull;

 61:   PetscTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isdrawnull);
 62:   if (isdrawnull) *yes = PETSC_TRUE;
 63:   else            *yes = PETSC_FALSE;
 64:   return(0);
 65: }