Skip to content

Even name to be used when setup a add_callback for mouse pick event #750

Answered by ZiguoAtGitHub
DRLing2021 asked this question in Q&A
Discussion options

You must be logged in to vote

We are proposing to monitor the mouse click event to show the coordinates of picked pt from 3D point cloud. The plan is to use add_callback function from Plotter Class. From the document, the method definition is :

def add_callback (self, eventName, func, priority=0.0)

Furthermore, there is an example script shown in the document, as :

from vedo import *

def func(evt): # called every time the mouse moves # evt is a dotted dictionary if not evt.actor: return # no hit, return print("point coords =", evt.picked3d) # print("full event dump:", evt)

elli = Ellipsoid() plt = Plotter(axes=1) plt.add_callback('mouse hovering', func) plt.show(elli).close()

It seems that the evenName is "mouse hove…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@marcomusy
Comment options

Answer selected by marcomusy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants