FieldLegend
One field legend of the viewport's corner HUD (construct-fea-solve §FEC-5).
| Inherits | QWidget |
In the namespace construct::ui. Declared in src/libs/libconstruct/construct/ui/FieldLegend.hpp.
Detailed description
It shows one construct::model::FieldLegendEntry: the title (the item name or "3 items", an em dash, the field's label), elided in the middle at kTitleWidth; the ramp of the colormap with five ticks, the unit after the two ends and the clamp marks; the colormap's name in the muted text color; and, when the results are out of date, one line in the warning color with the reason. A legend of the factor-of-safety view has the icon of its verdict before the title and the verdict in its caption (field-presentation §FVU-8).
The ramp is the general libwidgets widget ColorRampLegend. This class only fills it from the display: the colors are the entries of libstyle's style::FieldColormap table, the texels the GPU samples, one strip each, so the bar shows the color the shader shows (field-presentation §FVC-1, §FVC-6). The ticks come from legendTicks(), the caption from legendCaption(), and the out-of-range swatches, the no-data swatch and the true maximum from the display.
The legend is a widget over the viewport. Its bar takes the mouse since field-presentation phase 4a: drag or type an end for a manual range, right-click for the range modes, the colormap, the bands and the unit (§FVU-5). The owner applies each edit; the legend only reports it. The widget itself is never in an image. A capture with field overlays paints the same legend with no widget: legendDataOf() and ColorRampLegend::paint() (field-presentation §FVL-6).
Which legends show comes from construct::model::groupFieldLegends().
See also ColorRampLegend.