The "scatplt" Package

These routines are meant to provide a high level mechanism to create and manipulate scatter plots (2-dimensional slices of Karma data structures). These scatter plots utilise the world canvases available in the canvas package, hence the resulting code is device independent. NOTE: THIS PACKAGE IS WORK IN PROGRESS. THE INTERFACE MAY CHANGE IN THE NEXT RELEASE, POSSIBLY WITHOUT NOTICE.

Library: karmagraphics
Link With: -lkarmagraphics

Functions

scatplt_initInitialise the package for a particular canvas.
scatplt_createCreate scatter plot.
scatplt_set_activeSet active state for a scatter plot controlled refresh.
scatplt_set_all_inactiveClear active state all scatter plots controlled refresh.
scatplt_destroyDestroy scatter plot.
scatplt_register_destroy_funcRegister destroy callback.
scatplt_get_worldcanvasGet the world canvas for a scatter plot.
scatplt_find_closestFind the closest point to a specified position.
scatplt_find_closest_allFind the closest point to a specified position.
scatplt_create_vvCreate a value-value scatter plot from two 2D sub-arrays.
scatplt_create_smart_cursorCreate a smart cursor.

Prototype Functions

scatplt_PROTO_destroy_funcProcess a destroy event on a scatter plot.
scatplt_PROTO_cursor_funcProcess a smart cursor event on a scatter plot.

Tables

scatplt_CANVAS_ATTRIBUTESList of canvas attributes for scatter plots


Functions


EXPERIMENTAL FUNCTION: subject to change without notice

void scatplt_init (KWorldCanvas canvas, ...)

This routine will initialise the scatplt package for a particular world canvas. Calling this routine causes a number of callback routines internal to the package to be registered with the canvas (such as refresh and position event callbacks). This routine must be called before creating scatter plots.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KScatterPlot scatplt_create (KWorldCanvas canvas, unsigned int num_points, CONST double *x, CONST double *y, uaddr key)

This routine will create a scatter plot object from two arrays of values. At a later time, this scatter plot may be made visible. This routine will not cause the canvas to be refreshed.

Parameters:

Returns: A KScatterPlot object on success, NULL.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

flag scatplt_set_active (KScatterPlot plot, flag active, flag force_refresh, flag refresh_if_changed, flag exclusive, uaddr key)

This routine will make a scatter plot active or inactive.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag scatplt_set_all_inactive (KWorldCanvas canvas, flag force_refresh, flag refresh_if_changed, uaddr key)

This routine will make all scatter plots associated with a world canvas inactive.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void scatplt_destroy (KScatterPlot plot)

This routine will destroy a scatter plot.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KCallbackFunc scatplt_register_destroy_func (KScatterPlot plot, void (*func) (), void *info)

This routine will register a destroy function for a scatter plot. The function will be called when the canvas is destroyed. Many destroy functions may be registered per plot. The first function registered is the first function called upon destruction.

Parameters:

Returns: A KCallbackFunc object. On failure, the process aborts.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KWorldCanvas scatplt_get_worldcanvas (KScatterPlot plot)

Get the world canvas for a scatter plot.

Parameters:

Returns: The KWorldCanvas object.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag scatplt_find_closest (KScatterPlot plot, double xin, double yin, double *xout, double *yout, uaddr *index, flag subpixel, double search_radius)

Find the closest point to a specified position.

Parameters:

Returns: TRUE if a close point was found, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag scatplt_find_closest_all (KWorldCanvas canvas, double xin, double yin, double *xout, double *yout, uaddr *index, KScatterPlot *plot, flag subpixel, double search_radius)

Find the closest point to a specified position.

Parameters:

Returns: TRUE if a close point was found, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KScatterPlot scatplt_create_vv (KWorldCanvas canvas, CONST char *array1,CONST array_desc *arr_desc1, unsigned int xdim1, unsigned int ydim1, unsigned int type1, double scale1, double offset1, KwcsAstro ap1, unsigned int num_restr1, CONST char **restr_names1, CONST double *restr_values1, double *min1, double *max1, uaddr xstart, uaddr xlen, uaddr ystart, uaddr ylen, CONST char *array2,CONST array_desc *arr_desc2, unsigned int xdim2, unsigned int ydim2, unsigned int type2, double scale2, double offset2, KwcsAstro ap2, unsigned int num_restr2, CONST char **restr_names2, CONST double *restr_values2, double *min2, double *max2)

Create a value-value scatter plot from two 2D sub-arrays.

Parameters:

Returns: A KScatterPlot object on success, NULL.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

void scatplt_create_smart_cursor (KWorldCanvas canvas, double search_radius, flag (*func) (), void *info)

Create a smart cursor.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


Prototype Functions


void scatplt_PROTO_destroy_func (void *info)

Process a destroy event on a scatter plot.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


flag scatplt_PROTO_cursor_func (KScatterPlot plot, double x, double y, uaddr index, void **info)

Process a smart cursor event on a scatter plot.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


Tables


scatplt_CANVAS_ATTRIBUTES List of canvas attributes for scatter plots

Name Get Type Set Type Meaning
SCATPLT_CANVAS_ATT_END End of varargs list


Back to Karma Home Page
Contact: Richard Gooch
Web Development: Ariel Internet Services