The "graph1d" Package

These routines are meant to provide a high level mechanism to graph a 1-dimensional array of values. NOTE: THIS PACKAGE IS WORK IN PROGRESS. THE INTERFACE MAY CHANGE IN THE NEXT RELEASE, POSSIBLY WITHOUT NOTICE.

Library: karmagraphics
Link With: -lkarmagraphics

Functions

graph1d_initInitialise the package for a particular canvas.
graph1d_set_canvas_attributesSet attributes for a canvas.
graph1d_test_if_zoomed_horizontallyTest if a canvas is zoomed horizontally.
graph1d_unzoomUnzoom a canvas.
graph1d_refresh_if_neededRefresh a canvas if needed.
graph1d_createCreate viewable graph.
graph1d_set_vgraph_attributesSet attributes for a viewable graph.
graph1d_set_activeSet active state for a viewable graph controlled refresh.
graph1d_set_all_inactiveClear active state all viewable graphs controlled refresh.
graph1d_destroyDestroy a viewable graph.
graph1d_register_destroy_funcRegister destroy callback.
graph1d_get_worldcanvasGet the world canvas for a viewable graph.
graph1d_change_draw_orderChange the draw order for a viewable graph.
graph1d_get_lastGet last viewable graph for a world canvas.
graph1d_allocate_coordsAllocate co-ordinates for a viewable graph.
graph1d_set_sizeSet the size of a viewable graph.
graph1d_get_sizeGet the size of a viewable graph.
graph1d_save_asciiSave the data in a viewable graph in ASCII format.
graph1d_orthogonal_createCreate an object for later viewing of orthogonal profiles.
graph1d_orthogonal_destroyDestroy an orthogonal profile.
graph1d_orthogonal_register_destroy_funcRegister destroy callback.
graph1d_orthogonal_invalidateInvalidate an orthogonal profile.
graph1d_orthogonal_show_traceShow a trace.
graph1d_orthogonal_show_tracesShow a weighted, summed trace.
graph1d_orthogonal_show_boxed_traceShow a boxed trace.
graph1d_orthogonal_configure_canvasConfigure a canvas using an orthogonal profile object.
graph1d_orthogonal_saveSave orthogonal profile data to a file.
graph1d_orthogonal_track_computeCompute track strings.


Functions


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_init (KWorldCanvas canvas)

This routine will initialise the graph1d 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 viewable graphs.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_set_canvas_attributes (KWorldCanvas canvas, ...)

Set attributes for a canvas.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag graph1d_test_if_zoomed_horizontally (KWorldCanvas canvas)

Test if a canvas is zoomed horizontally.

Parameters:

Returns: TRUE if the canvas is zoomed, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_unzoom (KWorldCanvas canvas, flag horizontal, flag vertical, flag auto_v)

Unzoom a canvas.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_refresh_if_needed (KWorldCanvas canvas)

Refresh a canvas if needed.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KViewableGraph graph1d_create (KWorldCanvas canvas, unsigned int num_points, double **x, double **y, uaddr key, ...)

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

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_set_vgraph_attributes (KViewableGraph vgraph, ...)

Set attributes for a viewable graph.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag graph1d_set_active (KViewableGraph vgraph, flag active,flag force_refresh, flag refresh_if_changed, flag exclusive, uaddr key)

This routine will make a viewable graph active or inactive.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

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

This routine will make all viewable graphs associated with a world canvas inactive.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_destroy (KViewableGraph vgraph)

Destroy a viewable graph.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KCallbackFunc graph1d_register_destroy_func (KViewableGraph vgraph, void (*func) (), void *info)

This routine will register a destroy function for a viewable graph. The function will be called when the canvas is destroyed. Many destroy functions may be registered per graph. 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 graph1d_get_worldcanvas (KViewableGraph vgraph)

Get the world canvas for a viewable graph.

Parameters:

Returns: The KWorldCanvas object.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_change_draw_order (KViewableGraph vgraph, KViewableGraph position, flag before)

Change the draw order for a viewable graph.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KViewableGraph graph1d_get_last (KWorldCanvas canvas)

Get last viewable graph for a world canvas.

Parameters:

Returns: The viewable graph if there is one, else NULL.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag graph1d_allocate_coords (KViewableGraph vgraph, unsigned int num_coords, double **x, double **y)

Allocate co-ordinates for a viewable graph.

Parameters:

Returns: TRUE on success, else FALSE, indicating an allocation error.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_set_size (KViewableGraph vgraph, unsigned int num_points)

Set the size of a viewable graph.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

unsigned int graph1d_get_size (KViewableGraph vgraph, double **x, double **y)

Get the size of a viewable graph.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag graph1d_save_ascii (KViewableGraph vgraph, Channel channel)

Save the data in a viewable graph in ASCII format.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

KOrthogonalProfile graph1d_orthogonal_create (KWorldCanvas canvas,iarray array, KViewableGraph *vgraph)

Create an object for later viewing of orthogonal profiles.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_orthogonal_destroy (KOrthogonalProfile profile)

Destroy an orthogonal profile.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KCallbackFunc graph1d_orthogonal_register_destroy_func (KOrthogonalProfile profile, void (*func) (), void *info)

This routine will register a destroy function for an orthogonal profile. Many destroy functions may be registered per profile. 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

void graph1d_orthogonal_invalidate (KOrthogonalProfile profile)

Invalidate an orthogonal profile.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_orthogonal_show_trace (KOrthogonalProfile profile, CONST unsigned int *dim_indices, flag correct_aberration, CONST uaddr *coord_indices, uaddr refpos)

Show a trace.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_orthogonal_show_traces (KOrthogonalProfile profile, CONST unsigned int *dim_indices, flag correct_aberration, flag sum, float global_weight, unsigned int num_traces, CONST uaddr *coord_indices, uaddr refpos, CONST float *weights)

Show a weighted, summed trace.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_orthogonal_show_boxed_trace (KOrthogonalProfile profile, CONST unsigned int *dim_indices, flag sum, CONST uaddr *start_indices, CONST uaddr *stop_indices, uaddr refpos)

Show a boxed trace.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_orthogonal_configure_canvas (KOrthogonalProfile profile)

Configure a canvas using an orthogonal profile object.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void graph1d_orthogonal_save (KWorldCanvas canvas, CONST char *filename)

Save orthogonal profile data to a file.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

flag graph1d_orthogonal_track_compute (KWorldCanvas canvas, double x, double y, double x_lin, char x_string[STRING_LENGTH], char y_string[STRING_LENGTH])

Compute track strings.

Parameters:

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


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