Datamap
Synopsis
define the root object of the Datamap
DatamapTempl
group+Port DatamapTempl {
float+Port2+read dataMin;
float+Port2+read dataMax
int+opt numRanges;
DataRangeTempl+IPort2+read &ranges[];
ColorModel+IPort2 &colorModel;
func+nosave getColors;
func+nosave getARGBs;
func+nosave getMinMax;
ptr+nosave+nonotify+write localPtr;
method+notify_inst init = "DmapInstance";
method+notify_val update = "DmapUpdate";
method+notify_deinst delete = "DmapDelete"
};
ColorModels
group ColorModels {
int numColorModels => array_size(models);
ColorModel+Port2 &models[];
};
Datamap
DatamapTempl Datamap {
numRanges => array_size(ranges);
/* Control the color model from the user interface */
HSVcolorModel HSVcolorModel;
RGBcolorModel RGBcolorModel;
int currentColorModel;
ColorModels ColorModels {
models => { HSVcolorModel, RGBcolorModel };
};
};
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
dataMin
dataMax
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.
ranges
colorModel
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
numRanges
The size of the ranges array. This is automatically incremented or decremented as ranges are added or removed from the datamap.
getColors
A virtual function that gets an array of RGB float color values given an array of scalar data values.
getARGBs
A virtual function that gets an array of packed ARGB values given an array of scalar data values.
getMinMax
A virtual function that returns the minimum and maximum values of the datamap by looking at all the ranges in the datamap.
The 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.
HSVcolorModel
RGBcolorModel
An HSV and RGB color model.
currentColorModel
This parameter selects the color model for the datamap.
ColorModels
An array of color models that contains references to HSVcolorModel and RGB colorModel. The currentColorModel parameter indexes this array.
editable
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
dataMin
dataMax
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
v/dmap.v
See also related modules