isolabel

Synopsis

A mapper module that adds text labels to isolines. It processes the output from the isoline module and generates a DataObject that can be directly displayed.

Input Ports

Name Type Description

in Mesh + Node Data input data used to generate labels

Parameters

Name Type Description UI Control

num_labels int number of labels UIslider
format string formating specification -
dec_pnts int number of decimal points UIslider

Output Ports

Name Type Description

out_mesh Mesh locations of labels
out_text string[] text of labels
out_obj DataObject directly renderable output object

Description

The isolabel macro generates and displays text annotation labels for isoline visualizations. It connects to the field output of the isoline module and generates a Point mesh and an array of string values. The macro also generates a DataObject which can be viewed directly. In most cases it will only be necessary to use the generated DataObject. However if you wish to use the raw outputs the Point mesh contains the position of the labels while the string array contains the actual label text at each point. The number of labels output and number of decimal points displayed can both be controlled through a user interface. A text_glyph user interface is also presented so that the text display can be controlled. The module is designed to work best when used with an isoline module, however it can be used to generate text labels for any Mesh with a matching set of scalar Node data.

The label placement algorithm is quite simple and works best in a 2D isoline context. The module subsamples the input node list at even intervals. This will generate a series of nodes that are regularly spaced throughout the input data. Provided the input nodes are distributed evenly in space the output nodes should also be evenly distributed. Although this method works acceptably in most contexts it should be noted that it is not suitable for animation. Due to the way the algorithm works the labels move around unpredictably as parameters are changed. Hence, for example, recording a moving othroslice with labels would not be possible. The display DataObject is generated by using a text_glyph module internally. A standard user interface is displayed for this module.

Inputs

in

Reference to a set of Field data which should be used by the module to generate the text labels. The Field should consist of a Mesh and Node Data. Only the first set of Node data is used and that Node data must be scalar.

Parameters

num_labels

A member of the Isolabel_Params parameter block group, this integer value is used to specify the number of text labels that should be generated. The UI slider component sets a maximum of 50 labels. If more labels are required the parameter can be directly modified. In theory the macro should be able to generate any number of labels.

format

A member of the Isolabel_Params parameter block group, this string value is used to specify the C style formatting specification. This sets how the Node data values should be converted into text. Normally it should not be necessary to alter this parameter and hence there is no user interface. Further details of the use of this parameter can be found in the low-level module documentation.

dec_pnts

A member of the Isolabel_Params parameter block group, this integer value is used to specify the number of decimal points that each text labels should have. Internally this parameter is used to generate a formatting string that is passed to the low-level module.

Outputs

out_mesh

Point mesh containing the locations of each text label. If the input mesh contains any transformation data this is copied across to the output mesh.

out_text[]

String array containing the actual label text that should be displayed.

out_obj

The directly renderable output of the isolabel macro. This contains a DataObject object that can be rendered by the standard data viewers. The output object will contain the generated text labels placed at the appropriate positions. The output object is generated internally by a text_glyph module. If more control of the display is required the other outputs can be used. Alternatively the Functional macro could be used directly.

Utility Macros

The User Macro isolabel combines the Functional Macro Isolabel with the UI Macro IsolabelUI and the standard module text_glyph. The User macro also makes use of the common parameter block Isolabel_Params to tie the Functional Macro and UI macro together.

Example

Two example applications are provided, IsolabelEg1 and IsolabelEg2. These applications generate text labels for 2D and 3D isoline plots.

Files

iac_proj/isolabel/isl_macs.v contains the V definitions of the Functional Macro Isolabel, the User macro isolabel, the UI macro IsolabelUI and the example applications IsolabelEg1 and IsolabelEg2.

Other Notes

The IsolabelMacs library inherits its process. As this library contains no procedural code, the process is not important. The modules in the low-level IsolabelMods library execute under the process specified in that library, not the process defined in the high-level library.

Please refer to AVS documentation for more information on the isoline and text_glyph modules. This macro does not use the AG kit, and should not be confused with AGContour which also contains isoline labels.

Authors

John Sheehan, Ian Curington
Advanced Visual Systems, Ltd.
Hanworth Lane, Chertsey, Surrey, UK
KT16 9JX

Andrew Dodd
International AVS Centre

Contact

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

See Also

Isolabel_Params, Isolabel_core, Isolabel, IsolabelUI, IsolabelEg1, IsolabelEg2.