Actual source code: dline.c
1: /*
2: Provides the calling sequences for all the basic PetscDraw routines.
3: */
4: #include src/sys/src/draw/drawimpl.h
5:
8: /*@
9: PetscDrawLine - PetscDraws a line onto a drawable.
11: Not collective
13: Input Parameters:
14: + draw - the drawing context
15: . xl,yl,xr,yr - the coordinates of the line endpoints
16: - cl - the colors of the endpoints
18: Level: beginner
20: Concepts: line^drawing
21: Concepts: drawing^line
23: @*/
24: PetscErrorCode PetscDrawLine(PetscDraw draw,PetscReal xl,PetscReal yl,PetscReal xr,PetscReal yr,int cl)
25: {
27: PetscTruth isdrawnull;
31: PetscTypeCompare((PetscObject)draw,PETSC_DRAW_NULL,&isdrawnull);
32: if (isdrawnull) return(0);
33: (*draw->ops->line)(draw,xl,yl,xr,yr,cl);
34: return(0);
35: }
39: /*@
40: PetscDrawIsNull - Returns PETSC_TRUE if draw is a null draw object.
42: Not collective
44: Input Parameter:
45: . draw - the draw context
47: Output Parameter:
48: . yes - PETSC_TRUE if it is a null draw object; otherwise PETSC_FALSE
50: Level: advanced
52: @*/
53: PetscErrorCode PetscDrawIsNull(PetscDraw draw,PetscTruth *yes)
54: {
56: 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: }