pvbrowser / pvb

HMI and SCADA
http://pvbrowser.org
Other
268 stars 152 forks source link

Feature request: VTK callback from pvQVtkTclWidget()? #32

Open Ryton opened 3 years ago

Ryton commented 3 years ago

<tl;dr>Does the pvQVtkTclWidget support a user interaction callback to the main program? From the code, I think it does not?</tl;dr>

Full story: pvQVtkTclWidget() is set up and commanded through TCL, without any feedback (afaik), its tricky / impossible (for me at least) to get the interactor feedback to the program.

There might be two main pathways to implement this: 1) Create a class that inherits from vtkCallbackCommand reimplementing Execute( vtkObject caller, unsigned long evId, void) and setting pointers to a client and/or call data as needed. When the class is implemented, it becomes the callback function. 2) Create a function with this signature: void f( vtkObject caller, long unsigned int evId, void clientData, void* callData) and, where needed, create a vtkCallbackCommand setting its callback to the function we have created.

Yet to my knowledge, neither is available in pvbrowser?

Do you have a suggestion on how to pass back a user interaction with this VTKwidget? Say, a mouseover or mouseclick in the VTK-space, or even more specific: vtkPointPicker info? As we do get position and click data in canvas (in C++), and the picking info in TCL (as a picker object) ,but this info on the object interaction -to my knowledge- is not available in C++?