group_array_manager

Synopsis

This module enables you to add, replace, swap and delete groups in an array. It copies the input to a new group and maintains an array of references to these objects.

Inputs

Name Type Description

in
selected int the current item in out, see below
other int the other item in out, see below
add int add in to out
replace int replace selected in out with in
swap int swap selected and other in out
delete int delete selected in out
farm group & An empty group to contain the array elements

Output Ports

Name Type Description

nGroups int number of groups in array
out group [] array of group references

Description

Originally written to maintain an array of snap-shot images but generalised to any group type (even a hetergenous array I guess) it allows you to add, replace, swap and delete groups in an array. It actually copies the input to a new group (at a specified location) and maintains an array of references to these groups.

Parameters

Inputs

in

A group that will be added to the out array if the add or replace values change.

selected

The currently selected item in out, see below.

other

Another selected item in out, see below

add

When this value changes the object referenced by in will be added to the end of out

replace

When this value changes the selected item in out will be replaced with the object referenced by in.

swap

When this value changes the selected item and other in out are swapped, nothing will be done if selected and other are equal.

delete

When this value changes the selected item in out is deleted.

farm

This should be connected to an empty group into which the group elements will be copied and maintained.

Outputs

nGroups

The number of groups hence the size of the array.

out

The array of group references, all the groups are contained in the object (usually another group that is reference by farm).

Example

GroupArrManEg, load an image and then press the Add button on the Group Array Manager Panel, do this for a few images. This example contains a simple UI, I haven't constructed a proper UI/user macro as it is more a developers module who will probably want to create the UI as part of additional functionality.

Files

iac_proj/grparman/grparman.v defines the library

iac_proj/grparman/gam_mods.v module parameter block definition

iac_proj/grparman/gam_macs.v macro definitions, contains a simple functional macro

iac_proj/grparman/gam_apps.v example application

Other Notes

The object into which the groups are copied is called the farm since original the module worked only with Fields - get it? The farm has to refer to a external group because it always crashed if I added the groups to within the module itself, maybe this is because I'm using C++ and it mucks up the module class? I've defined a parameter block for your convience grparrmanParams and a functional macro GroupArrayManager, which uses this and adds a the usually I/O links.

Author

James S. Perrin : <A HREF="mailto:james.perrin@man.ac.uk">james.perrin@man.ac.uk</A>,
Manchester Visualization Centre

Contact

International AVS Centre
Manchester Visualization Centre
Kilburn Building
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL