Repository navigation
tf_editor: few colour bars for colormaps, a hover readout, honest FEM overlays - #878
Merged
Merged
Conversation
… overlays The FEM / mesh_lab field colours seeded each named colormap as 33 colour nodes. A colour bar is grabbed across the canvas height within about 5 px, so 33 bars about 9 px apart left no empty canvas: every hover and double-click hit a bar. The colormap is now sampled at 256 points and thinned by the new cvc::tf::simplify_ramp to the nodes that follow it within 0.02 per channel, at most 12 (viridis 9, jet 6, gray 2; turbo keeps 12, within 0.05). The ImGui editor lights the histogram bin under the pointer over empty canvas and, once the pointer settles, shows a readout: the value, the bin's range, count and share, the contour spectrum's values and the contour tree's components (each while shown), and what a double-click and the right-click menu do. The menu's Add and Display items explain themselves on hover. The contour spectrum and contour tree are computed for volumes only. A mesh_lab / fe_lab field now answers a request for them with "unavailable: ... this field is on a mesh" in <tf>.overlay_status, where the toggle used to do nothing. The wasm demo page lets the canvas keep right-clicks: it did not prevent the browser's context menu, which covered the editor's menu or took the release it opens on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Usability fixes for the transfer-function editor (
tf_editor), mostly as the FEM demos use it.Too many colour bars. mesh_lab and fe_lab seeded each named colormap as 33 colour nodes. A colour bar can be grabbed anywhere along the canvas height within about 5 px, so 33 bars about 9 px apart left no empty canvas: every hover and double-click hit a bar, which made recolouring or moving bars awkward.
colormap_modelnow samples the colormap at 256 points and thins it with the newcvc::tf::simplify_ramp. The result keeps the nodes that follow the colormap within 0.02 per channel, at most 12.Hover readout and tooltips.
Contour spectrum and contour tree on mesh fields. These are computed for volumes only (
tf_binding). On a mesh_lab or fe_lab field, the Display toggles used to do nothing. A request for them now gets<tf>.overlay_status= "unavailable: ... this field is on a mesh", which the editor shows under the canvas. On volumes (volren, volslice, the VTK volume node) they work as before.Right-click in the browser.
examples/web/templates/demo.html.indid not prevent the browser's own context menu on the canvas (checked on the live arigl page:defaultPreventedwas false). The browser menu covered the editor's menu, or took the button release the editor's menu opens on. The canvas now callspreventDefault()oncontextmenu.Tests (Windows, MSVC):
cvcgl_tf_editorcovers:simplify_ramp(knot recovery, the node cap, two-node input).cvcgl_ariadne_realizechecks, for mesh_lab and fe_lab:colormap_rgb;cvcgl_tf_editor,cvcgl_ariadne_realize,cvcgl_tf_bindingandcvcgl_fe_intervalall pass.Visual check: arigl snapshots showed:
The readout and the browser right-click were not checked by hand in a browser. The wasm build happens in CI and the gallery deploy.
Docs:
docs/TRANSFER_FUNCTIONS.md§4 (the hover readout and the browser right-click) and §6 (the thinned ramps and the mesh-field overlay note).