The shape of the fields being visualized.
Determines the value of min and max when shading.
Determines the value of min and max when shading. When set to false (the default setting) min and max consider all values in the field since this view was reset. When set to true, min and max consider only the data in the latest update.
Determines the color mapping from values in the field to grayscale shades.
Determines the color mapping from values in the field to grayscale shades. When set to false (the default), black represents a minimum and white a maximum. When true, white represents a minimum and black a maximum.
Build an image into which to render a specific layer of a scalar field.
Build an image into which to render a specific layer of a scalar field. Supplying the correct layer index is important for tooltips to work correctly.
Index of the ComponentGroup that contains the user controls, as returned by the toolbarComponents method.
A reference to the data this viewer was last updated with.
A reference to the data this viewer was last updated with. Sometimes its necessary to redraw the visualization between updates (e.g. in response to 'invert').
Index of the ComponentGroup that contrains the color key, as returned by the toolbarComponents method.
A list of properties that should be persisted when the app closes, and restored the next time it's launched.
A list of properties that should be persisted when the app closes, and restored the next time it's launched. A common example of a persistent is the zoom/magnification level of the viewer. Be sure to add any relevenant properties to this list in your Viewer subclasses!
Returns the XML representation of this viewer's properties, suitable for saving into a file.
Returns the XML representation of this viewer's properties, suitable for saving into a file.
Reset the visualization.
Reset the visualization. An optional operation; subclasses must override this method or else it does nothing.
Restore this object to the state described in the given XML node.
Restore this object to the state described in the given XML node.
Encode the state of this object into an XML node.
Encode the state of this object into an XML node.
Maps a float value to a (grayscale) shade based on the current values of min and max.
Maps a float value to a (grayscale) shade based on the current values of min and max. This respects the Invert image button which transposes black and white.
Builds and returns a new collection of components that supplement this viewer (either user controls or additional displays) suitable for installation in a toolbar.
Builds and returns a new collection of components that supplement this viewer (either user controls or additional displays) suitable for installation in a toolbar. Components are logically grouped into ComponentGroups based on their function (e.g. all the components responsible for showing the color key are collected into a single ComponentGroup).
Updates the visualization based on the contents of data
.
Updates the visualization based on the contents of data
.
Updates the visualization based on the contents of data
.
The src
argument was orignally meant to reference the
kernel/field/object that generated the data, in order to support
composite visualizations (that is, viewers that produce a visual based on
the data from several different sources), but launching such viewers in
the current UI is clunky at beset, so this feature isn't used. Viewers
that only visualize a single field's data can probably safely ignore this
arument (and indeed, most of the current ones do).
The field or object that generated the data
argument
New field data that needs to be rendered by this viewer
Update absMin, absMax, stepMin, and stepMax according to the contents of
data
.
Update absMin, absMax, stepMin, and stepMax according to the contents of
data
.
Parses the XML tag produced by the propertiesTag
method and restores
any saved valued to this Viewer.
Parses the XML tag produced by the propertiesTag
method and restores
any saved valued to this Viewer.
Increase zoom level by zDelta
.
Increase zoom level by zDelta
.
Default zoom step size.
Default zoom step size.
Decrease zoom level by zDelta
.
Decrease zoom level by zDelta
.
Controls how zDelta is applied to the current zoom level.
Controls how zDelta is applied to the current zoom level. In Additive, a delta is added to the current zoom level; in Multiplicative mode, the zoom level is multiplied by delta when zooming in, and by its reciprocal when zooming out.
Default zoom type is additive. If you change it to multiplicative, you should probably ensure that the default zDelta is something other than 1f, as multiplying by one probably won't do anything.
A panel for graphically displaying a Scalar field. Each layer in the field is displayed as a separate grayscale image with dimensions columns x rows, with each element in a layer represented by a single pixel.
The mapping from a value to a grayscale shade depends on the minimum and maximum values in the whole field (and not just the layer). By default, black represents a minimum and white a maximum, with a linear gradient representing values in-between. Toggling the 'Invert' property to true will reverse this gradient such that white represetns a minimum and black a maximum.
The minimum and maximum used for shading purposes are by default 'cumulative,' that is, they are the smallest and largest values seen in the field across all updates since the last reset. This behavior can be changed by toggling the 'Floating Max' property to true, which causes shading to be based on the minimum and maxmimum values present in the field only at the latest update, ignoring all previous updates.
All put together, it looks something like this for a three-dimensional scalar field with 6 layers: