Converts streamline polyline output into tubes with time resolved node data.
module StreamTimeCore <src_file="streamt.cxx", libdeps="FLD", cxx_hdr_files="fld/Xfld.h"> { VISmesh+IPort2 &in<export=2>; int+IPort2 axis<export=2>; int+IPort2 xform<export=2>; float+IPort2 zscale<export=2>; int+IPort2 resolution<export=2>; int+IPort2 normalise<export=2>; float+IPort2 scale<export=2>; int+IPort2 node_cell<export=2>; int+IPort2 node_data_comp<export=2>; int+IPort2 cell_data_comp<export=2>; int+IPort2 col_data_comp<export=2>; cxxmethod+req update( .in+notify+read+req, .axis+notify+read+req, .xform+notify+read+req, .zscale+notify+read+req, .resolution+notify+read+req, .normalise+read+notify+req, .scale+read+notify+req, .node_cell+read+notify+req, .node_data_comp+read+notify+req, .cell_data_comp+read+notify+req, .col_data_comp+notify+read+req, .out+write, .err+write, .err_str+write ); Field+OPort2 out<export=2>; int+OPort2 err<export=2>; string+OPort2 err_str<export=2>; };
The stream_time user macro is a specialized variation of the IAC tube module. It takes the polyline output of the streamline module and converts those lines into tubes. It also adds a node data component that represents the length of time that has passed at each point. This node data can be used to visualize the rate of flow along the streamlines. A variety of effects similar to those achieved by the advector module can be created.
In comparison to the tube module the input has be modified to assume input from the streamline module in line mode. The input series of polylines are processed and the local velocity field information extracted. The stream_time module then changes the representation from lines to tubes, and in addition modifies the node data on the tube structures to have time-resolved values along the line.
For further details of now to use the tube components of this module please see the tube module documentation below. A technical paper is available describing the use of this module for flow visualization. Contact the author for details.
This module takes a field with line or polyline cell_sets, and generates tubes for the lines, which may be coloured using another dataset. Each line cell is turned into a tube. All other cell types are ignored.
The radii are controlled by the data. The radii may be cell- or node-based. Cell-based radii (i.e. from the cell_data[]) ensure each tube has a constant radius. Node-based (i.e. from the node_data[]) allows the radius of the tube to vary across the cell. If there is no data, normalise is set and the scale value used.
Similarly, the colours are based on cell- or node-data. Colour data is optional.
The 2D mode is designed for use with output from modules like isoline. I calculate the tubes on the XY plane (by default) and then use the input field's xform to xform the tubes to the correct orientation in 3D space.
All data must be scalar!
in: Mesh 3D/2D with either line or polyline cell_sets. May have node and/or cell data to define radii and colours.
axis: axis to project 2D data (like the output from isoline) perpendicular to (default is 2 = Z).
xform: toggle whether to copy in xform to out or not. This is useful for 2D datasets like isoline which are calculated on the XY plane and then use the xform to transform them to the correct position in 3D space.
zscale: some 2D modules (like slice_plane) don't scale Z with X and Y. This allows the user to scale Z manually
resolution: number of facets for each tube.
normalise: toggle for normalising: 0 - no normalising - uses data for radii; 1 - all radii set to scale - does not use data. If data is invalid (either not there or vector), this flag is automatically set.
scale: scale factor for radii.
node_cell: toggle for selecting whether to use cell or node data: 0 - use node data defined by node_data_comp; 1 - use cell data defined by cell_data_comp
node_data_comp: the data to use if node_cell == 0
cell_data_comp: the data to use if node_cell == 1
col_data_comp: the node data to use for colouring. If node_cell == 0, we use node data, else we use cell_data.
out: Field 3D Quad cell set. Contains tube mesh and time-resolved node data component.
err: error toggle
err_str: error string
Low-Level Module: StreamTimeCore
Parameter Group: StreamTimeParams
Functional Macro: StreamTimeFunc
UI Macro: StreamTimeUI
User Macro: stream_time
This project contains 5 example applications. These are intended to both show now the stream_time macro can be incorporated in a network and demonstrate some of the more advanced techniques that are possible with this macro.
The StreamTimeEg1 and StreamTimeEg2 example applications both load a data-set, calculate streamlines and generate time resolved stream tubes. The important thing to notice with these applications is now the stream_time module is connected to the streamlines module and now the data value on the stream tubes increases with increasing distance (and time) from the start of the tube.
The StreamTimeEg3 and StreamTimeEg4 example applications use the time-resolved data to perform animation. The StreamTimeEg3 application calculates a number of isolines. These appear as rings that surround the stream tubes present. If the Loop module is run these rings will move along the path of the stream tube. This is achieved by using the loop count to vary the level of the isoline module. In a similar way the StreamTimeEg4 application uses the threshold module to make the stream tube appear gradually. The loop module is used to vary the level of the threshold module. Hence when the loop module is run the stream tubes appear to grow from their initial points.
Finally the StreamTimeEg5 application uses texture mapping to generate and animate small sections of the stream tubes. This application uses the TextureWave and Scalar2Texture IAC projects to generate a partly transparent texture and apply it to the time-resolved node data on the tube. This results in a number of small tube sections with transparent sections in between. The TextureWave module can then be used to move the position of the transparent sections hence causing the small tube sections to move. To use this application the two IAC projects mentioned have to be installed. Good texture-mapping hardware is also required to get reasonable performance from this application.
iac_proj/streamt/stmods.v contains the V definitions of the StreamTimeCore module and the StreamTimeParams parameter block.
iac_proj/streamt/stmacs.v contains the V definitions of the StreamTimeUI UI macro, the StreamTimeFunc functional macro and the stream_time user macro.
iac_proj/streamt/stapps.v contains the V definitions of the StreamTimeEg1, StreamTimeEg2, StreamTimeEg3, StreamTimeEg4 and StreamTimeEg5 example applications.
Revisions:
StreamTime modifications: Ian Curington, AVS Inc. Tube Author: Jeremy Maccelari - visuals@solo.pipex.co.za;
Anja Bindrich, Andrew Dodd, International AVS Centre
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL