The "contour" Package

These routines are meant to provide a high level mechanism to create and manipulate contour images (2-dimensional slices of Karma data structures). These contour images 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

contour_initInitialise the package for a particular canvas.
contour_create_restrCreate contour image from 2D slice with restrictions.
contour_create_from_iarrayCreate a contour image from an Intelligent Array.
contour_create_sequenceCreate a sequence of contour images from a 3D slice.
contour_create_sequence_from_iarrayCreate a sequence of contour images from an Intelligent Array.
contour_set_activeSet active state for a contour image controlled refresh.
contour_set_all_inactiveClear active state all contour images controlled refresh.
contour_register_data_changeNotify data for contour image has changed.
contour_destroyDestroy contour image.
contour_set_canvas_attributesSet the contour image attributes for a world canvas.
contour_set_attributesSet the attributes for a KContourImage object.
contour_set_levelsSet/update the contour levels for a KContourImage object.
contour_get_worldcanvasGet the world canvas for a contour image.
contour_parse_levelsParse a textual contour level specification.
contour_unscale_levelsUnscale contour levels.

Tables

contour_CANVAS_ATTRIBUTESList of canvas attributes for contourable images
contour_CONTOUR_ATTRIBUTESList of attributes for contourable images


Functions


void contour_init (KWorldCanvas canvas, ...)

This routine will initialise the contour 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 contour images.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


KContourImage contour_create_restr (KWorldCanvas canvas, multi_array *multi_desc, array_desc *arr_desc, char *slice, unsigned int hdim, unsigned int vdim, unsigned int elem_index, unsigned int num_levels, CONST double *contour_levels, unsigned num_restr, char **restr_names, double *restr_values, uaddr key)

This routine will create a contour image object from a 2-dimensional slice of a Karma data structure. At a later time, this contour image may be made visible. This routine will not cause the canvas to be refreshed.

Parameters:

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


KContourImage contour_create_from_iarray (KWorldCanvas canvas, iarray array, flag swap, unsigned int num_levels, CONST double *contour_levels, uaddr key)

This routine will create a contour image object from a 2-dimensional Intelligant Array. At a later time, this contour image may be made visible. This routine will not cause the canvas to be refreshed. Many contour images may be associated with a single canvas.

Parameters:

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


KContourImage * contour_create_sequence (KWorldCanvas canvas, multi_array *multi_desc, array_desc *arr_desc, char *cube, unsigned int hdim, unsigned int vdim, unsigned int fdim, unsigned int elem_index, unsigned int num_levels, CONST double *contour_levels, uaddr key)

This routine will create a sequence of contour image objects from a 3-dimensional cube of a Karma data structure. At a later time, this sequence of contour images may be made visible in any order. This routine will not cause the canvas to be refreshed.

Parameters:

Returns: A pointer to a dynamically allocated array of contour image objects on success, else NULL.
Multithreading Level: Unsafe


KContourImage * contour_create_sequence_from_iarray (KWorldCanvas canvas, iarray array, unsigned int hdim, unsigned int vdim, unsigned int fdim, unsigned int num_levels, CONST double *contour_levels, uaddr key)

This routine will create a sequence of contour image objects from a 3-dimensional Intelligent Array. At a later time, this sequence of contour images may be made visible in any order. This routine will not cause the canvas to be refreshed.

Parameters:

Returns: A pointer to a dynamically allocated array of contour image objects on success, else NULL.
Multithreading Level: Unsafe


flag contour_set_active (KContourImage cimage, flag active, flag force_refresh, flag refresh_if_changed, flag exclusive, uaddr key)

This routine will make a contour image active or inactive.

Parameters:

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


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

This routine will make all contour images associated with a world canvas inactive.

Parameters:

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


flag contour_register_data_change (KContourImage cimage)

This routine will register a change in the Karma data structure associated with a contour image. If the contour image is active, it will be immediately redrawn on its canvas.

Parameters:

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


void contour_destroy (KContourImage cimage)

This routine will destroy a contour image.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


void contour_set_canvas_attributes (KWorldCanvas canvas, ...)

Set the contour image attributes for a world canvas.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


void contour_set_attributes (KContourImage cimage, ...)

Set the attributes for a KContourImage object.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


void contour_set_levels (KContourImage cimage, unsigned int num_levels, CONST double *contour_levels, CONST unsigned long *contour_pixels, CONST flag *dash, CONST double *linewidths)

This routine will set/update the contour levels for a KContourImage object. The canvas is not refreshed by this operation.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


KWorldCanvas contour_get_worldcanvas (KContourImage cimage)

Get the world canvas for a contour image.

Parameters:

Returns: The KWorldCanvas object.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

unsigned int contour_parse_levels (double *contour_levels, unsigned int max_levels, CONST char *string, double min, double max)

Parse a textual contour level specification.

Parameters:

Returns: The number of levels. On error 0 is returned.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_unscale_levels (double *contour_levels, flag *dash, double *linewidths, unsigned int num_levels, double scale, double offset, double neg_width, double pos_width)

Unscale contour levels.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


Tables


contour_CANVAS_ATTRIBUTES

Name Get Type Set Type Meaning
CONTOUR_CANVAS_ATT_END End of varargs list
CONTOUR_CANVAS_ATT_COLOURNAME CONST char * Colour name


contour_CONTOUR_ATTRIBUTES

Name Get Type Set Type Meaning
CONTOUR_CIMAGE_ATT_END End of varargs list
CONTOUR_CIMAGE_ATT_ACTIVE flag * flag Active state


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