Actual source code: dline.c

      1: #define PETSC_DLL
      2: /*
      3:        Provides the calling sequences for all the basic PetscDraw routines.
      4: */
     5:  #include src/sys/src/draw/drawimpl.h
      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 PETSC_DLLEXPORT PetscDrawLine(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr,int cl)
     26: {
     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: }

     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: PetscErrorCode PETSC_DLLEXPORT PetscDrawIsNull(PetscDraw draw,PetscTruth *yes)
     55: {
     57:   PetscTruth isdrawnull;

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