CombineData
Synopsis
The macros provided in this project allow 3 sets of node data to be combined together so that colours can be generated using either the RGB or HSV colour models.
Input Ports
| Name |
Type |
Description |
|
| in_fld |
Field |
original field containing node data to be mapped. |
|
Parameters
| Name |
Type |
Description |
UI Control |
|
| comp0 |
int |
specifies red/hue node data component |
Radio Box |
| comp1 |
int |
specifies blue/saturation node data component |
Radio Box |
| comp2 |
int |
specifies green/value node data component |
Radio Box |
constant0on constant1on constant2on |
int |
specifies whether to use a constant colour value |
Toggle |
constant0val constant1val constant2val |
float |
specifies constant colour value to use |
Slider |
invert0on invert1on invert2on |
int |
specifies whether to invert the input data |
Toggle |
|
Output Ports
| Name |
Type |
Description |
|
| out_fld |
Field |
modified field containing colour node data. |
| out_obj |
GDobject |
Directly renderable output object. |
|
Description
The CombineData project allows the user to directly generate a colour node data component by combining together other node data components using either the RGB or HSV colour models. Two user macros are provided that allow this to be done. The Combine_Datasets_To_RGB macro converts 3 node data components into values for Red, Green and Blue and generates another node data component containing colour data. Similarly the Combine_Datasets_To_HSV macro converts 3 node data components into values for Hue, Saturation and Value and generates another node data component containing colour data.
Both macros normalize the input node data components before converting them into colour values. Both macros also provide a user interface so that the node data component to be used for each colour component can be choose. The user interface also allows the user to specify if the input data should be inverted or whether a constant value should be used for a colour component.
Internally the user macros use two low-level modules that contain the C++ code necessary to perform the conversion between data values and colour values. The user interface macros, functional macros and user macros used by this project are built up by defining macros for the HSV colour model and then modifying them to create macros for the RGB colour model.
Inputs
in_fld
Input field that is to be coloured using node data components. The field should contain at least one set of node data. The node data can be of any type and the colouring is not dependent upon the structure of the mesh.
Parameters
comp0
Specifies which set of node data should be used for the first colour data component. This component is either the red component or the hue component depending upon which colour model is used. Before being converted into colour values the selected node data is normalized so that all values lie between 0 and 1.
comp1
Specifies which set of node data should be used for the second colour data component. This component is either the blue component or the saturation component depending upon which colour model is used. Before being converted into colour values the selected node data is normalized so that all values lie between 0 and 1.
comp2
Specifies which set of node data should be used for the third colour data component. This component is either the green component or the value component depending upon which colour model is used. Before being converted into colour values the selected node data is normalized so that all values lie between 0 and 1.
constant0on constant1on constant2on
If these parameters are not zero they specify that a constant value should be used for the appropriate component of the colour data. The constant value to be used is specified by the constant0val, constant1val and constant2val parameters.
constant0val constant1val constant2val
These floating point parameters specify the constant values that should be used instead of node data if the appropriate parameter is set (i.e. constant0on, constant1on or constant2on) The value of these parameters should be between 0 and 1. If the appropriate constant?on parameter is not set these parameters have no effect.
invert0on invert1on invert2on
If these parameters are not zero they specify that the normalized node data for the appropriate component should be inverted before it is used to calculate colour data.
Outputs
out_fld
Output Field data containing both the original node data components and the colour node data component has been generated.
out_obj
The GDobject version of the output, suitable for direct connection
to the viewer. AVS/Express will by default display this Object with the colours specified in the colour node data component.
Utility Macros
The CombineData project makes use of three utility macros. CMBD_extract_data_array allows a node data component to be extracted with out the need for a user interface. DVadd_node_data allows a set of colour node data to be added to an existing set of field data. CMBD_ComponentBox creates a UI panel containing the controls necessary for a single component of colour.
The CombineDataParams parameter block is also used by all of the User Interface, Functional and User macros.
Example
The CombineDataEg example application is provided with this project. This application demonstrates how node data can be combined using either colour model. A block of data containing 3 node data components is read and an orthoslice is taken of the data. This orthoslice is then coloured by both the Combine_Datasets_To_RGB and Combine_Datasets_To_HSV macros and the results displayed in two separate windows.
Files
iac_proj/combdata/cmbdmods.v contains the V definitions of the DVcombine_data_to_HSV, DVcombine_data_to_RGB and DVadd_node_data low-level modules, the CMBD_extract_data_array utility module and the CombineDataParams parameter block.
iac_proj/combdata/cmbdmacs.v contains the V definitions of the UI component CMBD_ComponentBox, the User Interface macros Combine_Datasets_To_HSV_UI and Combine_Datasets_To_RGB_UI, the functional macros Combine_Datasets_To_HSV_Func and Combine_Datasets_To_RGB_Func, the user macros Combine_Datasets_To_HSV and Combine_Datasets_To_RGB and the example application CombineDataEg.
Other Notes
The low-level CombineDataMods library containing the module does not specify a process. By default the express process will be used.
Authors
Mark Lambert
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
N/A
|