Actual source code: petscdraw.h
1: /*
2: Interface to the PETSc graphics (currently only support for X-windows
3: */
6: #include petscsys.h
11: /*J
12: PetscDrawType - String with the name of a PetscDraw
14: Level: beginner
16: .seealso: PetscDrawSetType(), PetscDraw, PetscViewer
17: J*/
18: #define PetscDrawType char*
19: #define PETSC_DRAW_X "x"
20: #define PETSC_DRAW_NULL "null"
21: #define PETSC_DRAW_WIN32 "win32"
22:
23: /*S
24: PetscDraw - Abstract PETSc object for graphics
26: Level: beginner
28: Concepts: graphics
30: .seealso: PetscDrawCreate(), PetscDrawSetType(), PetscDrawType
31: S*/
32: typedef struct _p_PetscDraw* PetscDraw;
41: /*MC
42: PetscDrawRegisterDynamic - Adds a method to the Krylov subspace solver package.
44: Synopsis:
45: PetscErrorCode PetscDrawRegisterDynamic(const char *name_solver,const char *path,const char *name_create,PetscErrorCode (*routine_create)(PetscDraw))
47: Not Collective
49: Input Parameters:
50: + name_solver - name of a new user-defined solver
51: . path - path (either absolute or relative) the library containing this solver
52: . name_create - name of routine to create method context
53: - routine_create - routine to create method context
55: Level: developer
57: Notes:
58: PetscDrawRegisterDynamic() may be called multiple times to add several user-defined solvers.
60: If dynamic libraries are used, then the fourth input argument (routine_create)
61: is ignored.
63: Sample usage:
64: .vb
65: PetscDrawRegisterDynamic("my_draw_type",/home/username/my_lib/lib/libO/solaris/mylib.a,
66: "MyDrawCreate",MyDrawCreate);
67: .ve
69: Then, your solver can be chosen with the procedural interface via
70: $ PetscDrawSetType(ksp,"my_draw_type")
71: or at runtime via the option
72: $ -draw_type my_draw_type
74: Concepts: graphics^registering new draw classes
75: Concepts: PetscDraw^registering new draw classes
77: .seealso: PetscDrawRegisterAll(), PetscDrawRegisterDestroy()
78: M*/
79: #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
80: #define PetscDrawRegisterDynamic(a,b,c,d) PetscDrawRegister(a,b,c,0)
81: #else
82: #define PetscDrawRegisterDynamic(a,b,c,d) PetscDrawRegister(a,b,c,d)
83: #endif
91: /*
92: Number of basic colors in the draw routines, the others are used
93: for a uniform colormap.
94: */
95: #define PETSC_DRAW_BASIC_COLORS 33
97: #define PETSC_DRAW_ROTATE -1 /* will rotate through the colors, start with 2 */
98: #define PETSC_DRAW_WHITE 0
99: #define PETSC_DRAW_BLACK 1
100: #define PETSC_DRAW_RED 2
101: #define PETSC_DRAW_GREEN 3
102: #define PETSC_DRAW_CYAN 4
103: #define PETSC_DRAW_BLUE 5
104: #define PETSC_DRAW_MAGENTA 6
105: #define PETSC_DRAW_AQUAMARINE 7
106: #define PETSC_DRAW_FORESTGREEN 8
107: #define PETSC_DRAW_ORANGE 9
108: #define PETSC_DRAW_VIOLET 10
109: #define PETSC_DRAW_BROWN 11
110: #define PETSC_DRAW_PINK 12
111: #define PETSC_DRAW_CORAL 13
112: #define PETSC_DRAW_GRAY 14
113: #define PETSC_DRAW_YELLOW 15
115: #define PETSC_DRAW_GOLD 16
116: #define PETSC_DRAW_LIGHTPINK 17
117: #define PETSC_DRAW_MEDIUMTURQUOISE 18
118: #define PETSC_DRAW_KHAKI 19
119: #define PETSC_DRAW_DIMGRAY 20
120: #define PETSC_DRAW_YELLOWGREEN 21
121: #define PETSC_DRAW_SKYBLUE 22
122: #define PETSC_DRAW_DARKGREEN 23
123: #define PETSC_DRAW_NAVYBLUE 24
124: #define PETSC_DRAW_SANDYBROWN 25
125: #define PETSC_DRAW_CADETBLUE 26
126: #define PETSC_DRAW_POWDERBLUE 27
127: #define PETSC_DRAW_DEEPPINK 28
128: #define PETSC_DRAW_THISTLE 29
129: #define PETSC_DRAW_LIMEGREEN 30
130: #define PETSC_DRAW_LAVENDERBLUSH 31
131: #define PETSC_DRAW_PLUM 32
135: #define PETSC_DRAW_FULL_SIZE -3
136: #define PETSC_DRAW_HALF_SIZE -4
137: #define PETSC_DRAW_THIRD_SIZE -5
138: #define PETSC_DRAW_QUARTER_SIZE -6
192: #define PetscDrawSetFilename(a,b) PetscDrawSetDisplay(a,b)
197: /*E
198: PetscDrawButton - Used to determine which button was pressed
200: Level: intermediate
202: .seealso: PetscDrawGetMouseButton(), PetscDrawSynchronizedGetMouseButton()
203: E*/
204: typedef enum {BUTTON_NONE,BUTTON_LEFT,BUTTON_CENTER,BUTTON_RIGHT,BUTTON_LEFT_SHIFT,BUTTON_CENTER_SHIFT,BUTTON_RIGHT_SHIFT} PetscDrawButton;
211: /*S
212: PetscDrawViewPorts - Subwindows in a PetscDraw object
214: Level: intermediate
216: Concepts: graphics
218: .seealso: PetscDrawViewPortsCreate(), PetscDrawViewPortsSet()
219: S*/
220: typedef struct {
221: PetscInt nports;
222: PetscReal *xl;
223: PetscReal *xr;
224: PetscReal *yl;
225: PetscReal *yr;
226: PetscDraw draw;
227: } PetscDrawViewPorts;
233: /*S
234: PetscDrawAxis - Manages X-Y axis
236: Level: advanced
238: Concepts: graphics, axis
240: .seealso: PetscDrawAxisCreate(), PetscDrawAxisSetLimits(), PetscDrawAxisSetColors(), PetscDrawAxisSetLabels()
241: S*/
242: typedef struct _p_DrawAxis* PetscDrawAxis;
254: /*S
255: PetscDrawLG - Manages drawing x-y plots
257: Level: advanced
259: Concepts: graphics, axis
261: .seealso: PetscDrawAxisCreate(), PetscDrawLGCreate(), PetscDrawLGAddPoint()
262: S*/
263: typedef struct _p_PetscDrawLG* PetscDrawLG;
282: /*S
283: PetscDrawSP - Manages drawing scatter plots
285: Level: advanced
287: Concepts: graphics, scatter plots
289: .seealso: PetscDrawSPCreate()
290: S*/
291: typedef struct _p_DrawSP* PetscDrawSP;
307: /*S
308: PetscDrawHG - Manages drawing histograms
310: Level: advanced
312: Concepts: graphics, histograms
314: .seealso: PetscDrawHGCreate()
315: S*/
316: typedef struct _p_DrawHG* PetscDrawHG;
334: /*
335: PetscViewer routines that allow you to access underlying PetscDraw objects
336: */
347: #endif