Isolabel2Core

Synopsis

A mapper module that generates position data for isoline labels. The module processes the input field data and generates a Point mesh with node data values. The isolabel2 macro uses this data to generate text labels.


   module Isolabel2Core <src_file="isolbl2.cxx",
                         libdeps="FLD",
                         cxx_hdr_files="fld/Xfld.h"> {
      Mesh+Node_Data &in_fld<NEportLevels={2,1}>;
      Isolabel2Params &params<NEportLevels={2,1}>;
      int Active => params.Active;
      int ContourFrequency => params.ContourFrequency;
      int NodeFrequency => params.NodeFrequency;
      cxxmethod update (
         in_fld+read+notify+req,
         Active+read+notify+req,
         ContourFrequency+read+notify+req,
         NodeFrequency+read+notify+req,
         out+write
      );
      Mesh+Node_Data out<NEportLevels={1,2}> {
         &xform => in_fld.xform;
      };
   };

Description

The Isolabel2Core module generates data that can be used to position text labels on isolines. The module connects to the field output of the isoline module and generates field data that contains a Point mesh and a set of node data. The Point mesh contains the position of the labels while the node data contains the data value at each of those points. The isolabel2 macro uses this field data as an input to the text_glyph module, which actually generates the isoline text labels. The frequency of labels output and the format of the label text can both be controlled. The module is designed to only work with Line type data, such as that output by the isoline module.

The module is an alternative version of the Isolabel IAC project. Both of these projects have advantages and disadvantages and the Isolabel2 project should not be considered to be a replacement for the Isolabel project. The main improvement made by the Isolabel2 project is that the label placement algorithm is significantly more advanced. The isoline project outputs the contours it generates as a mesh with a Line cell-set. The Isolabel2Core module reconstructs the generated contours from this Line mesh and generates at least one isolabel on each contour. This ensures that each contour is labelled and that the isolabel positions are relatively consistent and sensible. As the positions are consistent these isolabels are suitable for animation.

The disadvantage of this approach is that the isoline module does not always output each contour as a continuous series of lines. If the input data is noisy then the isoline module is likely to output each contour as a series of smaller line segments. The Isolabel2Core module interprets each of these line segments as a separate contour. As one label is generated per line segment this can lead to large numbers of labels being generated. One solution to this problem is to use the ContourFrequency parameter. This parameter allows the module to skip a certain proportion of line segments, hence reducing the number of labels generated.

Alternatively the Isolabel project can be used. The original Isolabel project does not reconstruct contour lines and therefore does not suffer from this problem. It also is able to work with input data that has cell-sets other than Line.

Inputs

&in_fld

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 Line Mesh and Node Data. Only the first set of Node data is used and that Node data must be scalar.

Parameters

Active

Integer parameter that specifies whether the module should update. If the parameter is set to zero no updates take place. Conversely if the parameter is not set to zero updates take place as normal.

NodeFrequency

Integer parameter that specifies how frequently labels should be generated. The parameter specifies the stride that should be taken between each node that is labelled. Therefore a NodeFrequency of 1 implies that a label should be generated for every node.

ContourFrequency

Integer parameter that specifies how frequently labels should be generated for a contour. The parameter specifies the stride that should be taken between each contour that is processed. Therefore a ContourFrequency of 1 implies that labels should be generated for every contour.

Outputs

out

Field data containing the locations and values of each point that should be labelled. The field contains a Point mesh that contains the locations of each label and a single set of node data that contains the node data values at each label position. The isolabel2 user macro uses this output to generate the necessary input for the text_glyph. This module actually renders and displays the generated labels. If the input mesh contains any transformation data this is copied across to the output mesh.

Utility Macros

The low-level Isolabel2Core module is used in the Functional Macro Isolabel2Func and the User Macro isolabel2. Additionally these macros also use the Isolabel2Params parameter block group, as does the Isolabel2UI macro.

Example

Three example applications are provided, Isolabel2Eg1, Isolabel2Eg2 and Isolabel2Eg3. These applications generate text labels for 2D and 3D isoline plots. They show how the numbers of generated labels can be controlled for data-sets of various sizes and types.

Files

iac_proj/isolbl2/isl2mods.v contains the V definitions of the Isolabel2Params group and the Isolabel2Core module.

Other Notes

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

The low-level Isolabel2Mods library containing the module Isolabel2Core does not specify a process. By default the express process will be used.

Authors

Dr Federico Gamba
Advanced Visual Systems, Inc.

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