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

ClipPlane GUI Widget #1192

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

braunms
Copy link
Contributor

@braunms braunms commented May 24, 2023

Added the imguizo library to provide an interactive manipulator widget for the clipping plane module.

The ImGui part is realized as parameter group widget in the GUI frontend.
Callers have to send the current camera first, before they request the clip plane via the callback of the ClipPlaneCall.

TODO

  • Rename ClipPlane module to PlaneModule?
  • Rename ClipPlaneCall call to PlaneCall?

ISSUES

  • Widget gets clipped at internal near plane that is way too near....

FEATURES

  • button to invert the normal of the plane to switch between clipping "in front" and "behind"
  • separate between "enabled" (does some clipping) and "manipulatable" (widgets are shown and can be moved); maybe add option under draw to enable/disable drawing the dragable widgets

Already contains changes of PR #1195 and #1194 ...

Summary of Changes

References and Context

Test Instructions

  • Already implemented usage: See changes in SphereRenderer ...
  • Add the following code to your renderer in Render():
    // Requires call slot 'get_clip_plane_slot_':
    // this->get_clip_plane_slot_.SetCompatibleCall<view::CallClipPlaneDescription>();
    // this->MakeSlotAvailable(&this->get_clip_plane_slot_); 
    megamol::core::view::Camera cam = call.GetCamera();
    view::CallClipPlane* ccp = this->get_clip_plane_slot_.CallAs<view::CallClipPlane>();
    if (ccp != nullptr) {
        ccp->SetCamera(cam);
    }
    if ((ccp != nullptr) && (*ccp)()) {
        auto plane = ccp->GetPlane();
    }

…t for the clipping plane module

the ImGui part is realized as parameter group widget in the GUI frontend. Callers have to send the current camera first, before they request the clip plane via the callback of the ClipPlaneCall.
@braunms braunms added the feature Provides a new feature. label May 24, 2023
@braunms
Copy link
Contributor Author

braunms commented May 24, 2023

/format

@github-actions
Copy link

Style check found formatting issues! Comment /format, to automatically commit the suggested changes.

@github-actions
Copy link

github-actions bot commented Jun 2, 2023

Style check found formatting issues! Comment /format, to automatically commit the suggested changes.

@braunms
Copy link
Contributor Author

braunms commented Jun 2, 2023

/format

@github-actions
Copy link

github-actions bot commented Jun 2, 2023

Style check found formatting issues! Comment /format, to automatically commit the suggested changes.

@braunms braunms marked this pull request as ready for review June 2, 2023 17:41
@braunms braunms requested review from moritz-h, reinago and straubar June 2, 2023 17:41
@braunms braunms marked this pull request as draft June 2, 2023 17:44
@braunms braunms marked this pull request as ready for review June 5, 2023 14:39
@straubar
Copy link
Member

straubar commented Jun 6, 2023

Code looks fine so far. Just found a spelling error for one of the variables: scree_pos instead of screen_pos in ParameterGroupClipPlaneWidget.[h|cpp].

I will look at the functionality later and give it a test run.

@straubar
Copy link
Member

straubar commented Jun 7, 2023

There are still some issues:

  • camera and plane position influences the clipping (?) of the dragable widgets of the clip plane (cf. image)
  • dragging the plane outside of the bounding box leads to widgets disappearing, and jumping of the clip plane when then moving the camera
  • direct modification of the x-component of the clip plane's point leads to weird update, resulting in a different value than the one entered (this only happens after having dragged the plane outside of the bounding box and after the jump occurred, as mentioned above; may disappear if above is fixed)
  • the rotation does not seem intuitive (to me). is this as intended?
  • widgets for manipulation should not be visible if the clip plane is disabled (see also suggestion below)

feature suggestion:

  • button to invert the normal of the plane to switch between clipping "in front" and "behind"
  • separate between "enabled" (does some clipping) and "manipulatable" (widgets are shown and can be moved); maybe add option under draw to enable/disable drawing the dragable widgets

grafik

@straubar
Copy link
Member

straubar commented Jun 7, 2023

Lua project for above comments:
test-clip.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Provides a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants