cogdebugger.ui.fieldvisualizations.symmetrictensor
Shape of the stick tensor field being displayed
Draw the single field element at the given indices.
Draw the single field element at the given indices.
Called after the pen has been moved to the top-left corner of the cell to draw in. Clients should take care to draw within the bounds of the cell, which is a cellSize by cellSize square.
It would be nice if we could give an element as an argument instead of a bunch of indices, but the Field class doesn't currently define any means to actually extract elements from the field; that's left to subclasses. Further complicating things, the panel classes don't know in advance how many dimensions the data field has, so we have to use a variable length indices parameter. If your field class has a read(indices: Int*) method, you can get the current element, regardless of field dimensions, like so:
val element = read(indices: _*)
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.
Builds a list of controls and other components that supplement this viewer and are suitable for installation in a toolbar.
Builds a list of controls and other components that supplement this viewer and are suitable for installation in a toolbar.
Controls/components are grouped into ComponentGroups based on their function (e.g. components that make up the legend are grouped into one ComponentGroup, while controls that affect the rendering are in another).
The toggle for the Floating Max property is the sole member of the first ComponentGroup. The legend is in the second group.
Updates the visualization based on the contents of data
.
Updates the visualization based on the contents of data
.
The field or object that generated the data
argument
New field data that needs to be rendered by this viewer
Update the data being viewed with new "data".
Update the data being viewed with new "data".
Compute any needed statistics on your data (for display or to help draw later).
Compute any needed statistics on your data (for display or to help draw later). Called after new data has been received (in updateData) but before drawing begins for that new 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/unzoom increment used by zoomIn
and zoomOut
.
Default zoom/unzoom increment used by zoomIn
and zoomOut
. When the
ZoomType is Additive, this value is added to or substracted from the
current zoomLevel
. In multiplicative mode, zoomLevel
is multipled by
zDelta
on zooming in or by its reciprocal on zooming out.
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 which displays a stick tensor field as geometrical objects.
Each tensor is rendered as a line contained in a single cell in a grid of cells. The midpoint of a line is fixed to the center of its cell, and its orientation and length are determined by the phase and magnitude of the tensor it represents. The visual length of the tensors are normalized such that the longest line is contained entirely in its cell.
This visualization supports the notion of a "floating maximum." The scaling of the lines representing tensors can be based either upon the largest magnitude tensor seen by this visualization across all updates since the last reset or upon only the values present in the latest field data handed to the viewer. The floating max property is set to 'false' by default; all lines drawn have their lengths scaled according to the maximum magnitude seen by the visualization across all updates. A user control for changing this setting is supplied by the
toolbarComponents
method.