Convert polylines to continuous tubes using scalar data to scale and colour the generated tubes.
module BlendyTubesCore <src_file="blendytubes.cxx", libdeps="FLD", cxx_hdr_files="fld/Xfld.h"> { Mesh+Node_Data+read+notify+req+IPort2 &lines_in; TubesParams+IPort2 ¶ms; float+read+notify+req scale => .params.scale; boolean+read+notify+req offsetScale => .params.offsetScale; boolean+read+notify+req invertScale => .params.invertScale; int+read+notify+req facets => .params.facets; cxxmethod+notify_inst+req update; Mesh+Node_Data+write+OPort2 tubes_out; };
This module takes a Polyline cell_set with at least one scalar node_data component and creates a continuous tube for each polyline. For each node in the polyline a circular cross section is created and oriented in the direction of the polyline at that node. If two node_data components are present the second node_data component is used to proportionally scale each circular cross section. The scale parameters allows control over the overall width of the tube. The first node_data component is mapped appropriately to each node of the cross section. This results in colour mapped tubes that optionally vary in width according to the two separate node data components.
The module is designed to be used in conjunction with the DVinterp_data module to generate the node_data at each node of the polylines. The Tubes user macro does this. It is expected that the input polyline mesh will be generated by the Streamlines module, however other sources of polylines can be used. For instance the isoline module generates data with a Line cell set. By using the Isoline2Polyline module the data output by the isoline module can be used as the input to BlendyTubesCore module. An example of doing this is provided with the Isoline2Polyline project.
&lines_in
Input field data that contains a mesh with a cell_set of Polyline type and at least one scalar node_data components. The first node data component will be used to colour map the tube sections. If a second node data component is present it will be used to scale each section. Any other node data components will be ignored. The node_data can be of any scalar data type.
&TubesParams
A reference to the parameter block that contains the actual values of the module parameters.
scale
An overall scaling value that will be applied to each section of the tube. This parameter is always used and is not dependent upon whether scaling node data is present or not.
offsetScale
If the scaling node data component contains negative values and offsetScale is true then the scaling values will be shifted so they are all positive starting from zero. If offsetScale is false negative values will cause the tubes to turn themselves 'inside-out'. This parameter is ignored if no scaling node data is present.
invertScale
If invertScale is true then the scale component values will be inverted, hence larger values will produce narrower tubes and versa-versa. The scale parameter will still work as before as this overall scaling is applied after the data component scaling. This parameter is ignored if no scaling node data is present.
facets
The number of sides each tube will have. This parameter cannot be less than 3.
tubes_out
The generated field data containing a Mesh with Quad cell_set that forms the tubes and one scalar node data component that should be used for colour mapping the tubes.
The low-level BlendyTubesCore module is used in the TubesFunc functional macro. This macro is in turn used by the Tubes user macro.
Two example applications are provided for this project. The BlendyTubesEg application reads the 'bluntfin data set and generates a series of streamlines to visualize the air flow. The tubes macro is then used to generate a series of colour and size mapped tubes around each streamline. The SimpleTubesEg application similarly read the 'bluntfin data set. However it only generates a series of colour mapped tubes around each streamline.
iac_proj/tubes/tubesmods.v contains the V definitions of the BlendyTubesCore low-level module and the TubesParams parameter block.
iac_proj/tubes/tubesmacs.v contains the V definitions of the TubesUI user interface macros, the TubesFunc functional macro, the Tubes user macro and the example applications.
It is realised that the cross section of the tubes should be elliptical. However this would require further rotations to be carried out to orientate it correctly. The major use of the module is likely to be with Streamlines. As these tend to be 'smoothy' curved with short line segments it was decided that a circular cross section would be a sufficient approximation.
The low-level BlendyTubesMods library containing the module BlendyTubesCore does not specify a process. By default the express process will be used.
James S. Perrin : james.perrin@man.ac.uk, Manchester Visualization Centre
Ian Curington, AVS Inc. Andrew Dodd International AVS Centre
Robert Frank Manchester Visualization Centre
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL