xvgraphics(3)

NAME
xvgraphics - All routines that perform the graphics functions that are used by applications

DESCRIPTION
xvgraphics library containing all routines that perform the graphics functions that are used by applications such as the xprism2 and xprism3 plotting packages. There are a great number of routines available, to help the application programmer in plotting, displaying text, using vector fonts, sending output to printers, and performing many other operations.

For an explanation of all the following routines in greater detail, with explanations of all arguments to each routine, see the section on xvgraphics in the Khoros Programmer's Manual, chapter 8, Libraries.

ALL programs that utilize these routines MUST link against:
-lXaw -lXmu -lXt -lXext -lX11

ALL programs that utilize these routines MUST include the statement:
#include "xvgraphics.h"

AVAILABLE ROUTINES

X3D_init_graphics()

A call to X3D_init_graphics() must be the first call to any xvgraphics routine with a particular graphics environment, or context. This routine creates and initializes the internal X3D graphics structure, in preparation for future calls the the xvgraphics library, and associates it with the ID number specified. This call must be made by both 2D and 3D graphics applications.

X3D_init_graphics(id, dimension)
int id;
int dimension;

X3D_close_graphics()

A call to X3D_close_graphics() must be the last call to any xvgraphics routine with a particular graphics environment, or context. This routine deletes the internal data structure used by the xvgraphics library, and frees allocated memory. This call must be made by both 2D and 3D graphics applications.

X3D_close_graphics(id)
int id;

X3D_set_X11()

This routine sets the display, and the window or widget which will serve as that graphics workspace, so that graphics output will be sent to an X11 display and screen. This call must be made by both 2D and 3D graphics applications.

X3D_set_X11(id, display, window, widget)
int id;
Display *display;
Window window;
Widget widget;

X2D_set_window()

Sets the minimum and maximum device coordinates for the current window.

X2D_set_window(id, x, y, width, height)
int id;
short x, y;
short width;
short height;

X2D_set_viewport()

Sets the minimum and maximum viewport values within the current window.

X2D_set_viewport (id, xmin, xmax, ymin, ymax)
int id;
REAL xmin, xmax, ymin, ymax;

X2D_set_wc_min_max()

Sets the minimum and maximum world coordinate points for current window.

X2D_set_wc_min_max (id, wc_min, wc_max)
int id;
COORD wc_min, wc_max;

X2D_set_clipping()

Turns clipping to the viewport on or off.

X2D_set_clipping(id, on_off)
int id;
int on_off;

X3D_set_window()

Sets the minimum and maximum device coordinates for the current window.

X3D_set_window(id, x, y, width, height)
int id;
short x, y;
short width;
short height;

X3D_set_viewport()

Sets the minimum and maximum viewport values within the current window.

X3D_set_viewport (id, xmin, xmax, ymin, ymax, zmin, zmax)
int id;
float xmin, xmax;
float ymin, ymax;
float zmin, zmax;

X3D_set_wc_min_max()

Sets the minimum and maximum world coordinate points for current window.

X3D_set_wc_min_max (id, wc_min, wc_max)
int id;
COORD wc_min, wc_max;

X3D_set_projection()

Sets the projection type for the current graphics environment

X3D_set_projection (id, projection)
int id;
int projection;

X3D_set_viewpoint()

Sets the eye orientation for the current graphics environment

X3D_set_viewpoint (id, alpha, theta, eye_distance)
int id;
REAL alpha;
REAL theta;
REAL eye_distance;

X3D_set_view_distance()

Sets the distance of the eye from the viewport for the current graphics environment

X3D_set_view_distance (id, view_distance)
int id;
REAL view_distance;

X2D_inquire_window()

This routine returns the minimum and maximum device coordinates currently set for the graphics environment.

X2D_inquire_window (id, x, y, width, height)
int id;
short *x, *y;
short *width;
short *height;

X2D_inquire_viewport()

Returns the minimum and maximum viewport values currently set for the graphics environment.

X2D_inquire_viewport (id, xmin, xmax, ymin, ymax)
int id;
REAL *xmin, *xmax, *ymin, *ymax;

X2D_inquire_wc_min_max()

Returns the minimum and maximum world coordinate points currently set for the graphics environment.

X2D_inquire_wc_min_max(id, wc_min, wc_max)
int id;
COORD *wc_min, *wc_max;

X3D_inquire_window()

This routine returns the minimum and maximum device coordinates currently set for the graphics environment.

X3D_inquire_window (id, x, y, width, height)
int id;
short *x, *y;
short *width;
short *height;

X3D_inquire_viewport()

Returns the minimum and maximum viewport values currently set for the graphics environment.

X3D_inquire_viewport (id, xmin, xmax, ymin, ymax, zmin, zmax)
int id;
REAL *xmin, *xmax, *ymin, *ymax, *zmin, *zmax;

X3D_inquire_wc_min_max()

Returns the minimum and maximum world coordinate points currently set for the graphics environment.

X3D_inquire_wc_min_max (id, wc_min, wc_max)
int id;
COORD *wc_min;
COORD *wc_max;

X3D_inquire_projection()

Returns the projection type for the current graphics environment

X3D_inquire_projection (id, projection)
int id;
int *projection;

X3D_inquire_viewpoint()

Returns the eye orientation for the current graphics environment

X3D_inquire_viewpoint (id, alpha, theta, eye_distance)
int id;
REAL *alpha;
REAL *theta;
REAL *eye_distance;

X3D_inquire_view_distance()

Returns the distance of the eye from the viewport for the current graphics environment

X3D_inquire_view_distance (id, view_distance)
int id;
REAL *view_distance;

X3D_init_font()

Reads a Khoros font description file, and sets up the X3DFont structure for each character described there, so that characters can be drawn later using that font structure, referenced by fontname. This routine may be called by by both 2D and 3D graphics applications.

X3DFont *X3D_init_font(fontname, filename)
char *fontname;
char *filename;

X3D_set_font()

Sets the font to be used when drawing text. This routine may be called by by both 2D and 3D graphics applications.

X3D_set_font (id, fontname)
int id;
char *fontname;

X3D_set_text()

Sets the justification, spacing, and aspect ration to be used when drawing text. This routine may be called by by both 2D and 3D graphics applications.

X3D_set_text (id, justify, spacing, aspect)
int id;
int justify;
REAL spacing;
REAL aspect;

X3D_inquire_fonts()

Inquire which fonts are currently available. Returns an array of strings naming available fonts, and the number of strings. This routine may be called by by both 2D and 3D graphics applications.

char **X3D_inquire_fonts(fontnum)
int *fontnum;

X2D_draw_text()

Draws text into a window used for 2D graphics applications

X2D_draw_text (id, coord, vector, width, height, string, size, fg)
int id;
COORD coord;
VECTOR vector;
REAL width, height;
char *string;
int size;
XColor *fg;

X3D_draw_text()

Draws text into a window used for 3D graphics applications

X3D_draw_text (id, coord, vector, width, height, depth, string, size, fg)
int id;
COORD coord;
VECTOR vector;
REAL width, height, depth;
char *string;
int size;
XColor *fg;

X2D_clear_text()

Clears text from a window used for 2D graphics applications

X2D_clear_text(id, coord, vector, width, height, size, bg)
int id;
COORD coord;
VECTOR vector;
COORD coord;
REAL width, height;
int size;
XColor *bg;

X3D_clear_text()

Clears text from a window used for 3D graphics applications

X3D_clear_text(id, coord, vector, width, height, depth, size, bg)
int id;
COORD coord;
VECTOR vector;
COORD coord;
REAL width, height, depth;
int size;
XColor *bg;

X2D_draw_bargraph()

Draws a bargraph in two dimensions.

X2D_draw_bargraph (id, coords, size, fg)
int id;
COORD *coords;
int size;
XColor *fg;

X2D_draw_colorline()

Draws a multi-colored line, according to the different color levels in two dimensions.

X2D_draw_colorline(id, coords, size, levels, colors, num_levels)
int id;
COORD *coords;
int size;
REAL *levels;
XColor *colors;
int num_levels;

X2D_draw_discrete()

Draws a discrete plot in two dimensions.

X2D_draw_discrete (id, coords, size, fg)
int id;
COORD *coords;
int size;
XColor *fg;

X2D_draw_line()

Draws a single line in two dimensions.

X2D_draw_line(id, coord1, coord2, fg)
int id;
COORD coord1, coord2;
XColor *fg;

X2D_draw_linemarker()

Draws a two dimensional linemarker plot (a 2D plot with data points marked).

X2D_draw_linemarker (id, coords, size, marker_type, fg)
int id;
COORD *coords;
int size;
int marker_type;
XColor *fg;

X2D_draw_polygon()

Draws a two dimensional polygon

X2D_draw_polygon (id, coords, size, fg)
int id;
COORD *coords;
int size;
XColor *fg;

X2D_draw_polyline()

Draws a two dimensional polyline

X2D_draw_polyline (id, coords, size, fg)
int id;
COORD *coords;
int size;
XColor *fg;

X2D_draw_polymarker()

Draws a two dimensional polymarker plot

X2D_draw_polymarker (id, coords, size, marker_type, fg)
int id;
COORD *coords;
int size;
int marker_type;
XColor *fg;

X2D_draw_rectangle()

Draws a rectangle

X2D_draw_rectangle (id, coord, width, height, fg)
int id;
COORD coord;
int width;
int height;
XColor *fg;

X2D_draw_segments()

Draws a set of lines in two dimensions.

X2D_draw_segments (id, coords, size, fg)
int id;
COORD *coords;
int size;
XColor *fg;

X3D_draw_colorline()

Draws a multi-colored line, according to the different color levels, in three dimensions.

X3D_draw_colorline(id, coords, size, levels, colors, num_levels)
int id;
COORD *coords;
int size;
REAL *levels;
XColor *colors;
int num_levels;

X3D_draw_colormesh()

Draws a mesh plot in three dimensions using different color levels.

X3D_draw_colormesh(id, coords, row_size, size, levels,
                        colors, num_levels, bg, wcmin, wcmax)
int id;
COORD *coords;
int row_size;
int size;
REAL *levels;
XColor *colors;
int num_levels;
XColor     *bg;
COORD wcmin, wcmax;

X3D_draw_contour()

Draws a contour plot in three dimensions using different color levels.

X3D_draw_contour(id, coords, row_size, size, levels,
                        colors, num_levels, base)
int id;
COORD *coords;
int row_size;
int size;
REAL *levels;
XColor *colors;
int num_levels;
int base;

X3D_draw_horizon()

Draws a horizon plot in three dimensions.

X3D_draw_horizon(id, coords, rows, size, fg, bg, wcmin, wcmax)
int id;
COORD *coords;
int rows;
int size;
XColor *fg, *bg;
COORD wcmin, wcmax;

X3D_draw_impulse()

raws an impulse plot in three dimensions.

X3D_draw_impulse(id, coords, size, fg)
int id;
COORD *coords;
int size;
XColor *fg;

X3D_draw_line()

Draws a single line in three dimensions.

X3D_draw_line(id, coord1, coord2, fg)
int id;
COORD *coord1;
COORD *coord2;
XColor *fg;

X3D_draw_lineplot()

Draws a line plot in three dimensions.

X3D_draw_lineplot(id, coords, row_size, size, fg)
int id;
COORD *coords;
int row_size;
int size;
XColor *fg;

X3D_draw_mesh()

Draws a mesh plot in three dimensions.

X3D_draw_mesh(id, coords, row_size, size, fg, bg)
int id;
COORD *coords;
int row_size;
int size;
XColor *fg, *bg;

X3D_draw_polygon()

Draws a polygon in three dimensions.

X3D_draw_polygon(id, coords, size, fg, bg)
int id;
COORD *coords;
int size;
XColor *fg, *bg;

X3D_draw_polyline()

Draws a polyline in three dimensions.

X3D_draw_polyline(id, coords, size, fg)
int id;
COORD *coords;
int size;
XColor *fg;

X3D_draw_polymarker()

Draws a polymarker plot in three dimensions.

X3D_draw_polymarker(id, coords, size, marker_type, fg)
int id;
COORD *coords;
int size;
int marker_type;
XColor *fg;

X3D_draw_rectangle()

Draws a rectangle in three dimensions.

X3D_draw_rectangle(id, coord, width, height, depth, fg)
int id;
COORD coord;
REAL width;
REAL height;
REAL depth;
XColor *fg;

X3D_draw_segments()

Draws a series of line segments in three dimensions.

X3D_draw_segments(id, coords, size, fg)
int id;
COORD *coords;
int size;
XColor *fg;

X3D_draw_surface()

Draws a surface plot in three dimensions using different color levels.

X3D_draw_surface(id, coords, row_size, size, levels,
                        colors, num_levels, wcmin, wcmax, use_image,
            interp_image)
int id;
COORD *coords;
int row_size;
int size;
REAL *levels;
XColor *colors;
int num_levels;
COORD wcmin, wcmax;
int    use_image;
int    interp_image;

X3D_draw_wireframe()

Draws a wireframe plot in three dimensions.

X3D_draw_wireframe(id, coords, row_size, size, fg)
int id;
COORD *coords;
int row_size;
int size;
XColor *fg;

X3D_set_line_type()

Sets the line type for a given graphics environment. May be used by both 2D and 3D graphics applications.

X3D_set_line_type(id, line_type)
int id;
int line_type;

X3D_set_line_width()

Sets the line width for a given graphics environment. May be used by both 2D and 3D graphics applications.

X3D_set_line_width(id, line_width)
int id;
int line_width;

X2D_clear_area()

This routine will clear an area of a window that is used for two dimensional operations.

X2D_clear_area(id, wc_min, wc_max)
int id;
COORD wc_min, wc_max;

X2D_clear_window()

This routine will clear a window that is used for 2D graphical operations.

X2D_clear_window(id)
int id;

X2D_raise_window()

This routine will raise a window that is used for 2D graphical operations.

X2D_raise_window(id)
int id;

X3D_clear_area()

This routine will clear a window that is used for 3D graphical operations.

X3D_clear_area(id, wc_min, wc_max)
int id;
COORD wc_min, wc_max;

X3D_clear_window()

This routine will clear an area of a window that is used for two dimensional operations.

X3D_clear_window(id)
int id;

X3D_raise_window()

This routine will raise a window that is used for 3D graphical operations.

X3D_raise_window(id)
int id;

X2D_translate_coords()

Translates an array of 2D world coordinates to their new world coordinate positions.

X2D_translate_coords (xtrans, ytrans, coords, size)
REAL xtrans, ytrans;
COORD *coords;
int size;

X2D_scale_coords()

Scales an array of 2D world coordinates to their new world coordinate positions.

X2D_scale_coords (xscale, yscale, coords, size)
REAL xscale, yscale;
COORD *coords;
int size;

X2D_rotate_coords()

Rotate an array of 2D coordinates to their new world coordinate positions.

X2D_rotate_coords (rotation, center, coords, size)
REAL rotation;
COORD center;
COORD *coords;
int size;

X3D_translate_coords()

Translates an array of 3D world coordinates to their new world coordinate positions.

X3D_translate_coords (xtrans, ytrans, ztrans, coords, size)
REAL xtrans, ytrans, ztrans;
COORD *coords;
int size;

X3D_scale_coords()

Scales an array of 3D world coordinates to their new world coordinate positions.

X3D_scale_coords (xscale, yscale, zscale, coords, size)
REAL xscale, yscale, zscale;
COORD *coords;
int size;

X3D_rotate_coords()

Rotate an array of 3D coordinates to their new world coordinate positions.

X3D_rotate_coords (xrotate, yrotate, zrotate, center, coords, size)
REAL xrotate, yrotate, zrotate;
COORD center;
COORD *coords;
int size;

X3D_set_impress()

Output graphics to ImPress file

X3D_set_impress(id, file, width, height, xoffset, yoffset, overlay, landscape)
int id;
FILE *file;
float width, height, xoffset, yoffset;
int overlay;
int landscape;

X3D_set_HPGL()

Output graphics to HPGL file

X3D_set_HPGL(id, file, width, height, xoffset, yoffset, overlay, landscape)
int id;
FILE *file;
float width, height, xoffset, yoffset;
int overlay;
int landscape;

X3D_set_postscript()

Output graphics to PostScript file

X3D_set_postscript(id, file, width, height, xoffset, yoffset, overlay, landscape, monochrome, invert, bg)
int id;
FILE *file;
float width, height, xoffset, yoffset;
int overlay;
int landscape;
int monochrome;
int invert;
XColor *bg;

X3D_set_X11()

Output graphics to X11 screen.

X3D_set_X11(id, display, window, widget)
int id;
Display *display;
Window window;
Widget widget;

X3D_close_device()

Stop output to whichever device is currently active (X11 screen, Postscript file, ImPress file, or HPGL file)

X3D_close_device(id)
int id;

X3D_allocate_named_color()

Allocate an XColor structure according to the name of the color passed in.

X3D_allocate_named_color(id, colorname, Color, verbose, monochrome)
int id;
char *colorname;
XColor *Color;
int verbose;
int monochrome;

X3D_allocate_named_colors()

Allocate an array of XColor structures according to the colornames passed in.

X3D_allocate_named_colors(id, colornames, Colors, size, verbose, monochrome)
int id;
char *colornames[];
XColor *Colors[];
int size;
int verbose;
int monochrome;

X3D_allocate_predefined_colors()

Allocate an array of XColor structures according a predefined algorithm.

X3D_allocate_predefined_colors(id, Colors, size, verbose, monochrome)
int id;
char *colornames[];
XColor *Colors[];
int size;
int verbose;
int monochrome;