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

How to add a pop-up function after hovering the mouse on Glance #498

Open
865979216 opened this issue Mar 6, 2024 · 3 comments
Open

How to add a pop-up function after hovering the mouse on Glance #498

865979216 opened this issue Mar 6, 2024 · 3 comments

Comments

@865979216
Copy link

image
This is a screenshot on Paraview, and I want to implement this function on Glace as well。When I hover my mouse over a point on polydata, it will display the information contained in that point。I don’t know how to do,please help me~~

@865979216
Copy link
Author

glance-master/src/components//core/VtkView/template.html,I think should code in this page

@865979216
Copy link
Author

I tried some code, but it didn't work

@865979216
Copy link
Author

Add Mouse Event Listener: Add a mouse movement event listener to the rendering or view of VTK.js to trigger the corresponding event handling function when the mouse hovers over a point.

Implement point selection logic: In the event handling function, use the pick function of VTK.js to determine which point the mouse is currently pointing to. This may involve calculating the position of the mouse in the view, converting it into coordinates in 3D space, and then using the query mechanism of VTK.js to find the point closest to these coordinates.

Display point information: Once the point pointed to by the mouse is found, obtain the relevant information of the point (such as ID, coordinates, etc.), and create an HTML element (such as a pop-up or tool tip) to display this information. This HTML element needs to be positioned near the mouse pointer and its content updated as the mouse moves.
I don't know which folder to perform these operations in

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

No branches or pull requests

1 participant