tube

Synopsis

Converts line and polyline cell_sets to tubes.


module tube <build_dir="iac_proj/tubes",
             src_file="tube.cxx",
             out_src_file="gen.cxx",
             out_hdr_file="gen.hxx",
             libdeps="FLD",
             cxx_hdr_files="fld/Xfld.h",
             process="express">
{
   cxxmethod+req upd(
      .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
   );

   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>;
   Field+OPort2   out<export=2>;
   int+OPort2     err<export=2>;
   string+OPort2  err_str<export=2>;
};

Description

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!

Limitations:

Inputs

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.

Outputs

out: Field 3D Quad cell set

err: error toggle

err_str: error string

Utility Macros

Parameter Group: TubesParams

Functional Macro: TubesFunc

UI Macro: TubesUI

User Macro: tubes

Example

TubeEg1 and TubeEg2

Files

iac_proj/tubes/tubes.v, iac_proj/tubes/tubesmods.v, iac_proj/tubes/tubesmacs.v

Other Notes

Revisions:

Author

Jeremy Maccelari
visuals@solo.pipex.co.za

Modifications

Andrew Dodd

Robert Frank
Manchester Visualization Centre

Contact

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