Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve sample context exploration #679

Merged
merged 57 commits into from
Sep 12, 2024
Merged

Conversation

ThomasKroes
Copy link
Contributor

@ThomasKroes ThomasKroes commented Sep 5, 2024

Purpose of this PR

This PR provides extended sampling support in view plugins by offering more flexibility on how sample information is collected and presented to the user (see videos below).

Sampling is based on either:

  • The current selection (SamplingMode::Selection)
    In this mode, the view plugin updates the sample context whenever its selection changes, it calls ViewPluginSamplerAction::setSampleContext(const SampleContext& sampleContext). The sample context is a QVariantMap and depends on the type of view plugin.
    SampleModeSelection
  • Focus region (circular) around the mouse cursor (SamplingMode::FocusRegion)
    The ViewPluginSamplerAction::sampleContextRequested() signal is called periodically in this mode. The view plugin collects the samples in response to the signal and calls ViewPluginSamplerAction::setSampleContext(const SampleContext& sampleContext) to update the current sample context.
    SampleModeFocusRegion

When the current sample context changes, an HTML-formatted view string is generated by calling the current ViewPluginSamplerAction::ViewGeneratorFunction, which is set with ViewPluginSamplerAction::setViewGeneratorFunction(...). The generated view is then either:

  • Not shown at all (ViewingMode::None)
    ViewingModeNone
  • Shown in a tooltip (ViewingMode::Tooltip)
    ViewingModeTooltip
  • Shown in a window (ViewingMode::Windowed)
    ViewingModeWindowed

Note: ViewPluginSamplerAction::initialize(...) needs to be called for this action to work properly. In addition to a pointer to a view plugin, it requires two pointers to pixel selection actions:

  • Normal pixel selection action
  • Sampling pixel selection action (enabled when selection is idle)

To this end, the ViewPluginSamplerAction is extended with a ViewingMode setting that determines whether the sample information is shown in the ViewPlugin tooltip or a separate view plugin.

Added plugin

To facilitate the windowed view of view plugin samples, a SampleScopePlugin has been developed.

Added actions

Selecting the source plugin in the SampleScopePlugin user interface is possible using a newly introduced PluginPickerAction. This action resembles the DatasetPickerAction.

On the horizon...

It would be nice to hide/show the sample context window based on the view plugin focus. However, due to technical limitations, this isn't easy at the moment.

Note: To test this out, I'd advise to use this branch in concert with this SPP branch.

@ThomasKroes ThomasKroes added the enhancement New feature or request label Sep 5, 2024
@ThomasKroes ThomasKroes self-assigned this Sep 5, 2024
@ThomasKroes ThomasKroes marked this pull request as draft September 5, 2024 13:41
@ThomasKroes ThomasKroes marked this pull request as ready for review September 10, 2024 11:42
@ThomasKroes ThomasKroes removed the request for review from sbvis September 12, 2024 06:31
@ThomasKroes ThomasKroes merged commit cd6be62 into master Sep 12, 2024
8 checks passed
@ThomasKroes ThomasKroes deleted the feature/sample_context branch September 12, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants