Fast 2D Mesh glyph mapper macro, that efficiently replicates glyph geometry at given coordinates, with optional angle control.
Name | Type | Description | |
glyph_fld | Mesh | geometry that should be placed at coordinates. | |
coords | float[][2] | coordinate position list. | |
angles | float[] | rotation angle for each coordinate. | |
Name | Type | Description | UI Control |
scale | float | scaling factor for each glyph. | UIslider |
a_offset | float | degrees to offset each glyph rotation | UIslider |
a_multipler | float | scaling factor for each glyph rotation | UIslider |
Name | Type | Description | |
out_mesh | Mesh | output mesh containing the replicated glyphs. | |
out_obj | DataObject | directly renderable output object. | |
The fast_glyph_2D macro takes a list of 2D coordinate positions and a glyph shape, and replicates that glyph at all coordinate positions. Optionally an array of angles can be supplied so that each glyph can be individually rotated. The macro outputs a 2D mesh and a directly renderable DataObject.
The fast_glyph_2D macro and the low-level FastGlyph2DCore module were originally designed for large scale 2D map marker applications. To achieve the performance necessary for these applications a number of limitations were introduced that are not present in the standard glyph module. The most important and obvious of these is that the module is only able to deal with and output 2D data. It expects that the coordinates are supplied as a series of x-y pairs. It also discards any z coordinates that the supplied glyph might have. The advantage of these limitations is that the fast_glyph_2D macro is approximately 4 times faster than the standard glyph macro.
Normally the angle of zero points horizontal to the right, with positive angles causing anti-clockwise rotation. Therefore the a_offset parameters adjusts the angle of the zero point and the a_multiplier parameter adjusts the rotation direction and the angular value scaling.
glyph_fld
Connection to the glyph geometry that should be replicated at each supplied point. It is assumed that the glyph is 2D, has no node data and has a single cell set. If this is not the case, z coordinates and node data will be discarded by the module and only the first cell set will be used for the output glyphs.
coords[][2]
Connection to a float array containing the 2D positions of each point. Examples of how to construct this array from arrays of x and y coordinates and from Field data can be seen in the example applications.
angles[]
Connection to an optional float array containing the rotation angles that should be used for each individual glyph. If an array is supplied there must be an angle for each glyph. If an array is not supplied no rotation will be performed and the module will run faster.
scale
Floating point parameter that specifies how much the glyphs should be scaled by. This parameter applies globally to the glyphs generated and will mostly be used to size the glyphs appropriately for the data set.
a_offset
Floating point parameter that globally specifies an offset for each glyph rotation. If no angle array is specified this parameter has no effect. See above for a complete description of the use of this parameter.
a_multiplier
Floating point parameter that globally specifies how much each glyph rotation should be scaled by. If no angle array is specified this parameter has no effect. See above for a complete description of the use of this parameter.
out_mesh
Mesh containing the replicated glyph geometry. This mesh will only contain a single cell set and no node data or cell data.
out_obj
The directly renderable output of the fast_glyph_2D macro. The DataObject contained within this output is generated from the same data as that output by out_mesh. This renderable output is the output that will normally be used.
The fast_glyph_2D use macro makes use of the FastGlyph2D functional macro, the FastGlyph2D user interface macro and the FastGlyph2DParams parameter block. The FastGlyph2D functional macro is a wrapper around the FastGlyph2DCore low-level module. This module contains all the C++ code necessary for this macro.
Two example applications are provided, FastGlyph2D_AngleEg and FastGlyph2D_SizeEg. The FastGlyph2D_AngleEg application demonstrates how 3 arrays containing x coordinates, y coordinates and rotation angles can be input into the fast_glyph_2D macro to generate 4 arrow glyphs rotated by different angles. The FastGlyph2D_SizeEg application demonstrates the fast_glyph_2D macro generating a large number of diamond glyphs. The hydrogen data-set is read, a slice taken and a glyph drawn at each node point on a 64x64 grid.
iac_proj/fglyph/fgmods.v contains the V definitions of the FastGlyph2DCore module and the FastGlyph2DParams parameter block.
iac_proj/fglyph/fgmacs.v contains the V definitions of the FastGlyph2D Functional macro, the FastGlyph2DUI UI macro, the fast_glyph_2D user macro and the example applications.
To gain the extra performance necessary this macro makes a number of assumptions and is less general than the original glyph module. The important assumptions are mentioned above. A complete list of assumptions is shown below:
The module is written in C++, uses simple arrays for input/output. The algorithm is very simple and can be extended to perform different tasks.
The low-level FastGlyphMods library containing the module FastGlyph2DCore does not specify a process. By default the express process will be used.
Mark Lambert, Ian Curington Advanced Visual Systems, Inc.
Andrew Dodd International AVS Centre
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL