![]() |
![]() |
![]() |
![]() |
Datamap
Synopsis
define the root object of the Datamap
group+Port DatamapTempl<NEcolor0=0xffff00> {
float+Port2+read dataMin;
float+Port2+read dataMax;
int numRanges;
DataRangeTempl+IPort2+read &ranges[];
ColorModel+IPort &colorModel;
ptr+nosave+nonotify localPtr<NEvisible=0>;
func+nosave getColors<NEvisible=0>;
func+nosave getARGBs<NEvisible=0>;
func+nosave getMinMax<NEvisible=0>;
};group ColorModels {
int numColorModels => array_size(models);
ColorModel+Port2 &models[];
};DataRangeTempl DataRange {
numControlPoints => array_size(controlPoints);
/* Subobjects to control the min and max of the
range from the user interface.
*/
float DataMinValue;
float UIMinValue;
float DataMaxValue;
float UIMaxValue;
int selectValues;
DataValues MinValues {
dataVals => { DataMinValue, UIMinValue };
};
DataValues MaxValues {
dataVals => { DataMaxValue, UIMaxValue };
};
/* Subobjects to control if various UI widgets
are active for editing.
*/
int minActive;
int maxActive;
int sizeActive;
/* Subobjects to control the type of range of
each component from the user interface.
*/
LinearRange LinearRange;
StepRange StepRange;
int selectAlphaRange;
int selectColorRange;
RangeModels RangeModels {
models => { LinearRange, StepRange };
};
};Description
Datamap is the root object of a datamap. Datamap consists of one or more data ranges and a color model.Each data range specifies the minimum and maximum values for the range, a size, and an array of control point values. The color model specifies if the control points in the data range are to be treated as RGB or HSV.
Input
The minimum and maximum values of the scalar input data, typically obtained through connections to the object GDminmax. These values are read only and exist so dependencies among the GDminmax module, the datamap, and the Graphics Display Kit object that the datamap is attached to are established properly. This causes the modules to execute in the correct order when a change in the data occurs.
A color model for the datamap. The color model specifies how the values in the data range's control points are to be interpreted. Supported color models are RGB or HSV.
Parameters
The size of the ranges array. This is automatically incremented or decremented as ranges are added or removed from the datamap.
A virtual function that gets an array of RGB float color values given an array of scalar data values.
A virtual function that returns the minimum and maximum values of the datamap by looking at all the ranges in the datamap.User Interface ControlsThe following set of subobjects are used to control a portion of the user interface for the datamap. They provide the ability to select the color model for the datamap.
An array of color models that contains references to HSVcolorModel and RGB colorModel. The currentColorModel parameter indexes this array.
This parameter controls if the datamap can be edited by the DatamapEditor. A value of 0 means the datamap is not editable. A value of 1 means the datamap is editable.
Output Port
The minimum and maximum values of the scalar input data, typically obtained through connections to the object GDminmax. These values are normally connected to the minimum and maximum values in one of the data ranges. This allows the datamap to be scaled to the values of the node data or cell data.
Example
Libraries.Templates.DATAMAPS.DefaultLinear Libraries.Templates.DATAMAPS.HotMetal
File
See also related modules
![]() |
![]() |
![]() |
![]() |