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_groupCreate a container to hold a group of KContourImage objects.
contour_destroy_groupDestroy a group of KContourImage objects.
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_destroyDestroy contour image.
contour_create_viewable_groupCreate container to hold group of KViewableContourImage objects.
contour_destroy_viewable_groupDestroy a group of KViewableContourImage objects.
contour_create_viewableCreate viewable contour image.
contour_create_viewable_sequenceCreate a sequence of viewable contour images.
contour_destroy_viewableDestroy a viewable contour image.
contour_set_activeSet active state for a viewable contour image.
contour_set_all_inactiveClear active state for all viewable contour images in a group.
contour_register_data_changeNotify data for contour image has changed.
contour_set_canvas_attributesSet the contour image attributes for a world canvas.
contour_set_levelsSet/update the contour levels for a KContourImage object.
contour_set_group_levelsSet/update contour levels for a group of KContourImage objects.
contour_set_level_stylesSet/update contour level styles for KViewableContourImage object.
contour_set_group_level_stylesSet/update clevel styles for KViewableContourImage objects.
contour_get_worldcanvasGet the world canvas for a viewable 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


EXPERIMENTAL FUNCTION: subject to change without notice

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


EXPERIMENTAL FUNCTION: subject to change without notice

KContourImageGroup contour_create_group ()

Create a container to hold a group of KContourImage objects.

Parameters:

Returns: The group container on success, else NULL.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_destroy_group (KContourImageGroup group)

Destroy a group of KContourImage objects.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KContourImage contour_create_restr (multi_array *multi_desc, array_desc *arr_desc, char *slice, unsigned int hdim, unsigned int vdim, unsigned int elem_index, unsigned int num_restr, char **restr_names, double *restr_values, KContourImageGroup group)

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 used to create a viewable contour image.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

KContourImage contour_create_from_iarray (iarray array, flag swap, KContourImageGroup group)

This routine will create a contour image object from a 2-dimensional Intelligent Array. At a later time, this contour image may be used to create a viewable contour image.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

KContourImage * contour_create_sequence (multi_array *multi_desc, array_desc *arr_desc, char *cube, unsigned int hdim, unsigned int vdim, unsigned int fdim, unsigned int elem_index, KContourImageGroup group)

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 used to create a sequence of viewable contour images.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

KContourImage * contour_create_sequence_from_iarray (iarray array, unsigned int hdim, unsigned int vdim, unsigned int fdim, KContourImageGroup group)

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 used to create a sequence of viewable contour images.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_destroy (KContourImage cimage)

This routine will destroy a contour image.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

KViewableContourImageGroup contour_create_viewable_group ()

Create container to hold group of KViewableContourImage objects.

Parameters:

Returns: The group container on success, else NULL.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_destroy_viewable_group (KViewableContourImageGroup group)

Destroy a group of KViewableContourImage objects.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KViewableContourImage contour_create_viewable (KContourImage cimage, KWorldCanvas canvas, KViewableContourImageGroup group)

This routine will create a viewable contour image object from a contour image. At a later time, this viewable contour image may be made visible. This routine will not cause the canvas to be refreshed.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

KViewableContourImage * contour_create_viewable_sequence (KContourImage *cimages, unsigned int num, KWorldCanvas canvas, KViewableContourImageGroup group)

This routine will create a sequence of viewable contour image objects from a sequence of contour images. At a later time, these viewable contour images may be made visible. This routine will not cause the canvas to be refreshed.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_destroy_viewable (KViewableContourImage vcimage)

This routine will destroy a viewable contour image.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag contour_set_active (KViewableContourImage vcimage, flag active, flag force_refresh, flag refresh_if_changed)

This routine will make a viewable contour image active or inactive.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

flag contour_set_all_inactive (KViewableContourImageGroup group, flag refresh_if_changed)

This routine will make all viewable contour images in a group inactive.

Parameters:

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


EXPERIMENTAL FUNCTION: subject to change without notice

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


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_set_canvas_attributes (KWorldCanvas canvas, ...)

Set the contour image attributes for a world canvas.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_set_levels (KContourImage cimage, unsigned int num_levels, CONST double *contour_levels)

This routine will set/update the contour levels for a KContourImage object. Canvases are not refreshed by this operation.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_set_group_levels (KContourImageGroup group, unsigned int num_levels, CONST double *contour_levels)

This routine will set/update the contour levels for a group of KContourImage objects. Canvases are not refreshed by this operation.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_set_level_styles (KViewableContourImage vcimage, CONST unsigned long *contour_pixels, CONST flag *dash, CONST double *linewidths)

This routine will set/update the contour level tyles for a KViewableContourImage object. No canvas is refreshed by this operation.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void contour_set_group_level_styles (KViewableContourImageGroup group, CONST unsigned long *contour_pixels, CONST flag *dash, CONST double *linewidths)

This routine will set/update the contour level styles for a group of KViewableContourImage objects. No canvas is refreshed by this operation.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

KWorldCanvas contour_get_worldcanvas (KViewableContourImage vcimage)

Get the world canvas for a viewable 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 List of canvas attributes for contourable images

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 List of attributes for contourable images

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