Allows a 'Thermometer' style gauge to be added to a standard viewer.
Name | Type | Description | |
value | float | normalized parameter to display | |
Name | Type | Description | |
x_pos y_pos | float | centre of thermometer bulb | |
radius | float | radius of thermometer bulb | |
length | float | length of thermometer gauge | |
foreground_col | float[3] | Colour of foreground of thermometer gauge | |
background_col | float[3] | Colour of background of thermometer gauge | |
Name | Type | Description | |
out_obj | DataObject | directly renderable output object | |
This project provides a simple Thermometer gauge that can be added to a standard viewer. It allows a single floating point value to be displayed visually along with the rest of a visualization. This ability can often be useful. However it is of particular use when creating animations and videos. The Thermometer gauge provides a simple and very direct way of presenting a piece of information.
Two alternatives versions of the Thermometer graph are provided. The Thermometer2D macro provides a graph that looks like a stylised thermometer. In contrast the Bargraph2D macro provides a simple bar with rounded ends. Both of these macros operate in the same way and both create a vertical graph. Which of these macros is used depends upon the type of application and personal preference. Other forms of 'Thermometer' or 'bar-graph' could be created by extending one of the macros provided.
value
Normalized floating point number that is to be displayed on the Thermometer. The macros expect that the input value will be normalized so that it is between 0 and 1. If the input is outside this range the gauge will not display correctly. If the parameter to be displayed is outside of this range it should be scaled appropriately.
x_pos y_pos
Centre point of the 'bulb' of the Thermometer specified in pixels. All the positions of the elements that make up the gauge are calculated by referring to the centre of the thermometer bulb. Hence specifying the bulb position indirectly specifies the position of the gauge as a whole. The bulb is the circle at the lower end of the thermometer scale.
radius
Radius of the thermometer bulb in pixels. As with the thermometer position, the size of the thermometer elements is calculated by referring to the radius of the thermometer bulb. By changing this radius the size of each component is adjusted.
length
Length of the thermometer scale in pixels.
foreground_col
Floating point array that contains the colour of the foreground of the thermometer scale expressed as a Red-Green-Blue triplet. By default the foreground colour is red (i.e. {1.0, 0.0, 0.0} )
background_col
Floating point array that contains the colour of the background of the thermometer scale expressed as a Red-Green-Blue triplet. By default the background colour is white (i.e. {1.0, 1.0, 1.0} )
out_obj
GroupObject containing all the elements necessary to display the appropriate gauge. This output is suitable for direct connection to a viewer.
The Thermometer2D macro uses two lower level macros to generate circle and rectangle shapes, respectively ThermometerCircle and ThermometerRectangle. It also uses the ThermometerParams parameter block. The Bargraph2D macro extends from the Thermometer2D macro and alters the relationships between components to generate a simple bar-graph shape.
The ThermometerEg example application is provided. This application uses a loop to cycle through a number of values and displays the current loop count using a Thermometer2D macro. It also creates an isosurface of the hydrogen data set and uses a Bargraph2D macro to display the current isosurface level.
The libraries in this project inherit their processes. As this library contains no procedural code, the process is not important.
iac_proj/thermo/thm_mods.v contains the V definitions of the ThermometerCircle and ThermometerRectangle macros, and the ThermometerParams parameter block.
iac_proj/thermo/thm_macs.v contains the V definitions of the Thermometer2D and Bargraph2D functional macros.
iac_proj/thermo/thm_apps.v contains the V definition of the ThermometerEg example application.
Ali Bitar, AVS France Andrew Dodd, International AVS Centre
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL